Have an Arduino UNO & relay board controlling A/C loads which occasionally locks up the USB Serial Port when switching things off / de-energizing the relays.
The relay board is isolated through optocouplers along with separate 5V power for the triggering circuit & relay coils. The triggering circuits, optocouplers, are powered through the Arduino and the relay coils from a separate 5V A/C power adapter (wall wart).
The Arduino continues to run when things freeze but the PC can no longer communicate with it over the USB connection. I’ve tried pressing the reset button on the Arduino, which restarts the program / sketch but still unable to communicate. The only solution is to unplug and reconnect the USB cable, then everything comes back to life.
While I can see snubber diodes on the relay board, it’s still ‘electrically‘ noisy as I can hear static coming across the PC speakers every time the relay’s open / de-energize. This static varies from rather subtle & almost undetectable to others that are quite loud. I’ve tracked the USB connection locking up to when the static coming from the speakers is the loudest.
I don’t understand how noise from the relays is making its way back to the PC through the USB connection, or why it’s causing things to lock up. I’ve been thinking about swapping out the mechanical relay board for a solid state version but not sure if that would solve the problem or not.
Any suggestion or help would be appreciated – thanks.
Most likely, electrical noise in the power supply is affecting the Arduino, and/or you have a ground loop problem between AC ground on the PC and AC ground on the controlled circuits.
Please post a complete wiring diagram. A photo of a hand drawn diagram, with pins and connections clearly labeled is fine. A photo of the setup would be useful, too.
it’s still ‘electrically‘ noisy as I can hear static coming across the PC speakers every time the relay’s open / de-energize.
Sounds like the relay board needs to be in a grounded metal box.
Here is a circuit diagram, pretty simple, not a lot going on here. Using only 3 out of the 4 relays, and I did pull the jumper off JD-VCC to power the relay coils with the wall adapter so as to isolate it from the Arduino.
Oh and the 5 Volt A/C Adapter specs - 5 Volt DC output, 1.5 amps
Sill looking to solve the problem with the USB connection locking up but plan on replacing the existing relay board. Most boards supporting separate power for control & relays all have low-lever triggers which isn’t ideal from a fail-safe & power cycling standpoint.
Found another board with a bunch of settings including high-level triggering & VCC power jumpers. The power jumpers are a bit confusing but think they should allow for the complete isolation of the Arduino from the relays.
david_2018: Kind of understand how removing the ground wire from the Ardunio while using the low-level relay board would work but wonder if the same would hold true when using the newer board with high-level triggers.