-->
Page 3 of 29

Re: Trouble with ESP-01 + 1Ch 5V relay from LC Technology

PostPosted: Sat Jan 21, 2017 4:15 pm
by MSanRafael
I spent too much time to learn how to enable and disable the relay on "1ch 5V board" from LC Technology using the ESP8266-1 WIFI core.

This board does not use GPIO0 or GPIO2 in order to activate the relay, it use the serial communication instead it.

First: you need to open Serial port communication at 9600B, any other speed does not works fine.
Ex. : Serial.begin(9600);

Second:
To enable the Relay send it by serial port:

const byte miBufferON[] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write(miBufferON, sizeof(miBufferON));

To disable the Relay send it by serial port:
const byte miBufferOFF[] = {0xA0, 0x01, 0x00, 0xA1};
Serial.write(miBufferON, sizeof(miBufferOFF));

I hope this information will be usefully to everybody..:)

Re: Trouble with ESP-01 + 1Ch 5V relay from LC Technology

PostPosted: Tue Feb 21, 2017 3:17 pm
by fcalvez
Could you please post the documentation for this module ?

Re: Trouble with ESP-01 + 1Ch 5V relay from LC Technology

PostPosted: Fri Apr 14, 2017 10:19 am
by pYr0x
MSanRafael wrote:I spent too much time to learn how to enable and disable the relay on "1ch 5V board" from LC Technology using the ESP8266-1 WIFI core.

This board does not use GPIO0 or GPIO2 in order to activate the relay, it use the serial communication instead it.

First: you need to open Serial port communication at 9600B, any other speed does not works fine.
Ex. : Serial.begin(9600);

Second:
To enable the Relay send it by serial port:

const byte miBufferON[] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write(miBufferON, sizeof(miBufferON));

To disable the Relay send it by serial port:
const byte miBufferOFF[] = {0xA0, 0x01, 0x00, 0xA1};
Serial.write(miBufferON, sizeof(miBufferOFF));

I hope this information will be usefully to everybody..:)


Hey MSanRafael can you pls give us more information. e.g. how you wired up the connection.
i put me ESP on the board and wrote in my arduino IDE a function like, then i flash the ESP.

Code: Select allvoid turnOnRelay () {
const byte miBufferON[] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write(miBufferON, sizeof(miBufferON));
}

but nothing happend.

i also tried to use the serial monitor on my arduino IDE. i connected my USB 2 Serial to the relay board (RX -> TX and TX -> RX).
i send the command you posted
Code: Select all0xA0, 0x01, 0x01, 0xA2
on Baurate 9600. i received some hieroglyphic back but the relay does not switch.

thx for help

Re: Trouble with ESP-01 + 1Ch 5V relay from LC Technology

PostPosted: Mon Apr 17, 2017 7:28 am
by Nigel Willis
I have the same problem when I use the Arduino IDE serial monitor. Still trying to find out why, I'll let you know when I do. But I can get it to work using LC Technology's own windows based serial coms client. You can download it along with a user guide for the relay module from:

http://www.fluxworkshop.com/Further%20Product%20Files/LBAA100014/LC%205V%20WIFI%20Relay%20Module.zip

Good luck.