ESP8266 Dry Relays contact

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

ESP8266 Dry Relays contact

#1 Post by LoTheGeek » 17 Apr 2017, 10:58

Hi,

I'm planning to connect my Gates (exterior and garages) to my domoticz server. As I'm totally newbie I'm reading a lot but I would like also to order the components.
The 3 gates are automated with Nice appliance (POPKit/POA1 & Nice Spin 6021).
I can use a dry contact on the motor unit but I'm thinking of using dry contacts on the remote in order to be able to separate the open and closed orders. I will need one Flor4s, one flor2S and 6 Dry relays (I'm not sure of the english world. I mean a relay NO/NC without power on the output)

I originally thought to place a ZK1PA and to control it with RFLink but I'm a little worried about security.

So i would like to do it with a ESP8266 but I didn't find how to connect it with a Dry relay. I'm a little lost, and each time i found something there is power on the relay output.

Could you please help me to identify how to realize this and what shall I order ?

Thanks a lot for your feedbacks.

Laurent

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#2 Post by toffel969 » 17 Apr 2017, 12:19

LoTheGeek wrote: 17 Apr 2017, 10:58 Hi,

I'm planning to connect my Gates (exterior and garages) to my domoticz server. As I'm totally newbie I'm reading a lot but I would like also to order the components.
The 3 gates are automated with Nice appliance (POPKit/POA1 & Nice Spin 6021).
I can use a dry contact on the motor unit but I'm thinking of using dry contacts on the remote in order to be able to separate the open and closed orders. I will need one Flor4s, one flor2S and 6 Dry relays (I'm not sure of the english world. I mean a relay NO/NC without power on the output)

I originally thought to place a ZK1PA and to control it with RFLink but I'm a little worried about security.

So i would like to do it with a ESP8266 but I didn't find how to connect it with a Dry relay. I'm a little lost, and each time i found something there is power on the relay output.

Could you please help me to identify how to realize this and what shall I order ?

Thanks a lot for your feedbacks.

Laurent
Hi

Let me make sure I understand what you mean correctly: you need relays with potential free contacts (as in no power connected to it)

If that is the case, then yes you can do that with esp easy. I use them to immitate "button pressed" on a remote for my blinds (dont have RFLink) just soldered wires parallel to the button and connected to relay.


check the wiki, there are plenty of relay boards (1 to 16 relays per board) that can be driven with the 3.3 V TTL level of ESP. Just check

https://www.letscontrolit.com/wiki/index.php/Relais
https://www.letscontrolit.com/wiki/index.php/GPIO
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

Re: ESP8266 Dry Relays contact

#3 Post by LoTheGeek » 17 Apr 2017, 16:02

Thanks a Lot for your answer
Yes, you understood what I want to do.

Is something like the following items Will work ?
https://m.aliexpress.com/s/item/32685596353.html
https://m.fr.aliexpress.com/s/item/32714920351.html

I Will need to power it with something like this
https://www.amazon.com/Breadboard-Modul ... B01MT640P8

Which esp8266 do you recommend to pilot it ? Can I control the 6 relays with only one esp8266
Is everything compatible with breadboard ?

Thanks

Laurent

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 Dry Relays contact

#4 Post by Shardan » 17 Apr 2017, 18:14

Hello,

these relay boards should work, at least the ones I have tried do work.

For six relays you will need at least a ESP-07 or better an ESP-12E or 12F.
The smaller ones do not have enough GPIO pins.
But the ESP's usually are not breadboard friendly.

If you want to do breadboard testing i'd recommend a NodeMCU V3:
https://www.aliexpress.com/item/NodeMcu ... 6dad0c2e74

The NodeMCU contains an ESP-12E, the USB to TTL converter for flashing and monitoring the serial port and the voltage regulator from 5V to 3,3 V.
So anything you need is already on the board. Usually they run on power from the USB port of a computer but it is possible to supply 5V externally
with the NodeMCU too.

The NodeMCU is breadboard friendly.
Just the relays need a separate power supply, usually 5V.
I recommend to keep power supply for relays and ESP separate.

As all pins from the ESP is led out to pins you have enough pins for 6 relays and still GPIO's left for an I²C sensor or something like that.

Regards
Shardan
Regards
Shardan

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#5 Post by toffel969 » 17 Apr 2017, 23:31

LoTheGeek wrote: 17 Apr 2017, 16:02 Thanks a Lot for your answer
Yes, you understood what I want to do.

Is something like the following items Will work ?
https://m.aliexpress.com/s/item/32685596353.html
https://m.fr.aliexpress.com/s/item/32714920351.html

I Will need to power it with something like this
https://www.amazon.com/Breadboard-Modul ... B01MT640P8

Which esp8266 do you recommend to pilot it ? Can I control the 6 relays with only one esp8266
Is everything compatible with breadboard ?

Thanks

Laurent
Yes they are all fine. If you are starting and don't have to watch every cent you are spending, I also highly recommend using dev-boards. NodeMcu is a good choice, Wemos D1 pro mini (possible to connect external antenna if range is an issue), Wemos D1 has awesome power regulator (up to 24v input, 5v source to power relay). It is possible to power the relays from the same 5V power source than the esp, provided that it can give enough current ( a large elko helps).
http://www.ebay.de/itm/401253107459?_tr ... EBIDX%3AIT

Dont buy single ESP modules, it will frustrate you.

If you need many more outputs check out the I2C port expander, I think up to 64 relays per esp are possible
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

Re: ESP8266 Dry Relays contact

#6 Post by LoTheGeek » 18 Apr 2017, 12:53

Hi,

Thanks for your help
I will order a wemos D1 mini
I only need to learn how to solder

Any advice on a good AliExpress Shop to purchase wemos relays etc...

Laurent

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#7 Post by toffel969 » 18 Apr 2017, 16:44

Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 Dry Relays contact

#8 Post by grovkillen » 18 Apr 2017, 17:36

But be aware that upon boot the relay might trigger causing the ESP to halt the boot.

An expansion board fix that problem.

PCF8574 I2C Interface 8-bit IO Expansion Board I/O Expander I2C-Bus Evaluation Development Module
http://s.aliexpress.com/EvAbmAf6
(from AliExpress Android)

But this is not mentioned anywhere in the wiki...
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 :idea: :idea: :idea:

LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

Re: ESP8266 Dry Relays contact

#9 Post by LoTheGeek » 18 Apr 2017, 18:19

Thanks for this warning
Could you please give me more details on where shall I connect this expansion board and how to use It ?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#10 Post by toffel969 » 18 Apr 2017, 18:46

grovkillen wrote: 18 Apr 2017, 17:36 But be aware that upon boot the relay might trigger causing the ESP to halt the boot.

An expansion board fix that problem.

PCF8574 I2C Interface 8-bit IO Expansion Board I/O Expander I2C-Bus Evaluation Development Module
http://s.aliexpress.com/EvAbmAf6
(from AliExpress Android)

But this is not mentioned anywhere in the wiki...
That problem occurs only on certain GPIOs (2,3,4,15). Usage of the I2C Expander is in the wiki, fairly easy: connect to I2C, Vcc and GND and then look in the wiki for command reference. Even better, you can daisychain these modules=put up to 8 modules after one anonther
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 Dry Relays contact

#11 Post by grovkillen » 18 Apr 2017, 19:13

toffel969 wrote: 18 Apr 2017, 18:46 That problem occurs only on certain GPIOs (2,3,4,15). Usage of the I2C Expander is in the wiki, fairly easy: connect to I2C, Vcc and GND and then look in the wiki for command reference. Even better, you can daisychain these modules=put up to 8 modules after one anonther
GPIO 16 as well.
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 :idea: :idea: :idea:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 Dry Relays contact

#12 Post by grovkillen » 18 Apr 2017, 19:30

grovkillen wrote: 18 Apr 2017, 17:36 But this is not mentioned anywhere in the wiki...
Just to be clear, the warning about GPIOs triggering relays on boot is not mentioned. (Should be stated in the ESPeasy GUI when choosing the relay plugin...).
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 :idea: :idea: :idea:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#13 Post by toffel969 » 18 Apr 2017, 20:26

grovkillen wrote: 18 Apr 2017, 19:30
grovkillen wrote: 18 Apr 2017, 17:36 But this is not mentioned anywhere in the wiki...
Just to be clear, the warning about GPIOs triggering relays on boot is not mentioned. (Should be stated in the ESPeasy GUI when choosing the relay plugin...).
True... :roll:
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

Re: ESP8266 Dry Relays contact

#14 Post by LoTheGeek » 18 Apr 2017, 21:03

Thanks to everybody.

I will place my purchase order. I may require more help when I will receive it.
Meanwhile, I will continue to study.

I will of course keep you in touch with the developments

Laurent

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#15 Post by toffel969 » 18 Apr 2017, 22:28

grovkillen wrote: 18 Apr 2017, 19:30
grovkillen wrote: 18 Apr 2017, 17:36 But this is not mentioned anywhere in the wiki...
Just to be clear, the warning about GPIOs triggering relays on boot is not mentioned. (Should be stated in the ESPeasy GUI when choosing the relay plugin...).
Hi again
As far as I know the relay is not an plugin as such but just a use case of digital output of GPIO pin (can be monitored with the switch device).
I updated the wiki with the info from this thread + some info about solid state relays. If you don't mind please check through it and edit/let me know if you agree. @shardan could you do the same?

best regards
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 Dry Relays contact

#16 Post by grovkillen » 19 Apr 2017, 05:47

toffel969 wrote: 18 Apr 2017, 22:28 Hi again
As far as I know the relay is not an plugin as such but just a use case of digital output of GPIO pin (can be monitored with the switch device).
I updated the wiki with the info from this thread + some info about solid state relays. If you don't mind please check through it and edit/let me know if you agree. @shardan could you do the same?

best regards
Great update. Two things;

1. What if the relay board must be fed with 5V TTL logic? Mentioned a level converter? Also possible extra page with how a level converter work? Pictures of different kinds?

2. Mention that a I2C GPIO Expander board might be a good solution to avoid false trigger during boot?

Great work though! :-)
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 :idea: :idea: :idea:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP8266 Dry Relays contact

#17 Post by toffel969 » 19 Apr 2017, 11:40

grovkillen wrote: 19 Apr 2017, 05:47
toffel969 wrote: 18 Apr 2017, 22:28 Hi again
As far as I know the relay is not an plugin as such but just a use case of digital output of GPIO pin (can be monitored with the switch device).
I updated the wiki with the info from this thread + some info about solid state relays. If you don't mind please check through it and edit/let me know if you agree. @shardan could you do the same?

best regards
Great update. Two things;

1. What if the relay board must be fed with 5V TTL logic? Mentioned a level converter? Also possible extra page with how a level converter work? Pictures of different kinds?

2. Mention that a I2C GPIO Expander board might be a good solution to avoid false trigger during boot?

Great work though! :-)
Thanks, will do
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 Dry Relays contact

#18 Post by Shardan » 19 Apr 2017, 16:35

Depends on the internal circuit of the relay boards. But first some Basic things.

The Relay boards use 5 V. The ESP / NodeMCU / WeMOS uses 5 V.
Sounds easy, one power supply does it all.

Besides the relays may give some interference to the voltage leading to unpredictable behaviour there is another reason for using two separated powersupplies.
These relay boards use optocouplers for a good Isolation ( up to 3000 or more volts! ) between the ESP and mains voltage.
The signal is transfered optically, so with a good realy board there is no connection necessary between the relay voltage (5V) and the ESP voltage (5V).
Not even a ground connection between the both circuits is necessary with a good relay board.
If you use same power supply for both circuits you "bridge" between the relay circuit and ESP circuit. Why then buying a good board with optocoupler?


In wich way your relays behave on "power on" state depends how the relay board is working inside.
I can't see that from the photos. I've used this one for some testing with the PCF8574:
8-Channel-Relay-Module-Wiring-Pinout-Diagram2.jpg
8-Channel-Relay-Module-Wiring-Pinout-Diagram2.jpg (44.62 KiB) Viewed 15474 times
.
The shown module has "negative logic": you have to connect the input pins to ground.
That works quite nice as the PCF8574 seems to set all outputs to "high" on startup so nothing happens.
Setting an output to "0" via http ( http://<ESP IP address>/control?cmd=pcfgpio,<pin>,0 ) switches the relay on and vice versa.

The big advantage of the PCF8574 is the expandability. Using the I2C-lines you can expand to 8 x PCF8574 + 8x PCF8574A
( the "A" type has another address range ) this giving 128 possible outputs in theory ). Anyone did that? I'd be curious to see it.
All that can be driven by a very small ESP-01.

If you don't need expandability i'd recomment a "Linknode R8" module made by Linksprite:
LinkSprite_Linknode R8.jpg
LinkSprite_Linknode R8.jpg (184.18 KiB) Viewed 15474 times
It can be found at Amazon and others. All in one small module, 8 relays + ESP-12E.
ESPEasy can be flashed easily with a USB-to-TTL programmer, the pin header is already soldered to that bard.
Beware, the programmer must have 3,3V output. The ESP will fry when using 5V.

Regards
Shardan
Last edited by Shardan on 19 Apr 2017, 17:50, edited 1 time in total.
Regards
Shardan

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP8266 Dry Relays contact

#19 Post by grovkillen » 19 Apr 2017, 17:00

Shardan wrote: 19 Apr 2017, 16:35 ...

Regards
Shardan
Is this aimed for me? Or a general add-on to my thoughts? :-)
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 :idea: :idea: :idea:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP8266 Dry Relays contact

#20 Post by Shardan » 19 Apr 2017, 17:49

grovkillen wrote: 19 Apr 2017, 17:00
Shardan wrote: 19 Apr 2017, 16:35 ...

Regards
Shardan
Is this aimed for me? Or a general add-on to my thoughts? :-)
Soory, i took your post as an answer to the threadopener....
removed it from my post.
Regards
Shardan

LoTheGeek
Normal user
Posts: 10
Joined: 17 Apr 2017, 10:22

Re: ESP8266 Dry Relays contact

#21 Post by LoTheGeek » 19 Apr 2017, 22:34

Thanks Shardan

This is exactly what I need. However I already placed my orders. Next time I will look at this.
It may also help someone else

Best regards

Laurent

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests