# Relays for dummies

**URL:** <https://discourse.nodered.org/t/relays-for-dummies/13714>\
**Category:** Hardware\
**Created:** [26 July 2019 11:11 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714 "2019-07-26T11:11:13Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [31 July 2019 10:37 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/41 "2019-07-31T10:37:23Z")

</div>

It saves you a lot of time and has many additional features. I like it!

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [31 July 2019 11:05 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/42 "2019-07-31T11:05:07Z")

</div>

> [@juntiedt](#):
>
> I like it!

How would your solution communicate with node-RED? there is no WiFi in the garage, and the garage is 35mts from the house, as described in post #1.

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [31 July 2019 12:54 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/43 "2019-07-31T12:54:23Z")

</div>

I would try to put a wifi repeater at the most nearest point to the garage. You could ckeck it with your mobile phone if the signal is strong enough.

Alternatively you could put the relay into your house and from there a cable to the motor.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [31 July 2019 15:33 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/44 "2019-07-31T15:33:15Z")

</div>

> [@iungo](#):
>
> If you already have Raspberry PI2 or PI3 and need a reliable scalable solution you can do it like this.

Hi Andrei (@iungo),  
Would be nice if you could edit your post, and add some links to the sites that offer those devices. Thanks!

> [@juntiedt](#):
>
> if you you have a wifi network you should look for "shelly pro 4 relay"

Hey Johannes (@juntiedt),  
Thanks, that could indeed be a solution for other people. But like Paul already mentioned, I don't have wifi in the garage. Moreover I have already installed a cat6 cable, because I like to keep the wireless connections to a minimum. You can call me the '_cable guy_' 😉

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [1 August 2019 18:25 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/45 "2019-08-01T18:25:28Z")

</div>

Dear Bart,

It's my own project. Unfortunately, it's not fully completed(I need to do some additional tests). I think I will finish it before September.

If you are interested, you can see progress and some information here.

> **[IOTON MICRIO](https://hackaday.io/project/166617-ioton-micrio)**
>
> In the past, I've had some experience with PLC's from different vendors (Siemens, Rockwell Automation, WAGO e.t.c.). It's respected manufacturers and they made great products. But also their products have some imperfections for me: 1. Price. It's...

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 August 2019 13:53 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/46 "2019-08-25T13:53:21Z")

</div>

> [@dynamicdave](#):
>
> Hi Bart - I think that would be a much better solution

Hey David (@dynamicdave),  
Probably the most stupid question on this forum today, but what do I need to do with the 3 grounded wires on the other side of the cable?

- Just leave them unconnected
- Connect them together like on the other side (see cable drawing)
- Connect them all to a ground pin of my Raspberry?
- Anything else?

I assume I might create such a ground-loop by doing it wrong...  
Bart

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [25 August 2019 15:24 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/47 "2019-08-25T15:24:55Z")

</div>

Hi Bart,  
I would just ground all three wires at ONE end of the cable.  
It looks like you are powering the optocoupler from the RPi, so that might be the most convenient end to find a good ground pin.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 August 2019 07:11 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/48 "2019-08-26T07:11:59Z")

</div>

Hi folks,

My hardware has arrived from Ali, so wife "_advised_" me kindly to get started with it 😉  
But I'm abit afraid of damaging my (rather expensive) garage door opener PCB, so would like to be very sure that I don't make any mistakes ...

Too me it looks like the pin 5 and pin 1 are directly connected (via the diodes), so which means a short-circuit. But probably there is something wrong in my thinking ...

So question is _**do I need to put something in between (like resistor ...)?**_  
@Paul-Reed has been so kind yesterday to visualize my question:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d8d467f691c762d31a4a0073bd1148fefda68c3a.jpeg)

Anybody has any advise ?

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [26 August 2019 10:47 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/49 "2019-08-26T10:47:23Z")

</div>

Do you measure a voltage between PIN1 and PIN5?

Which optocouplers do you use?

How does your door controller activate? By short PIN10 with PIN1 or something else?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 August 2019 11:49 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/50 "2019-08-26T11:49:30Z")

</div>

Hey Andrei (@iungo),  
The drawings from Paul and the links to both optocoupler types are above in this [post](https://discourse.nodered.org/t/relays-for-dummies/13714/35). I need to measure of voltage of 23,4 V on pin 5 and 6 of my garage door openers. By combining both measurements in my Node-RED flow, I should be able to determine the current status of the door (see [curve](https://discourse.nodered.org/t/relays-for-dummies/13714/9) in this post).  
Bart

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [26 August 2019 15:10 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/51 "2019-08-26T15:10:30Z")

</div>

You do not need 220R resistor.

At first, try to test modules. For **MRI-3.3D48** :

Disconnect power from your raspberry.

Please, use good convenient connector wires. Don't short 3.3v raspberry pin with 5V, or you will destroy your raspberry!!!

1. Connect red wire to the A1 terminal and black wire to the A2 terminal.
2. Connect the black wire to your raspi gnd pin(PIN6).
3. Connect the red wire to your raspi 3.3v pin(PIN1).
4. Connect power to your raspberry. The led on MRI-3.3D48 must light on.
5. Connect the yellow wire between the MRI-3.3D48 (+) terminal and raspberry pi 5v (PIN2)
6. Measure voltage between (PIN6 raspberry) and terminal A MRI-3.3D48, when led I on you will see 5V on the multimeter, after disconnecting the wire from A1 terminal, the multimeter must show 0V.  
(if you don't have a multimeter, use led and 1k resistor instead)

I think you DON'T need the pulldown resistor (0 terminal) at your project. I think your door controller has pulldown inside.

In addition, I can't figure out how your door controller work, because don't have any user manual for it, therefore don't know door controller pinout and pins control voltage.

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [26 August 2019 15:18 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/52 "2019-08-26T15:18:06Z")

</div>

For **MRI-24D4** :

Just connect door controller PIN5 to A1 **MRI-24D4** and door controller PIN1 to A2 **MRI-24D4**.

When the door open/close you must see led light on/off

This connection is absolutely safe if the voltage between PIN1 and PIN5 \< 30V

If it work, connect + terminal **MRI-24D4** to raspberry pi 3v3 (PIN1) and A terminal to raspi GPIO (input)pin, configure your GPIO input as pull-down .

Enjoy)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 August 2019 19:07 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/53 "2019-08-26T19:07:48Z")

</div>

@iungo - Andrey, [having read your earlier post](https://discourse.nodered.org/t/truck-weight-measurements-with-node-red/14463) and visited [www.ioton.ru](http://www.ioton.ru) I can see that you have experience in hardware development, so thanks for commenting.

I can see in your first post above that you have described a way to test the function of the **MRI-3.3D48** without attaching it to the door controller, by using the Raspberry Pi 3.3V & 5V power lines.

> [@iungo](#):
>
> You do not need 220R resistor.

Is your opinion that the **MRI-24D48** has an internal series resistor or other current limiting circuitry, so that the internal LEDs are not damaged when +24V is applied to A1?

Paul

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [26 August 2019 19:52 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/54 "2019-08-26T19:52:47Z")

</div>

As I can see on in the description on Ali for MRI-24D48:

> **[US $5.15 15% OFF|MRI 24D48 LED Photoelectrical Coupling interface DC Relay...](https://www.aliexpress.com/item/32889852245.html)**
>
> Smarter Shopping, Better Living! Aliexpress.com

Disclaimer: I didn't developed this device, therefore I can trust only datasheet on Ali, which says

Input Voltage 24VDC +/-20% (description from ali)

So, max input voltage is: 24 + 24/100_20 = 24V+4.8V = 28.8_V .

I have simple understaning how the optocouplers works, typically, optocouplers led has max current around 10-20ma, but I see only 7ma in the description.  
Input Current 7mA (description from ali)

So, I think this optocoupler it will work from 9V to 36 VDC w/o any problems.

Yes, IOTON is my project, you can also look:

> **[IOTON MICRIO](https://hackaday.io/project/166617-ioton-micrio)**
>
> In the past, I've had some experience with PLC's from different vendors (Siemens, Rockwell Automation, WAGO e.t.c.). It's respected manufacturers and they made great products. But also their products have some imperfections for me: 1. Price. It's...

  

> **[LOAD CELL to MODBUS](https://hackaday.io/project/166758-load-cell-to-modbus)**
>
> An idea of this device was born when I worked on the Automatic Weight Control system for trucks, which can weigh trucks, read license plates(CV system), save truck weight data in the database, control automatic gates, etc etc etc... This project...

  

> **[Multifunctional MODBUS controller.](https://hackaday.io/project/167043-multifunctional-modbus-controller)**
>
> This project is part of my big project IOTON MICRIO (Raspberry Pi based PLC).https://hackaday.io/project/166617-ioton-micrioIn \[https://hackaday.io/project/166617-ioton-micrioIn\] my MICRIO MPU controller, I have only 16 in/out for the external...

  

> **[World's smallest ring microscope light.](https://hackaday.io/project/166605-worlds-smallest-ring-microscope-light)**
>
> When you soldering components on PCB with hot air and microscope you have one big problem - its an angle of hot air gun. If hot air gun is not of 90 degrees angle to PCB, you will blow component, because of air pressure is on an angle to it. All...

It's all mine)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 August 2019 20:53 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/55 "2019-08-26T20:53:13Z")

</div>

Evening Andrei (@iungo),  
Really appreciate you spending time on my little project ...

> [@iungo](#):
>
> Measure voltage between (PIN6 raspberry) and terminal

About these 6 steps to test the MRI-3.3D48. Is it just to test whether the optocoupler is working correctly, or can I deduce extra information from this test?

> [@iungo](#):
>
> I think you DON'T need the pulldown resistor

So do I understand correctly that both drawings from Paul shoud be correct, without need for extra components?

> [@iungo](#):
>
> because don't have any user manual for it

That is so true ...  
On page 15 of the [manual](https://www.faacwebshop.eu/opmaak/manuals/h_FAAC_550_EN.pdf) there is some description of the 10-pins connector. Not sure if that gives you extra information ...

> [@iungo](#):
>
> It's all mine)

I'm impressed!

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 August 2019 22:48 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/56 "2019-08-26T22:48:31Z")

</div>

Now you've posted the schematic for the door controller, the ground for the door status indicator should be PIN2 and not PIN1.

I wish you had posted this earlier, because I'm now wondering if the electrical path through the opto-isolator will replace the FCA/FCC microswitches and give a false indication if the door is open or closed. This will need to be tested.

![pin2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f1e942ed0561bc8a50fcff71d92a1fbadde98991.png)

![scheme](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/273ef95268d28ecb69d83ff39a730e12d0723b94.jpeg)

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [27 August 2019 04:26 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/57 "2019-08-27T04:26:03Z")

</div>

---About these 6 steps to test the MRI-3.3D48. Is it just to test whether the optocoupler is working correctly, or can I deduce extra information from this test?---

I advised those steps because before connecting any device to the system it will be good to test it separately. I always did it for any new device, not because I'm dumb(I think), but because of my experience).

--So do I understand correctly that both drawings from Paul shoud be correct, without need for extra components?--

For MRI-24D48 it's not correct schematic.  
For open signalization you need to connect A1 to PIN3(+24V), A2 to pin FCA(PIN5).  
For close signalization you need to connect A1 to PIN3(+24V), A2 to pin FCC(PIN6).

For MRI-3.3D48:  
I don't understand how your door work now. Please, explain what you are doing to open and close it. What buttons you are pressing for door opening and for closing and in which sequence.

Also, as I see in the manual by your link, the OPEN button grounding PIN10 of your door controller, but MRI-3.3D48 is a positive voltage interrupter. I think you will need an additional relay for your system.

---

<div class="post-metadata">

**Author:** ![markost](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@markost](https://discourse.nodered.org/u/markost)\
**Post date:** [27 August 2019 06:57 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/58 "2019-08-27T06:57:45Z")

</div>

Hi Bart,  
glad to hear the parts have arrived. 👍

What I understand from the schematic is that pin5 and pin 6 (J2 terminal) are used as opening/closing limit-switch contact,  
depends of cams on the motor/gearbox shaft (Fig.11,part "D").

This doesnt mean that they cannot be used to detect the position of the door, according to the diagram from post # 9.

Qquestions:

- are security devices connected (pin7/8)?
- are pin5/6 connected to pin2 (jumper)?

For protection, I can see that there is an accessory fuse (500mA for max.load 300mA) so no additional fuse is needed.

Attach a series resistor to protect the Raspberry/Garage electronic.

For a GPIO on a Raspberry 390ohm (8,5mA @ 3.3V) or more, I really don't know what mean 7mA on the opto element (min, max, recommended, ...).

On the garage side, again,from the "datasheet" (opto element input working voltage = 19-28V), so if put 470ohm / 510ohm,  
the opto element should have enough current / voltage, while in the case of a breakdown (short circuit) the current would be limited to some 50mA .

---

<div class="post-metadata">

**Author:** ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)\
**Post date:** [27 August 2019 07:23 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/59 "2019-08-27T07:23:12Z")

</div>

> [@markost](#):
>
> For a GPIO on a Raspberry 390ohm (8,5mA @ 3.3V) or more, I really don't know what mean 7mA on the opto element (min, max, recommended, ...).

It's the current on nominal input voltage, (3.3v) I think.

> [@markost](#):
>
> On the garage side, again,from the "datasheet" (opto element input working voltage = 19-28V), so if put 470ohm / 510ohm,  
> the opto element should have enough current / voltage, while in the case of a breakdown (short circuit) the current would be limited to some 50mA .

It's not necessary, but not a bad idea. Yes, it will work with 470ohm resistor. The voltage on the input will be 21.1v and consumed current 6.15ma. I think it will work stable.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [27 August 2019 20:21 UTC](https://discourse.nodered.org/t/relays-for-dummies/13714/60 "2019-08-27T20:21:50Z")

</div>

> [@Paul-Reed](#):
>
> I wish you had posted this earlier,

@Paul-Reed: Sorry for that! Wasn't aware that it was so important ...

> [@Paul-Reed](#):
>
> the ground for the door status indicator should be PIN2 and not PIN1.

This is not good for my self esteem 😉  
Ok, I have reopened the case and this is how the electrician has wired it:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9067cd2ae87ec5f248cc3ce31049a6c0bcd5fe41.png)

On the top left you see a grey cable with a blue and brown wire, which go to the manual switch that I use currently to open/close the garage door manually. The blue wire is connected to pin 1 and the brown wire to pin 2. Don't know where the other (thinner) cables are used for: I was only interested in the manual switch, since I wanted to have a relay switch in parallel with it ...

> [@iungo](#):
>
> not because I'm dumb(I think), but because of my experience).

😂 Your devices prove that you are not dumb, so I will surely run your tests !!!

> [@iungo](#):
>
> What buttons you are pressing for door opening and for closing and in which sequence.

@iungo: I have only **one push button** for each garage door: the button returns to its default position immediately when I release it, so it generates a pulse. I press it once to open the door. Some time afterwards I press it once again to close the door. So 1 pulse to open the door and another pulse to close the door (like in the above diagrams).

> [@markost](#):
>
> glad to hear the parts have arrived

@markost: Ali still doesn't deliver the next day 😉

> [@markost](#):
>
> are security devices connected (pin7/8)?

There is only the garage door opener, that is located in the middle of the door. But there are **no** external sensors. It is just the opener. But it detects somehow (internal sensors?) that the door is entirely open/closed or when an object is blocking the movement (for safety).

> [@markost](#):
>
> are pin5/6 connected to pin2 (jumper)?

Will need to check that tommorrow ...

> [@markost](#):
>
> so no additional fuse is needed.

Ok good to know !

Can I conclude that opening/closing of the door could be **measured** like this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f0a2f342e91f510ad015c9165466309c7a74e1f4.jpeg)

Have told my wife that I have mobilized half of the planet for my garage project 🙄

[Previous page](https://discourse.nodered.org/t/relays-for-dummies/13714.md?page=2)

[Next page](https://discourse.nodered.org/t/relays-for-dummies/13714.md?page=4)
