I have read most of the posts here on this topic and have a good understanding of opto-issolation and how it works with this relay module. (For more information on this click here)
Parts:
-
Arduino Mega (12v UB1250 plugged into Mega DC Jack)
-
8 Relay Module SRD-05VDC-SL-C (Load ran off Marine Deep Cycle 12v Battery)
-
2 actuators and 1 valve are running off the relays using 6 relays (2 per actuator & 2 for the valve)
-
I have 2 available power sources which can be configured differently depending on what works.
-
Only one relay is on for the actuators, Two (2) relays are on for the valve. Mainly only one relay is on at a time unless the valve is on then 2 relays are on at the same time.
Problem:
#1: 2 seperate battery's
The current battery configuration consists of the Mega being powered by the 1250 battery. The Mega 5v is connected to the Relay Vcc, Mega GND is connected to the Relay GND, then the Relay 1-6IN are connected to Mega digital pins D32-D37. The JD-Vcc and Vcc are shorted on the Relay module.
The load on the Relays are connected to the 12v Marine Deep Cycle battery which powers the actuators and valve.
When the load battery is connected (Marine Deep Cycle or actuators & valve are disconnected) and is not connect I get unpredictable resets. The actuators may move for 5 seconds, 30 seconds or not at all before a restart happens.
I have connected a 200uF Electrolytic Cap between Vcc & GND on the relay and this did not fix the problem (I am currently trying other values).
#2: Only deep cycle marine battery powering mega, relays, and load of actuators.
Everything is the same as above but the marine deep cycle battery is powering everything. The JD-Vcc and Vcc are still shorted on the relay.
When the actuators & valve are not connected I get an immediate reset everytime a relay turns on. When the actuators & valve are connected I get a reset after the actuators stop moving and the relays are still on.
Any advice is greatly appreciated.
Please let me know if any more information is need.
UPDATE
Using the setup from Problem #1 (Problem #2 setup as well) I was able to fix the problem by using a 1000uF electrolytic capacitor between the relay Vcc and relay GND which are connected to the Mega 5v & Mega GND.
Using a 100uF did not work but using a 1000uF did.
I am assuming the signal was pretty noisy and just needed some decoupling.
I am hoping this post will help others.