how controll relay with esp8266?
Posted: Sunday 11 June 2017 8:38
hi friend
i want controll relay with nodemcu. can you help me how i can do it ?
i want controll relay with nodemcu. can you help me how i can do it ?
Open source Home Automation System
https://forum.domoticz.com/
can i use espeasy for relay control (in stable version) ? i dont know . if yes , please help me for relay control with espeasy.heggink wrote:Espeasy also ok?
thank you dear zak.i didn't see this page before. i read and build. i connect a 8channel relay module to nodemcu.this is interesting. thank you. but there is a problem . when i send command for on all relay , suddenly after 3 or 4 relay (turn on) so nodemcu reset and stop working. for a 2channel relay dont any problem. but for 8channel....zak45 wrote:they are plenty example in web...
https://www.letscontrolit.com/wiki/index.php/Relais
thank you for help my friendheggink wrote:I have 3 different relays from Aliexpress and all behave differently. 1 likes 5v, one is listed as 5v but only works with 3.3 and one is 3.3 but only uses an inverted signal (which was not stated on the site) so ymmv. I managed to get all to work on one of those nodemcu things, powered via micro usb and flashed with Espeasy. Even the inverted one. Most accept a 3.3 signal but some need 5v power.
thank you, this is good idea but i like buildDerik wrote:buy a linknode in China..
Flash ESPeasy..
And you have a great board!!
When you build it self cost more, and not working so wel as a linknode!!
reza wrote:thank you dear zak.i didn't see this page before. i read and build. i connect a 8channel relay module to nodemcu.this is interesting. thank you. but there is a problem . when i send command for on all relay , suddenly after 3 or 4 relay (turn on) so nodemcu reset and stop working. for a 2channel relay dont any problem. but for 8channel....zak45 wrote:they are plenty example in web...
https://www.letscontrolit.com/wiki/index.php/Relais
i think nodemcu can not support Amp for 8 pinouts for turn on .
also i have same problem with mysensors node. and i see that problem is related to WDT in arduino . after remove WDT problem solved , but in nodemcu dont use WDT .
thank you dear derik . which pins can i use for relay ? i use and test GPIO 0,2,4,5,9,10,12,13,14,15,16 . some time and when i test slow this is ok , but when i send quick command so nodemcu reset and stop.Derik wrote:reza wrote:thank you dear zak.i didn't see this page before. i read and build. i connect a 8channel relay module to nodemcu.this is interesting. thank you. but there is a problem . when i send command for on all relay , suddenly after 3 or 4 relay (turn on) so nodemcu reset and stop working. for a 2channel relay dont any problem. but for 8channel....zak45 wrote:they are plenty example in web...
https://www.letscontrolit.com/wiki/index.php/Relais
i think nodemcu can not support Amp for 8 pinouts for turn on .
also i have same problem with mysensors node. and i see that problem is related to WDT in arduino . after remove WDT problem solved , but in nodemcu dont use WDT .
I think you have the check the pinout ...
There are pins u cannot use, for a relay
Perhaps you can set in the hardware of espeasy the hardware pins to a other gpio, so you can switch 9 channels.
your image can not open for me , please give me a link of your pic.Derik wrote:@ reza:
Very complex..
Some pins u cannot use for switching, but you can use them for temp sensors:
So you can see that some pins are not to use for the switches.
Quick command?
I need to see more settings..
you are right. i test one by one . i see D4 and D8 and GPIO 9 and GPIO10 i can not use for relay. i use other pins and this is true apparently.Derik wrote:https://pradeepsinghblog.files.wordpres ... .png?w=616
Or rightclick the image and copy paste url..
That is what i say 8 pins to use is hard to get and trial and error
Some puns are needed by the esp for booting.
When you power the pin, the esp is not booting or reboot loop.
You need te switch the gpio on the bord with a dummy:
And there you place like:
ScreenShot025.jpg
For every pin u try to switch...
i have some error with mysensors and nrf radio. can i replace espeasy with mysensors? is not there any problem and bug with espeasy ? also can i use repeater in espeasy ?Derik wrote:https://pradeepsinghblog.files.wordpres ... .png?w=616
Or rightclick the image and copy paste url..
That is what i say 8 pins to use is hard to get and trial and error
Some puns are needed by the esp for booting.
When you power the pin, the esp is not booting or reboot loop.
You need te switch the gpio on the bord with a dummy:
And there you place like:
ScreenShot025.jpg
For every pin u try to switch...
Lisa wrote:Just order this one, then you're all set: https://nl.aliexpress.com/item/Sonoff-S ... 22442.html
Here's the instruction to flash it with ESPEasy: https://www.rutg3r.nl/sonoff/
And the hookup to domoticz: https://www.domoticz.com/forum/viewtopic.php?t=15171
thank you friends for help me . but if you can , please help me to found my questions.randytsuch wrote:I would add a fairly large (greater than 1000 uf) capacitor on the relay module power line to ground.
If it works slowly, but not quickly, sounds like your power supply is having trouble keeping up, and a cap would help. But you might need a bigger power supply, and maybe better wiring for the relay module.
Also, wire relay module power directly to the power supply, don't wire it through the ESP card.
I now have a couple Wemos mini ESP cards running ESP Easy, seem to be working fine.
With the ESP cards, I don't think you need mysensors and the nrf radio, they would replace those. ESP use wifi for the wireless communication.
I have one ESP outside, and am using the Wemos mini d1 pro because it has an external antenna connection. But the internal antenna is working fine. But I would get the pro for any locations where you are worried about the wifi signal.
Randy
Code: Select all
message.type == V_UP
digitalWrite(message.sensor + 2, HIGH);
delay(500);
digitalWrite(message.sensor + 3, LOW);
message.type == V_STOP
digitalWrite(message.sensor + 2, HIGH);
delay(500);
digitalWrite(message.sensor + 3, HIGH);
message.type == V_DOWN
digitalWrite(message.sensor + 3, HIGH);
delay(500);
digitalWrite(message.sensor + 2, LOW);