Software developer here, but an electronics noob...
I'm driving a set of Optocoupled relays using an Arduino Uno. While I have everything working as intended, I'm getting some random resets of the Arduino when the relays are switched. I am currently NOT using the optocouplers on the relays, but would like to hook up a 2nd power supply to do so. The high-voltage side of the relays is 12v in this case...
I have a project box with a 12v rail in it. From that rail, I'm powering this 5v step-down converter:
... which in turn is powering both the Arduino and this 8-channel relay board:
Some research indicates that adding a second power supply and correctly using the optocouplers on the relays might help to mitigate the relay-induced spikes that are (likely?) causing my random resets.
Does that sound like a reasonable thing to try for this issue?
Assuming yes, I'm wondering if I can simply get a 2nd 5v converter (same as above) and drive it from the same 12v rail in my project box? That is, does driving two separate 5v power supplies from the same 12v source satisfy the "isolated" nature of the power supplies or does the common 12v rail defeat the purpose?
I'm happy to provide additional details if/as necessary, but I don't want to be too long winded to start with.
More than likely, adding a second 12-24 to 5v converter ‘will not’ be what’s needed as there is probably a connection from GND (12-24) directly to the 5v (Arduino) GND.
Suggest you try to get away with using the contact physical isolation and use one power supply for both the Arduino and the relay board.
If find you do need the opto isolator for its desired characteristic, you will then need to follow the above schematic and use a completely separate 5v power supply for the Arduino.
The project involves automating a piece of farm (hay) equipment. The initial 12v power is coming from a tractor's electrical system.
I'm using 6 of the relays (2 are not used) on the linked 8-channel board to drive the following devices:
5 - 12v hydraulic solenoid valves (to drive various hydraulic functions on the equipment)
1 - 12v electric clutch (similar to that used to turn on/off the deck of a riding lawn mower)
Only 1 relay at a time is being powered. Unfortunately, I don't have access to any of the driven devices ATM to provide any more details there. I can get additional info if it's necessary.
JCA34F:
How are you NOT using the optos?
I guess I may have misspoke here. What I meant to say is that I have NOT removed the Vcc/JDVcc jumper on the relay board and have NOT powered the low voltage and high voltage sides of the board independently (as described here: https://youtu.be/LLFQ8sBWc80?t=80)
JCA34F:
Post a wiring diagram.
Hopefully this doesn't get me laughed out of here... As I said, I'm an electronics noob... Anyway, the attached is what I worked up for my own documentation. I think it should be accurate for how I built the box. While it shows the 12v wires going to the relays, it doesn't show the wires coming from there to drive the 12v devices - I assume that doesn't matter for this discussion.
Also, all 12v devices are hooked to the same ground as the electronics and are powered by the same 12v source (both being the tractor's electrical system).
larryd:
Suggest you try to get away with using the contact physical isolation and use one power supply for both the Arduino and the relay board.
Hmmm... I know this is likely helpful, but I'm not sure what you mean by "using the contact physical isolation". If you could provide a little more detail, that'd be great.
larryd:
If find you do need the opto isolator for its desired characteristic, you will then need to follow the above schematic and use a completely separate 5v power supply for the Arduino.
That's exactly what I was eluding to wanting to do in the OP. However, I'm not sure if running 2 5v power supplies off of the same 12v rail satisfies the "completely separate" part of your statement. And, I realize I'll have to remove a jumper on the relay board and do some minor wire reconfiguration for that.
Also, I've provided a schematic (such as it is) above in case it's helpful.
“ Hmmm... I know this is likely helpful, but I'm not sure what you mean by "using the contact physical isolation". If you could provide a little more detail, that'd be great.”
The point of the opto isolator on the relay board is there to physically separate the Arduino from the load.
The relay contacts “also” separates the Arduino from the load.
Therefore if the opto isolator is properly wired in, your Arduino will be separated “twice” from the load.
It might be sufficient for your application to “not” wire the opto isolators as recommended and shown in post #1.
Measure the resistance from, GND terminal the 12-24 side of supply to the GND terminal 5v side.
If there is continuity, then using two supplies “is not” the same as two fully isolated supplies !
If you have “no” continuity, using two of these power supplies will allow you to wire the relay card as seen in post#1.
I moved your 12V supply to the COM terminal, then I found some extra diodes and installed them on the NO terminal to 12V as shown. (hope you don't mind)
dlloyd:
I moved your 12V supply to the COM terminal, then I found some extra diodes and installed them on the NO terminal to 12V as shown. (hope you don't mind)
I certainly don't mind that you've "corrected" my schematic. Looking at the project itself, it's wired exactly like your modification (though, without the diodes) - so my schematic is incorrect in that regard. I've updated it locally and will update the attached copy soon.
I think the board already has an in-built diode for each relay for fly-back/EMF purposes. If anyone can tell for sure from the provided links, I'd like to know.
Other research also indicates that my 5v power could be getting pulled too low to reliably drive the electronics when the ultimate devices are powered up by the relays. I haven't tried to verify that yet, but it's something I'll look into as well.
larryd:
The reddish glass diodes on the relay card are across the relay coils.
Those are the components I was referring to. So, are you saying those are not for flyback/EMF (and that I should add some) or are you suggesting that I add additional diodes for that purpose at the load point? Just trying to understand if those components are for that purpose (but maybe not adequate?) or if they're for something else entirely...
larryd:
The reddish glass diodes on the relay card are across the relay coils.
Suggest the kick-back load diodes be added across inductive loads, right at the load location.
i.e. “at” the hydraulic solenoid valve and clutch locations.
So, that'd basically look like the modified schematic provided by dlloyd above?
The reddish glass diodes ‘are’ kick-back diodes for the on-board relays.
If the clutch is located 4 feet from the relay board, its kick-back diode should be located at the clutch (4 feet from the relay card). You can solder wires to the diode leads and then add clear heatshrink tubing; this makes it more convenient to attach to load terminals/wires. The clear heatshrink lets you see the cathode marking.
I have experienced many times where placing the kick-back diode at the control relay (for convenience) still can cause problems in circuitry. These problems disappear when the diode is moved to the remote/load location.
But it’s up to you, just remember, if you experience random/intermittent problems, move the kick-back diode to the load !
I certainly don't mind that you've "corrected" my schematic. Looking at the project itself, it's wired exactly like your modification (though, without the diodes)...
Oh, I was hoping you'd add the diodes to the circuit (as per larryd's suggestion), as this would more than likely resolve the reset issue.
The diodes will:
clamp inductive spikes from the load
reduce EMI/RFI and arcing during switching and contact bounce
reduce the chance of "arc-welded" contacts, pitting, etc
prolong the life of the relays
reduce the chance of MCU lockup, reset, etc by reducing electromagnetic radiationCould still have some common mode interference from the relay coil, but this could be resolved by using a separate supply for the relay board and isolating the grounds (opto-isolation).