automatic switching of the GPIO
Moderators: grovkillen, Stuntteam, TD-er
automatic switching of the GPIO
Hello,
I have implemented a 4 relay circuit using ESPeasy and domoticz at my home and it's been 2 months now!! But nowadays relay connected to GPIO 4 switches off randomly without any reason. I checked the log but the connection between ESP and raspberry pi is active but still, the relay switches off. Can someone help me with this issue?
I have implemented a 4 relay circuit using ESPeasy and domoticz at my home and it's been 2 months now!! But nowadays relay connected to GPIO 4 switches off randomly without any reason. I checked the log but the connection between ESP and raspberry pi is active but still, the relay switches off. Can someone help me with this issue?
Re: automatic switching of the GPIO
Is your relay input 5V or 3.3V? It may be that the relay input isn't stable enough at the high level of the ESP (3.3V) if the relay is for 5V.
/Ton (PayPal.me)
Re: automatic switching of the GPIO
Also make sure you don't have the same IDX active on other nodes. (notorious is using IDX 0 )
Re: automatic switching of the GPIO
But ESP8266 has no provision of 5V on its GPIO so we are bound to use 3.3V. And on checking using multimeter the input to the relay is 3.12 V and another relay switches at the same voltage.
So it is really tough to understand the issue
Re: automatic switching of the GPIO
Well, you can use a level converter for that (a transistor and a few resistors can make you one). 3.12V is just around the borders of acceptable for a high input signal, so, some will work and sometimes it will work, but it most likely it's unstable, as you have found out.
Can you confirm that it is indeed a 5V high-active relay? A standard ESP port can only deliver up to around 25 mA, so that may be a bit low to directly activate a relay, but should be enough for a relay-board to switch. And relay-boards usually are 3.3V compatible.
/Ton (PayPal.me)
Re: automatic switching of the GPIO
The relay is a 5v active relay. but all the 3 relays are the same and others are operating efficientlyAth wrote: ↑15 Oct 2020, 09:12Well, you can use a level converter for that (a transistor and a few resistors can make you one). 3.12V is just around the borders of acceptable for a high input signal, so, some will work and sometimes it will work, but it most likely it's unstable, as you have found out.
Can you confirm that it is indeed a 5V high-active relay? A standard ESP port can only deliver up to around 25 mA, so that may be a bit low to directly activate a relay, but should be enough for a relay-board to switch. And relay-boards usually are 3.3V compatible.
Re: automatic switching of the GPIO
That's what Ton suggested... With a lower than usual driving level the tolerances of parts may have a lot more effect.
Re: automatic switching of the GPIO
So i should use level converter in between ESP and relay. Am I right?
Re: automatic switching of the GPIO
Yes, or simply a transistor to switch the relay.
This transistor can be your level converter.
Something like this:
This schematic assumes your relay to be connected with one pin to the higher voltage (e.g. 5V rail) and you connect them to GND via the transistor.
The diode is meant to protect the transistor when the relay is released (no more current through the coil)
This transistor can be your level converter.
Something like this:
This schematic assumes your relay to be connected with one pin to the higher voltage (e.g. 5V rail) and you connect them to GND via the transistor.
The diode is meant to protect the transistor when the relay is released (no more current through the coil)
Re: automatic switching of the GPIO
Thanks, everyone!!! Using 5V worked perfectly for me!
Re: automatic switching of the GPIO
Good to hear.
Thanks for the update
Thanks for the update
Who is online
Users browsing this forum: No registered users and 31 guests