Opto-isolated relays when using a single power supply?

Say I wanted to drive 3 x 12V (coil) relays, to turn on and off multiple 240V appliances (below 10 amps).

The power supply for my Arduino is 12V on the Vin and gnd pin. This same 12v power supply will also be powering the 3 relays.

As I see it, you could easily control the 3 relays with 3 transistors, with each transistor’s base connected to a separate GPIO pin.

However, you see lots of multi-channel relay boards with added opto-isolators online (e.g. 1 2 4 8 channel 5V relay module with optocoupler. Relay Output 1 2 4 8 way relay module In stock For ARDUINO|relay module|module relaymodule 5v - AliExpress), which would give you the option of powering the relays from an isolated power supply, but I’m unsure if there would be any further benefit beyond that?

Am I correct in that it would be completely pointless for me to use both an optocoupler and a transistor in driving the relays, given that I am using the exact same 12V power supply to power both the Arduino and the relay coils? Or is there some added benefit to using an optocoupler in my application that I’m missing?

thanks!

I have deleted your original topic

1 Like

cheers :slight_smile:

I can't see any need or advantage to using opto-isolators, from what you describe.

A slightly more sensible arrangement would have been a 5V PSU and relays with 5V coils. You would then bypass the Arduino's internal regulator, powering it through the 5V pin instead of the Vin pin or barrel socket. But if you already have the 12V relays or power supply, then go with that. Just take care not to draw much current from the 5V pin of the Arduino, the onboard regulator can easily overheat with a 12V input.

Thanks Paul. Didn't think opto's were necessary.

I actually also have some DC 5V mains rated relays handy, and you bring up an interesting point.

Can you basically attach any regulated 240V to 5V AC to DC transformer directly to the 5V+ pin and ground? e.g. a phone charger.

No need for an additional DC to DC regulator between them?

I think the only reason it could be risky is due to no reverse polarity protection, right?

thanks!

Yes, as long as your phone charger is rated for enough current. Most Arduino only use 30~50mA, but relay coils can be 100mA each (usually less).

Best to avoid reverse polarity by using a connector that can't be reversed, like usb. Barrel plugs & sockets are usually centre positive but they can be centre negative, especially if you buy one of those universal PSU with 10+ adapters for different size barrel plugs. If you rotate the adapters 180 degrees, they can be made centre negative.

1 Like

Glue! :+1:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.