-->
Page 1 of 1

Problem with 2 channels relay

PostPosted: Mon Feb 23, 2015 2:51 pm
by zioax
I'm using a 5 relay module with esp and nodemcu, but after a few of request the relay go in loop and the esp crash. Maybe because the gpi0 is low during the boot? Is ipossible to set it high during the boot? Thanks

Re: Problem with 2 channels relay

PostPosted: Tue Feb 24, 2015 12:56 pm
by GengusKahn
You CAN'T power a relay coil from the output of the ESP, there needs to be a transistor to switch the power to the coil and a diode across the coil OR back EMF could KILL the ESP.

look at the sketch below it would need the 12V to be whatever voltage you are using to switch the relay(SS8050 40V 1500mA) and the path from GPIO_16 is what you would need to use as this is high at ESP for Low at 12V/Relay stage......
(Reset/GPIO_16 - this was done for wire adding to the ESP8266-01)

https://raw.githubusercontent.com/gengu ... LL_USE.png

The 800R and 4K7 are reversed on the base of the 12V SS8050/emitter of SS8550.
Hope this helps......

Re: Problem with 2 channels relay

PostPosted: Tue Feb 24, 2015 1:19 pm
by OssO
Most probably the relay module have transistors, so you are not feeding directly the coil.
But, the input circuit at base of each transistor can act as pull down before you use pin as output for switching the coil.
This can be the source of problem.
You can simply solve it by adding a pullup to this pin - weak enough to not destroy the pin when pulling it low, but strong enough to pull the voltage up with connected relay module . Then, the pin will be high at power up, but also the relay will be switched on by default, which can be a problem maybe for you ...
Another solution can be small NFet with pul up to VCC at gate connected to the pin. Then, drain of this transistor connect to VCC through several kohm, and also to input of relay module. Source = gnd. This will do both - provide pull up for the pin during boot, and invert input of relay - so it will be switched ON by logic low on pin, leaving the relay off during boot.
I hope it is clear, I do not want to draw it :evil:

Re: Problem with 2 channels relay

PostPosted: Tue Mar 03, 2015 5:27 am
by zioax
It's a logic relay so I don't believe need a transistor