12v Car Relay engaged by Relay Module

I am wiring up a light show for my pickup truck.

I have installed various high power spotlights and light bars into a dedicated relay/fuse box in the engine bay. These relays are wired into a switch panel in the dashboard and work beautifully using the manual switches.

I have subsequently set up an Arduino Uno R3 to control an 8 bank 5v relay module, each relay on the module will fire a separate light. I have set this up and programmed the Arduino to fire the relays, including strobe, which was working great on the LED's I attached while testing.

However, when I wire them up to bridge the switches on the dashboard (in turn firing the relays in the engine bay), the Arduino restarts after a couple of flashes. I realise this is the back EMF from the relay coils in the engine bay striking the relay module causing it to reset and I need a snubber.

I think the best answer is to install a flyback diode across the coil on the relay in the engine bay, but have been trying to figure out how I can wire these up within the blue box, without dismantling the relays installed in the engine bay. I thought maybe I could connect general ground to the manual switch (long route of achieving the same circuit), which helped but after a few more flashes the Arduino resets again. I also have some RC Snubber circuits from Amazon which I was going to try, maybe across the Module Relay contacts.

This is a circuit for one of the eight lights.

Please advice how I can reduce this interference using snubbers or some other modification, ideally within the blue box.

UPDATE: I also have a 4 button RF Remote Control, the receiver is in the blue box, one of the buttons fires another relay that has an interrupt input into the Arduino, and does an _Init() to reset. Seems this input (not the RF relay) is being fired when "relay for light 1" is disengaged.

Hi @mdtsuk
Usually these arduino resets are caused by spikes generated when relays turn inductive loads on and off.
In the car there are many inductive loads being switched on and off.
The correct thing would be to use snubber in all relays that connect inductive loads, but I think that in your case this will be very difficult.
Suggestions that can solve the problem:

  1. Place the arduino inside a metal box connected to the vehicle frame;
  2. Use shielded cables in all connections that come out of the arduino;
  3. Connect 0.01 uF capacitors to all arduino voltage inputs;
  4. Set as OUTPUT all pins (including analog ones) that will not be used in the project.

RV mineirin

1 Like

Thanks, I'll give that a go.

Full disclosure, I also have an RF Remote Control, the Receiver is in the blue box too. that has 4 relays that drive 4 inputs to the Arduino. One of which is on an interrupt that issues a reset/init command. I guess that connection might be affected by the back EMF and triggering the reset. I'll give it a go without the reset interrupt enabled.

Looks like that was the issue, when I remove the interrupt it works. I have updated my question and image. I guess your same advice stands.

If you find actual interference from relays anywhere in the future opto-isolators can help eliminate that.

I have a solution, adding the flyback diode, removing the resistor on the input, and relying on the INPUT_PULLUP resistor, so just to ground. Updated diagram, changes in red.