My simple circuit diagram attached. Here is the challenge—
I’ve got two power supplies a 12v and a 5v delivered via USB port. The usb drives the Arduino. I pull the Arduino 5v and gnd pins off the board to a “bus”. From that 5v bus, I hook up 5v sensors, relay boards, etc.
Any bigger stuff is run off 12v, relays turn it on.
I’m getting ready to expand from a single relay-to a 16x relay board. I’m wondering if I’ll be over driving the 5v on the Arduino by driving that many relays.
I could use a third, higher amp 5v power supply- just not sure if I should tie the grounds on the two 5v supplies?
"I'm wondering if I'll be over driving the 5v on the Arduino by driving that many relays. "
Depends on how many relays you turn on at one time.
Go with the seperate 5V supply. Connect all the Gnds.
USB power (<=500mA) can only power four relays at once (~80mA per active relay).
Some 16-channel boards can be powered from 12volt, because they have an onboard 5volt buck converter that powers the coils (and the Arduino).
Note that all 16-channel relay boards have a design flaw. Optos, but no opto isolation.
That could make them more dangerous for mains power switching.
8-channel relay boards don't have that problem.
The have a JD-VCC jumper to select between opto isolation or not.
Leo..
I have seen this opto isolation mentioned here before, but to be honest, I don't have any idea what you mean with it. I have a 16 channel relay board here, with opto couplers, I don't have a use for it yet, but I would like to understand what you mean. Could you please explain it to me? I would greatly appreciate it.
Opto isolation physically separates the logic circuits from the power circuits. With the JDD/VCC jumper, it allows one to either pull the power from the same source (arduino), in which they share a common ground, or be isolated from each other in which the two circuits do not share power or ground.
Isolation can be used to separate mains voltages from the possibility of crossing over into the rest of the circuitry should a component fail, which is used as a safety, or isolates noise from the logic side.
Relay coil and the relay contacts isolate mains power from your low voltage Arduino circuit.
But many relay boards are not made safe enough. Not enough creepage distance between low voltage relay pins and mains voltage relay contacts.
Opto couplers is an extra/second isolation layer between the Arduino and mains power.
You need a seperate relay supply for that, and you must switch the relay board to opto isolation by removing the JD-VCC jumper. Then connect relay power to JD-VCC/ground, and the Arduino to VCC and relay inputs. And NOT share ground between relay board and Arduino (that would defeat opto isolation).
16-channel relay boards do have optos fitted, but some design noob did not include that JD-VCC jumper.
So a 16-channel relay board with optos can't be switched to opto isolation without serious hacking.
Leo..
I actually own both a 8x and 16x board and see exactly what you mean. The 8x has the jumper for jd-vcc the 16x does not.
I also see on the 16x— the inputs have 5v vcc/gnd- then inputs- then next to those a larger set of screw down inputs. One say gnd, other not labeled. I’d guess those are the 12v inputs.
Spot on again wawa. LM2576. Your starting to scare me, stop hacking my webcam!
Crossroads— I think you’re being crystal clear, but I’m going to double ask. So if I have 3 separate supplies(5v,5v high amp, 12v)— I should tie all three of those grounds together??
@larryd
A 16-channel relay board has JD-VCC and VCC permanently connected.
I think the rest is the same.
A .pdf of that 16-channel board can be found on the Sainsmart website.
Leo..
So, if you cut the connection from the internal 5V and fed Arduino Vcc directly to resistor arrays, would it then be isolated?
Still, each opto needs 15 to 20 mA, how many could a UNO drive at once?
Yes, you can cut the tracks.
This is rather easy for the first eight relays.
The next eight is not so easy (several tracks and bridges).
I did a tutorial for this many moons ago on this site.
Opto LEDs for these relay boards draw 2mA per relay.
Because of a 1.2volt IR opto LED, a 1.8volt inducator LED, and a 1k resistor in series.
Leo..
"and each one needs 15-20mA drive current"
Probably written by sales dudes, confused by the total input pin sink current for an 8-relay board.
Each 5volt relay draws about 75-80mA coil current when active, and each relay input requires 2mA sink current into the Arduino pin when active.
Current path with opto isolation is:
"Arduino VCC >> 1k resistor >> opto LED >> indicator LED >> Arduino pin to Arduino ground.
The Arduino doesn't need relay ground to drive the opto LED.
The opto LED is effectively connected between Arduino 5volt and Arduino pin.
Leo..