Display Goes Crazy at Motor Run and Stop

Hi all,

I have been trying to solve this problem for some days but unfortunately I couldn't and I'm running out of options and ideas. So, I need your help.

I have a system with 2x LJ12A3-4-Z/BY inductive sensors, 1 BJ1M-DDT photoelectric sensor, 2 infrared no-touch buttons, 1 SGR 56391 wiper motor, 2 switches to determine some states.

It goes like this:
12V battery that can supply maximum of 7A goes to a step-down regulator module that can supply max 10A current and supplies the Arduino Mega, inductive sensors and the photoelectric sensor with 10V.
The battery also goes to another step-down voltage regulator module(3A max supply) with a fixed voltage of 5V and the regulator supplies only the motor.
Using a 12V 4-channel Arduino compatible relay module, I bring the output voltages of the inductive sensor and photoelectric sensor down to 5V so Arduino can read.
Using a 5V 4-channel Arduino compatible relay module, I control the motor in both direction like H-bridge connection.
I also have 6x 38mm 7-Segment displays (each segment has 2 LEDs except DP which I'm not using) controlled with MAX7219 chip with 0.1uF 63V and 10uF 50V capacitors in parallel on supply pins of the chip and 27k ohm resistor between ISET and VCC pins of the chip. I supply this IC on Arduino's 5V and GND pins.

To test the system, I wrote a test program and I'm able to read the inputs from the sensors and no-touch buttons, no problem there. I also wrote a for loop inside setup function that shows numbers starting from 0 to 9 on the display with 1 second delay which works fine, no problem there too.

BUT! When the simple code in the loop function which runs the motor forward for 200 milliseconds, delay for 1 sec, run backwards for 200 milliseconds, delay for 1 sec and repeat, display goes crazy. To be precise, when the motor STARTS running or STOPS, display becomes 888888 (sometimes random LEDs and sometimes all segments off) with full brightness and I can't change the display from that moment(and sometimes I can change if it's random LEDs lit). I'm not sure if the rest of the circuit is also affected or not, I haven't tested it yet but I'm suspecting it may be.

I also tried connecting a much smaller DC motor to observe behavior, I saw no problems at all, display works fine.

I have measured the voltage between supply pins of MAX7219, and it's 5V. No problem there.

Prior to this happening every time, the system was working fine for a few motor runs and stops, but eventually the display at some random point when the motor runs or stops, becomes 888888 again.

I tried to explain the system and the problem as detailed as I can. I can provide any further details if I'm asked to. Thanks for the help.

Wiper motor stall currents are up in to 10 to 30A range, beyond a 3A regulator even allowing for
the lower voltage, so it will be crowbarring the whole supply setup I suspect - you typically need
a 'scope to see such spikes and dips in supply, multimeters average readings out over a second or two.

You may also be experiencing noise pick up from the high current wiring - its prudent to keep everything
low power well away from the high current wiring, and use twisted pair for all such wiring.


A schematic would also be a useful thing for others to see any likely issues.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

I have no schematic unfortunately. My colleagues haven't given me the chance(time) to create one, they just started connecting stuff together and wanted to make it work quickly. But, I will create a schematic so you can help me better. Sorry about that.

But, I will create a schematic so you can help me better.

Pencil, paper and a camera are great for this.
in may ways superior to the common fritzing diagram.
Pics of your project help as well.