Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Asked — Edited

Using Opto- Couple Relays With An Ezb

There has been much confusion on how to add a relay to an Ezb. There are three style relays, relay only, relay with a built in transistor circuit, and a relay with an opto-couple circuit. I have the relay with an opto-couple circuit. (817C) ?

This relay requires a 10 K resistor placed in series with the digital output. It is programmed by using a digital output, and "Set Digital". The issue is when the signal sent is "On" the relay is turned off. When the signal is sent "Off" the relay turns on.

This operation needs to be accounted for in your design so relay do not come on during a start up.

User-inserted image


Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
Hi Jeremie,

I have gotten the relay working as discussed. I have an issue where the indicator on the relay board stays on. It is bright when the relay is energized and dim when the relay is de-energized. I checked the voltages on the relay board side of the resistor. When Set Digital is Off, the voltage is 3.3 volts (relay on). When Set Digital is On, the voltage is 4.66 (relay off). The relay does operate correctly. If I add a diode will that fix my problem? I ask first because I do not want any "magic smoke.
Have you used this style relay? How did you wire it ?

I hope Jeremie can respond when he finishes with @Tech.

you wrote:


I next inserted a 10k resistor in series with D0 to the In1 on the relay, and Off signal turned on the relay, On signal turned off the relay.

this means the relay works with a 10K resistor between EZB pin and IN1 ?

when you tried without the resistor did you connected both IN1 to D0 and IN2 to D1 ?

if not please connect both.
Good Morning,

I took the values off the boards (the 2 relay board and the 8 relay board are the same.) They are: r1=102 r2=115, r3-115 r4=102. The 8 relay board continue with the same values. The transistors looks like J3Y. The opto-coupling is a 817c B1419 on the 2 relay board and AFETEL 817C U448 on the 8 relay board.

I am currently running these boards using a tip 120 circuit, and they works fine. I prefer to eliminate the slave board and run direct. Even though it is inverse logic, I can rewire and reprogram them to work correctly. I will continue my test later this morning.
Do you mind posting a schematic /photo of how you wired the relays in conjunction with the tip120 circuit? How are you powering the relays?

I'd also like to know why you need the relays at all, if you have a tip120...just picking your reasoning:)
Hi Doom,
The TIP circuit works fine, and operates the relays correctly. I built a circuit based on a thread from Rich. I use the contacts on the relays to operate in place of a pushbutton on a wireless remote. This wireless remote operates 110 vac remote outlets to turn on lights and a coffee pot. I do not have enough electronic knowledge to wire the TIP circuit directly into the remote, thus eliminate the relay. I don't want to destroy the remote control if I connect something wrong. I will check my papers and post a diagram of the TIP circuit for you.

I use the relays due to frustration ! LOL I was never able to get any of my relays ( I have three different styles and types ) to work. I was running out of time, so I just built the TIP circuit and used that.

Due to the latest threads posted, I pulled everything apart to try to get the relays to work directly with the ezb, again. A resistor in series between the ezb port and the relay lets it work in the inverse. This means I need to do some rewiring, add a master relay, and reprogram which is ok. This way I can eliminate the TIP controls.
The other relays still won't work, but I will mess with them more later. Jeremie continues to post information. so I will continue to try things.

Did you tried connecting both D0 D1 to In1, In2 without resistors ?
Yes and no good. I found a second one and tried it with the same results. When I use the resistor, the leds don't work correctly, but the relay does. Maybe I will paint the leds black and forget about them.... LOL

I just finished drawing a schematic for the transistor style relay and posted it on the other thread, I will try to do the same here. At least with a drawing we may see how these things work and what is needed to operate them.

I will try to make the drawing now.
yes a schematic would help,

it's strange it's a very simple circuit.

Q1) regarding the resistors r2 & r3 you wrote 115 are you sure ?

Q2) can you confirm if the led is red ?

Q3) can you confirm the power supply VCC is 5v ?

this is what we have so far:

vcc=power supply 5v
gnd = ezb gnd + power gnd (common ground )
in1 = EZB D0,
in2 = EZB D1.

1) above setup
the relay switches on with EZB pin LOW,
the relay does not switch off with EZB pin HIGH.

2) you add 10K resistor between EZB Dx and Inx

the relay switches on & off, but the led does not switch off (dimmed)

Sorry to repeat, but this is a KISS device .... so double checking
For r2 and r3 which may be 511 instead of 115 ( hard to see )

It is a flat led which is a red / orange ?

Power supply is 5 volts. ( it is able to power an 8 relay board and 8 TIP 120s)

Operation is as you described.

Here is the sketch for one circuit. I think it is right except for maybe the diode polarity.

The jumper is on vcc to vcc. gnd is open. (vcc's needs to be jumped)

User-inserted image
I believe the connection between the coil, flyback diode, and 817C goes to VCC as well, correct? With the jumper on, of course.

*edit: Whoops this post was meant for @Andy's diagram
Thanks @rgordon that's a very classy diagram!
I Thank everyone....

At last I may get this board working right.
I am just curious..? If I bypassed the opto- coupler and put the signal direct to R2 would it work? If it did work, would it work inverse or not?

my setup, Jeremie's video and Gordon diagram all of them are pointing to the same setup (no resistors add-ons)

if you can't put it to work, something is broken: the wiring, the power supply, the pcb, or EZB pin;)
1) if you disconnect/brake the optocoupler pin from the VCC

2) if you connect the EZB pin before the R2

3) VCC=5V

4) Common Ground

you have a NPN transistor circuit relay without a optocoupler.

High = On
Low = Off
Thanks for the answer. LOL . This is what I wanted the whole time. I will give it a try next week.

Sorry i did not understood you wanted to "change" the behavior, like i said in another thread i avoid hacking circuits.

I can't rationalize why your pcb relay does not work as expected. Gordon's diagram is very clear. It's a mystery:) better call Fox Mulder.
No LOL .....It is a learning question. I was curious about the circuit. I now know what a NPN transistor circuit (also a PNP circuit) is and how to use it. Also how the optical isolator works.
Next time I order relays I will know what I need and what to look for, "not just a relay on a board".
I ordered a converter like you mentioned and will experiment with that. (Was cheap).
Thanks to all that helped with this and @MazeHorizonTech 's thread on relays also.
I think it is a lot clearer now on what relay boards to buy and how to make them work.