I have 4 12V(1A) solenoids running on a 12V(4.16A) power supply. Each solenoid circuit is controlled by a 5V relay module connected to the Arduino Uno (powered by USB).

The solenoids actuate properly but eventually the Arduino resets, typically when multiple solenoids are turned on/off in fast succession. This is accompanied by random character artifacts on the LCD display (connected to the Uno) during operation but before the reset.

From what I've gathered there are back EMF surges occurring when the solenoids lose their charge. Here are some possible remedies I've found:

  1. Add a flyback diode (IN4004) to each solenoid circuit. (Redirect the surge)
  2. Add a capacitor (4700 - 10,000 uF) to the 5v supply (from the Uno) for the relays. (Filter the surge)
  3. Provide a separate 5v power source to the relay modules instead of using power from the Uno. (Isolate the surge)

Any input on which solution(s) should be applied or other possible causes for the Uno reset and LCD distortion is appreciated.

  • Those 5V relay modules already have flyback diodes, so I don't see how providing a separate 5V source for these modules will help. A schematic would certainly help here. Jun 12, 2019 at 14:01

2 Answers 2


Some of those 5V "digital" relays can be wired using a separate power supply for the relays and the Arudino. You have to move a jumper to use separate power supplies.

My guess is that you're powering both your Arudino and your relay coils from the same 5V supply, and when you energize all 4 relays at the same time you draw too much current and the Arduino doesn't get enough voltage and resets.

Read up on your relay modules, and either re-wire them using 2 different 5V supplies, or switch your 5V supply to a higher current supply. (and possibly adding a filtering capacitor to the Arduino to smooth out the power fluctuations as the relays energize and de-engergize)

I used a 4-channel relay unit in a project of mine that has optical isolation of the relay control lines, and can be wired to use separate power supplies for the Arudino and the relay power. When wired with separate power supplies, the relay's control lines just draw CMOS logic levels to control the different relay channels, and get the power for the coils independently from the microcontroller's power.


Here is another path to explore :

  • Try to use separate rail for the 5v relays
  • Use a transistor or darligton array (such as ULN2003) for controling your 5v relay.
  • ALWAYS put a feedback diode when you use an inductive load it can break your Arduino !!

My analyse :

  • Arduino and many other µc have limited output current on IO, be sure to not overload these value by using transistor or darligton array.
  • The voltage regulator on the Arduino can provide around 200 mA of power. I you are overloading the value use an external power supply for your circuit.
  • The solenoid can draw lot of current of the power supply, try to measure if a voltage drop occur on loads. It can cause the arduino to reset due to low voltage.
  • The relay modules seem to already have to needed circuitry (transistor and flyback diode). What do you think? You are right, that the symptoms suggest a voltage drop. I think that is the way to investigate further.
    – chrisl
    May 22, 2019 at 9:29
  • If you have already put the required circuitry for driving properly each relay. I think you can investigate for voltage drop.
    – P0pR0cK5
    May 22, 2019 at 9:34
  • Would adding an additional flyback diode (assuming the relay module already has one) to the circuit cause problems? I'll find a suitable 5v rail for the relays, this seems like the culprit. 4 relays, LCD screen, MIDI In/out, and an IR receiver are likely drawing more than the 200 mA available.
    – user56860
    May 22, 2019 at 18:11
  • I don't see how are the relays optoisolated. there is no separate VCC and ground input for the "behind the optocoupler" circuit.
    – Juraj
    May 22, 2019 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy