Using a relay (the neverending story)
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 4
- Joined: 12 Nov 2017, 14:25
Using a relay (the neverending story)
Hello,
I'm sorry to get on your nervs with this (i hope so) simple problem. I have an esp8266-01 and tried to switch an relay on gpio2 following the explanation on https://www.letscontrolit.com/wiki/index.php/Relais.
I could switch it on with http://<ip-adress>/control?cmd=GPIO,2,0 or 1
And thats the problem. I doesn't make any difference if I try a zero or a one. The Relais always get activatet. But I can't switch if off!:-(
The relais looks exactly like the single relais on the picture on https://www.letscontrolit.com/wiki/index.php/Relais. So it uses a SRD-05VDC-SL-C
Could someone please explain me, what I'm doing wrong? Thank you very much in advance.
I'm sorry to get on your nervs with this (i hope so) simple problem. I have an esp8266-01 and tried to switch an relay on gpio2 following the explanation on https://www.letscontrolit.com/wiki/index.php/Relais.
I could switch it on with http://<ip-adress>/control?cmd=GPIO,2,0 or 1
And thats the problem. I doesn't make any difference if I try a zero or a one. The Relais always get activatet. But I can't switch if off!:-(
The relais looks exactly like the single relais on the picture on https://www.letscontrolit.com/wiki/index.php/Relais. So it uses a SRD-05VDC-SL-C
Could someone please explain me, what I'm doing wrong? Thank you very much in advance.
-
- Core team member
- Posts: 9904
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: Using a relay (the neverending story)
I assume you are using some transistor to operate the relais? The output of the ESP is not powerful enough to directly operate the relais.
And do you have a diode over the relais? (to protect the rest of the electronics when working with coils)
Can you measure the Voltage on the relais coil, with a multimeter?
And perhaps exchange the relais for a LED with resistor, just to check it is working.
And do you have a diode over the relais? (to protect the rest of the electronics when working with coils)
Can you measure the Voltage on the relais coil, with a multimeter?
And perhaps exchange the relais for a LED with resistor, just to check it is working.
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
A transistor is not necessary ehre as there modules use an opto coupler and a transistor on the relay board.
Sadly iu don't have this relay board as a sample so i just have to guess.
Can you please give the pin descriptions?
I just guess it is
- GND
- VCC
- IN
- JD-VCC (or something similiar)
Did you connect Vcc to 5V?
Regards
Shardan
Sadly iu don't have this relay board as a sample so i just have to guess.
Can you please give the pin descriptions?
I just guess it is
- GND
- VCC
- IN
- JD-VCC (or something similiar)
Did you connect Vcc to 5V?
Regards
Shardan
Regards
Shardan
Shardan
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Hm... inspecting the relay modules i have i got a suspicion.
Beware, this might not work as i don't have your module and can't test.
Try to just add 3 diodes in serial as shown here: If your module has the same schematic as my ones have the opto coupler is fed with 5V.
If the ESP's GPIO is "high" it has ~3.3V. So a voltage of 1.7V is still on the opto coupler.
This is enough to keep the relay working.
The diodes have a forward voltage of ~ 0.7V so this simple trick adds ~ 2.1Vto the esp's output voltage.
Maybe give it a try.
Regards
Shardan
Beware, this might not work as i don't have your module and can't test.
Try to just add 3 diodes in serial as shown here: If your module has the same schematic as my ones have the opto coupler is fed with 5V.
If the ESP's GPIO is "high" it has ~3.3V. So a voltage of 1.7V is still on the opto coupler.
This is enough to keep the relay working.
The diodes have a forward voltage of ~ 0.7V so this simple trick adds ~ 2.1Vto the esp's output voltage.
Maybe give it a try.
Regards
Shardan
You do not have the required permissions to view the files attached to this post.
Regards
Shardan
Shardan
-
- New user
- Posts: 4
- Joined: 12 Nov 2017, 14:25
Re: Using a relay (the neverending story)
Thank you for your answers,
@Shardan yeah its exactly some kind of module you specified. I connected it directly with 5 volt power and the gpio with the port on the relais. So you means I just need 3 diodes (in the right direction of course!), put them in a line and it would work?
Sorry, I'm an absolutly newbie in electric systems but very interested. I will give it a try and tell you.
Thank you for your help!
@Shardan yeah its exactly some kind of module you specified. I connected it directly with 5 volt power and the gpio with the port on the relais. So you means I just need 3 diodes (in the right direction of course!), put them in a line and it would work?
Sorry, I'm an absolutly newbie in electric systems but very interested. I will give it a try and tell you.
Thank you for your help!
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Well, i'm not sure, i can't test as i lack that relay module. But worth a try anyways, these diodes are cheapest stuff.johnnybee wrote: ↑12 Nov 2017, 18:53 Thank you for your answers,
@Shardan yeah its exactly some kind of module you specified. I connected it directly with 5 volt power and the gpio with the port on the relais. So you means I just need 3 diodes (in the right direction of course!), put them in a line and it would work?
Sorry, I'm an absolutly newbie in electric systems but very interested. I will give it a try and tell you.
Thank you for your help!
Regards
Shardan
Shardan
-
- Normal user
- Posts: 497
- Joined: 04 Oct 2016, 23:16
Re: Using a relay (the neverending story)
Can you post a picture of your relay module?
All the ones I've seen have 3 pins and they requires separate power than the signal...
All the ones I've seen have 3 pins and they requires separate power than the signal...
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
-
- New user
- Posts: 4
- Joined: 12 Nov 2017, 14:25
Re: Using a relay (the neverending story)
IT's the following relay:
I bought it from Ebay. The Relay needs 5V power to work but the in1 power was not specified. To it sounds (for me) logical right that i need 5V vor in1 too. Or is this wrong?
I bought it from Ebay. The Relay needs 5V power to work but the in1 power was not specified. To it sounds (for me) logical right that i need 5V vor in1 too. Or is this wrong?
You do not have the required permissions to view the files attached to this post.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Using a relay (the neverending story)
You could test with 3.3V just to see (or hear) if the relay is pulled.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Hm... this board is quite simple, not even an opto coupler.
Can you please make a very basic test:
- Just connect the board to 5V and ground.
- Then connect IN to Vcc first - does the relay "click"?
- if not, connect IN to GND - does it click now?
This is just for testing if the board works as expected and which transistor type is mounted on the board, NPN/N-ch or PNP/P-Ch.
Please tell the result, if the relay switches with IN=low (GND) or IN=high (Vcc).
Then we'll see what to do.
Regards
Shardan
Can you please make a very basic test:
- Just connect the board to 5V and ground.
- Then connect IN to Vcc first - does the relay "click"?
- if not, connect IN to GND - does it click now?
This is just for testing if the board works as expected and which transistor type is mounted on the board, NPN/N-ch or PNP/P-Ch.
Please tell the result, if the relay switches with IN=low (GND) or IN=high (Vcc).
Then we'll see what to do.
Regards
Shardan
Regards
Shardan
Shardan
-
- New user
- Posts: 4
- Joined: 12 Nov 2017, 14:25
Re: Using a relay (the neverending story)
Chaca, i get it!:-)
Shardan, you was right! I needed just two diodes in line and now it's switching as it should!:-) I'm happy!
Thank you very much for your help!
And I make the test also. It's switch on when IN1 is on gnd.
Greetings
Thomas
Shardan, you was right! I needed just two diodes in line and now it's switching as it should!:-) I'm happy!
Thank you very much for your help!
And I make the test also. It's switch on when IN1 is on gnd.
Greetings
Thomas
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
-
- Normal user
- Posts: 120
- Joined: 15 Dec 2015, 14:07
Re: Using a relay (the neverending story)
relay's I hate them 

Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
The biggest problem: there is no "standard" relay board.
Every relay board has another schematic.
Basically they all work. As soon as different voltages come up things get complex.
The ESP runs on 3.3V, relays run on 5..12 V usually.
Is the input part of the relay board (transistor, opto coupler...) connected to GND or
to the voltage of the relays? The later won't run without problems.
Oh and btw: The "security feature" of opto couplers is a nuisance in most cases.
Most people drive the opto couplers from the same power supply they use for the relays.
So the isolation the opto provides between input and output does not exist - it is done away by the wires of the power supply.
Second - a relay is a nice isolating device (if you chose some quality ones of course).
So what is the isolation of the opto coupler for?
Maybe we should revamp the "Relay" part in the wiki and put up some explanation what works or not and why.
(And no: Solid State Relays are not better always....)
Regards
Shardan
Every relay board has another schematic.
Basically they all work. As soon as different voltages come up things get complex.
The ESP runs on 3.3V, relays run on 5..12 V usually.
Is the input part of the relay board (transistor, opto coupler...) connected to GND or
to the voltage of the relays? The later won't run without problems.
Oh and btw: The "security feature" of opto couplers is a nuisance in most cases.
Most people drive the opto couplers from the same power supply they use for the relays.
So the isolation the opto provides between input and output does not exist - it is done away by the wires of the power supply.
Second - a relay is a nice isolating device (if you chose some quality ones of course).
So what is the isolation of the opto coupler for?
Maybe we should revamp the "Relay" part in the wiki and put up some explanation what works or not and why.
(And no: Solid State Relays are not better always....)
Regards
Shardan
Last edited by Shardan on 22 Nov 2017, 19:49, edited 1 time in total.
Regards
Shardan
Shardan
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Using a relay (the neverending story)
+1
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Using a relay (the neverending story)

i agree , ssr downright suck when trying to switch DC

with AC they do have their advantages(switching at zero current, no arc, no wear), but downsides like leakage current (important when using low power LED) and heat generation must be considered in their application as well as their most common failure mode (they short out). all depends on what you are trying to achieve, for example sodium lamp ballast is very unreliable with traditional relays, the contacts often start sticking (even when using 30A rated relay, with a 400w ballast) no probs with ssr.
on the other hand, when trying to switch a 6w LED, there is the problem of flickering when switched off due to leakage current with ssr, a tradional relay is the much netter choice
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Yes and no.
There are specialized SSR that work with DC too.... youll find them with searching for high price...
With AC it depends on what you want to switch.
They are nice with resitive load - but what is really pure resitive these days? Inductivities, coils, valves, motors and such can execute an SSR within seconds.
I've just tested something very simple: A solenoid valve of about 5 watt power consumption with a standard "3 EUR AliExpress SSR".
Valve: https://de.aliexpress.com/item/co2-diy- ... eLevelAB=1
Relay: https://de.aliexpress.com/item/4pcs-lot ... eLevelAB=1
The SSR is made for 5A, says > 1000 watt on mains voltage.
I've just made it switch 5 sec on, 5 sec off. It took some on/off's and the valve was opened permanently, the relay shorted.
The induced voltage in the valve's coil even from this small gas valve killed the triac in the SSR.
I'm testing this for a pH control based on ESPEasy. I'm not too surprised about the destroyed relay, i expected that.
I'll have to repeat the test with a resistor/capacitor combination and / or a varistor to make switching reliable.
Murphy's law is valid as usual: Behind every problem you solve two others wait to appear.....
Regards
Shardan
There are specialized SSR that work with DC too.... youll find them with searching for high price...

With AC it depends on what you want to switch.
They are nice with resitive load - but what is really pure resitive these days? Inductivities, coils, valves, motors and such can execute an SSR within seconds.
I've just tested something very simple: A solenoid valve of about 5 watt power consumption with a standard "3 EUR AliExpress SSR".
Valve: https://de.aliexpress.com/item/co2-diy- ... eLevelAB=1
Relay: https://de.aliexpress.com/item/4pcs-lot ... eLevelAB=1
The SSR is made for 5A, says > 1000 watt on mains voltage.
I've just made it switch 5 sec on, 5 sec off. It took some on/off's and the valve was opened permanently, the relay shorted.
The induced voltage in the valve's coil even from this small gas valve killed the triac in the SSR.
I'm testing this for a pH control based on ESPEasy. I'm not too surprised about the destroyed relay, i expected that.
I'll have to repeat the test with a resistor/capacitor combination and / or a varistor to make switching reliable.
Murphy's law is valid as usual: Behind every problem you solve two others wait to appear.....
Regards
Shardan
Regards
Shardan
Shardan
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Using a relay (the neverending story)
One needs to be very careful when sourcing SSR. There are lots of fakes and parts with underdimensioned components, f.e. : https://www.youtube.com/watch?v=DxEhxjvifyY http://www.instructables.com/id/The-inn ... OTEK-SSRs/
My experience with ebay/Ali is equally bad. That's why I pointed out the pollin relays in the wiki.
These two work directly on an ESP GPIO and I can confirm their reliabilty, also when switching inductive loads like solenoids, motors, ballasts, though I never went even close to their rated currents. Particularly the solenoid is an application where I changed 3 mechanical relays in 3 months (sticking contacts) before changing to SSR.
https://www.pollin.de/p/solid-state-rel ... 0-v-340633
https://www.pollin.de/p/solid-state-rel ... 0-v-340470
I haven't tried these ones:
https://www.pollin.de/p/solid-state-rel ... 0-v-340625 but chances are, they work reliebly as well.
I feel like its worth spending a bit of extra money on the 230VAC components.
My experience with ebay/Ali is equally bad. That's why I pointed out the pollin relays in the wiki.
These two work directly on an ESP GPIO and I can confirm their reliabilty, also when switching inductive loads like solenoids, motors, ballasts, though I never went even close to their rated currents. Particularly the solenoid is an application where I changed 3 mechanical relays in 3 months (sticking contacts) before changing to SSR.
https://www.pollin.de/p/solid-state-rel ... 0-v-340633
https://www.pollin.de/p/solid-state-rel ... 0-v-340470
I haven't tried these ones:
https://www.pollin.de/p/solid-state-rel ... 0-v-340625 but chances are, they work reliebly as well.
I feel like its worth spending a bit of extra money on the 230VAC components.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Definitely. I'm testing around to see where the line between best price and cheap garbage is crossed.
Up to now the "Mager GJ-5-L" seems to work, testing the "Hoymk D3805HK" atm.
Sortet out a lot meantime, simply they are garbage.
Anyways, even really expensive, high quality ones get killed under inductive load.
The voltage peak can reach > 1000V, that's dangerous for every triac.
I've tested this with cheap SSR's, i've tested with expensife ones (Carlo Gavazzi, Comus, finder, Sharp).
With inductive load they all die sooner or later. Some are marked "snubberless" - anyways they die too.
Those relays with built-in "snubber" circuit are a game of luck. A snubber is a resistor/capacitor combination
that should "arrest" high voltage peaks. In theory that works - if the capacitor is tuned to the inductive load the ssr switches.
The capacitor and the inductive load build a resonant circuit to lead off the peaks. As the relay manufacturer doesn't lnow
what we want to switch, dimensioning might be good or bad.
Atm the best way to protect the ssr seems to be a varistor with 250..300 VAC.
I'll test that the next days with several SSRs.
For mechanical relays i'm using the Fuujitsu/Takamisawa JS-12 MN KT (12V) or JS-5 MN KT (5V).
They have some distance between low voltage and mains voltage so with some effort on PCB design
it's possible to avoid milling out gaps.
Regards
Shardan
Shardan
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Shardan wrote: ↑24 Nov 2017, 11:14Definitely. I'm testing around to see where the line between best price and cheap garbage is crossed.
Up to now the "Mager GJ-5-L" seems to work, testing the "Hoymk D3805HK" atm.
Sortet out others over time, simply they are garbage.
Anyways, even really expensive, high quality ones get killed under inductive load.
The voltage peak can reach > 1000V, that's dangerous for every triac.
I've tested this with cheap SSR's, i've tested with expensife ones (Carlo Gavazzi, Comus, finder, Sharp).
With inductive load they all die sooner or later. Some are marked "snubberless" - anyways they die too.
Those relays with built-in "snubber" circuit are a game of luck. A snubber is a resistor/capacitor combination
that should "arrest" high voltage peaks. In theory that works - if the capacitor is tuned to the inductive load the ssr switches.
The capacitor and the inductive load build a resonant circuit to lead off the peaks. As the relay manufacturer doesn't lnow
what we want to switch, dimensioning might be good or bad.
Atm the best way to protect the ssr seems to be a varistor with 250..300 VAC.
I'll test that the next days with several SSRs.
For mechanical relays i'm using the Fuujitsu/Takamisawa JS-12 MN KT (12V) or JS-5 MN KT (5V).
They have some distance between low voltage and mains voltage so with some effort on PCB design
it's possible to avoid milling out gaps.
Regards
Shardan
Shardan
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
As promised i uploaded some descriptions to the wiki.
https://www.letscontrolit.com/wiki/inde ... cal_Relays
Let me know if that helps guys.
Regards
Shardan
https://www.letscontrolit.com/wiki/inde ... cal_Relays
Let me know if that helps guys.
Regards
Shardan
Regards
Shardan
Shardan
-
- Normal user
- Posts: 64
- Joined: 11 May 2017, 01:19
Re: Using a relay (the neverending story)
I use relay board with JVcc , separate rail for relay.
Regards,
PS. Ref: ESP8266 GPIO Behaviour at Boot
Regards,
PS. Ref: ESP8266 GPIO Behaviour at Boot
You do not have the required permissions to view the files attached to this post.
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
Nice analysis, good job.
The different behaviour of the GPIOs is somewhat easy to explain.
The ESP8266 is a kind of a jack of all trade device. Due to that nearly all GPIO's are hardwired internally to more then one function.
D0 (GPIO16) is internally used for deep sleep wake up. D5...D8 can be used as GPIO or additional SPI bus.
D3 (GPIO 0) is used to set flash mode at start up, D4 (GPIO 2) can be used to switch into other start modes, starting from a SD-card for example.
And so on.
So at boot these GPIO's will show some different behavior, that's just normal.
On top there is another point that has some effect on the GPIO pins.
The pins can be set to internal "weak" pull resistors at startup. This is usually done by the sketch you run.
As this is done at boot up time / starttime of the sketch this leads to some signals on the GPIOs too on startup.
Anyways the relay board you use is one of the "problem boards" switching on "low" signal".
All in all the conclusion is that boot time is not stable on GPIO's but that's a normal behaviour.
Even big CPU's like the ones in a PC do that. They use a line driver that is inhibited at startup to suppress such signals if necessary.
Last but not least - that relay board is not suitable for mains voltage at least in the EU.
The copper to copper distance between mains voltage and the low voltage circuit is far too low and the board has no millings to keep leak current off
as it is requiered by EU policies.
Regards
Shardan.
The different behaviour of the GPIOs is somewhat easy to explain.
The ESP8266 is a kind of a jack of all trade device. Due to that nearly all GPIO's are hardwired internally to more then one function.
D0 (GPIO16) is internally used for deep sleep wake up. D5...D8 can be used as GPIO or additional SPI bus.
D3 (GPIO 0) is used to set flash mode at start up, D4 (GPIO 2) can be used to switch into other start modes, starting from a SD-card for example.
And so on.
So at boot these GPIO's will show some different behavior, that's just normal.
On top there is another point that has some effect on the GPIO pins.
The pins can be set to internal "weak" pull resistors at startup. This is usually done by the sketch you run.
As this is done at boot up time / starttime of the sketch this leads to some signals on the GPIOs too on startup.
Anyways the relay board you use is one of the "problem boards" switching on "low" signal".
All in all the conclusion is that boot time is not stable on GPIO's but that's a normal behaviour.
Even big CPU's like the ones in a PC do that. They use a line driver that is inhibited at startup to suppress such signals if necessary.
Last but not least - that relay board is not suitable for mains voltage at least in the EU.
The copper to copper distance between mains voltage and the low voltage circuit is far too low and the board has no millings to keep leak current off
as it is requiered by EU policies.
Regards
Shardan.
Regards
Shardan
Shardan
-
- Normal user
- Posts: 64
- Joined: 11 May 2017, 01:19
Re: Using a relay (the neverending story)
That's i always use expanders to activate the relay.
This type of relay(quality) shouldn't be use on main.Shardan wrote: ↑01 Dec 2017, 20:38 Last but not least - that relay board is not suitable for mains voltage at least in the EU.
The copper to copper distance between mains voltage and the low voltage circuit is far too low and the board has no millings to keep leak current off
as it is requiered by EU policies.
Regards,
-
- Normal user
- Posts: 120
- Joined: 15 Dec 2015, 14:07
Re: Using a relay (the neverending story)
If you use an extender like the PCF8574 (https://www.letscontrolit.com/wiki/index.php/PCF8574)
a relay should not be doing crazy things anymore?
It states that the PCF8574 keeps the GPIO states at ESP8266 reboot.
a relay should not be doing crazy things anymore?
It states that the PCF8574 keeps the GPIO states at ESP8266 reboot.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Using a relay (the neverending story)
I made that statement, it's true, I tried. You can reboot/reset the esp, gpio of pcf keep their state until they receive new instructions via i2cDeNB3rt wrote: ↑11 Dec 2017, 11:15 If you use an extender like the PCF8574 (https://www.letscontrolit.com/wiki/index.php/PCF8574)
a relay should not be doing crazy things anymore?
It states that the PCF8574 keeps the GPIO states at ESP8266 reboot.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 120
- Joined: 15 Dec 2015, 14:07
Re: Using a relay (the neverending story)
that's just great! Could that chip drive an relay board with opto?
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Using a relay (the neverending story)
Should not be a problem.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Using a relay (the neverending story)
I've tested a PCF8574 with the usual 8ch relay board with optocouplers.

Remember, if you use same power supply for relay and ESP/PCF, the opto couplers are useless as GND and VCC are connected and "bridge" the isolation of the optos.
Regards
Shardan
Regards
Shardan
Shardan
Who is online
Users browsing this forum: Anthropic Claude Bot [bot] and 14 guests