-->
Page 1 of 2

Relay just clicks, don't stay on.

PostPosted: Mon Jan 11, 2016 6:20 pm
by zopper
Hi. I like this project and tried to use it as my entry point with ESP8266. But I have an issue with a relay. I have ESP-201 development board, the one for which jwbr made a scheme.

I'm able to switch LEDs with no issue, but when I try to control the relay ("po 16 1" as it is on pin 16), it just clicks and switches on only for a moment. There is an indicative LED which blinks, and when I tried to connect a battery-powered light through the relay, it blinks too. So I know I'm sending the signal to the relay, and because with the original firmware from AI-Thinker the relay was always on, I know it is not broken mechanically.

From what I'm doing, it looks like turning on the relay resets the chip. In the attached code, I can set red and blue LED on or of with /msg?set-to=[1|0]. And I can do it as many times I want. But when I uncomment the line touching pin 16 for the relay, it turns on only the red light, relay clicks and the program dies ("No MSG Branch Defined" until I run it again).

Am I doing something wrong, or is this a bug? Thanks for any reply.

Flash version: ESP Basic 1.75

Code: Select allmsgbranch [mybranch]
print "set the branch"
wait

[mybranch]
msgget "set-to" stateVar
print stateVar
let myReturnMsg = "You Entered " & stateVar

REM switch red LED
po 15 stateVar

REM switch relay - uncomment the following line to crash it
REM po 16 stateVar

REM switch blue LED
po 12 stateVar

msgreturn myReturnMsg
wait

Re: Relay just clicks, don't stay on.

PostPosted: Mon Jan 11, 2016 9:14 pm
by Mmiscool
Can you post the serial output from the device.

Also pin 16 is used for the deep sleep mode and should probably not be used. Try a jumper from another pin and see if the relay work on that pin.

Re: Relay just clicks, don't stay on.

PostPosted: Mon Jan 11, 2016 10:47 pm
by cwilt
Possibly a power issue.

Re: Relay just clicks, don't stay on.

PostPosted: Tue Jan 12, 2016 3:01 am
by zopper
Mmiscool wrote:Try a jumper from another pin and see if the relay work on that pin.


Yes, thank you! I connected the relay with one diode and it stays open. Is the serial output still needed, or we can already draw a conclusion? :-)