I am driving six 7-segment displays with SPI using MAX7219 and ATmega128. This is for displaying various engine parameters like rpm, oil pressure etc. for large marine diesel engines (>100 kW). The system runs on 24V DC from lead acid batteries (automotive type) stepped down to 5V with the help of Mornsun DC-DC converter (URB2405 - Isolated DC-DC converter).

The system runs fine when the engine is firing smoothly (approx. >900 rpm) and was recently tested on a test bed for 2.5 hours without issues. However, the display malfunctions completely and is very unreliable when the engine is cranking.

After debugging this for many days and fixing lot of stupid mistakes (forgot to add flyback diodes for a few on-board relays :( !!) I still have very poor display reliability while cranking. When the display malfunctions, either garbage is displayed on the 7 segments, or all segments light up or it goes blank.

I have added a 1000uF/63V capacitor and a MOV before the DC-DC converter to reduce supply fluctuations while cranking. However it is still very unreliable. I feel that the controller is working ok during cranking and it is only the display which malfunctions.

I am looking for some suggestions for power supply stability during cranking or large transients. I have tested a few things and am about to test if the following improves the situation :

  1. Use shielded cables connecting the display PCB to the controller board to prevent noise corrupting SPI
  2. Isolate high current carrying cables (starter motor relay coil, stop solenoid relay coil etc.) from signal wires with shielding and route them differently inside the enclosure
  3. Add a 0.1uF (104) cap between the 2 grounds of the DC-DC converter to reduce noise on the 5V side
  4. Power the whole thing from an off the shelf automotive power supply which provides all the standard protections. Any suggestions ? (Input 24V, Output 5V, 600 mA max 3W)
  5. Reduce cable length to improve SPI reliability (Although currently the total length: track + wire is less than 1 ft so not so hopeful this would make any difference)
  6. Increase decoupling cap for each MAX7219 from 10uF to 470uF
  7. Use very large capacitor for maintaining voltage while cranking

I still feel I am missing the crucial reason why the display malfunctions. Voltage dip should not really be a problem as the DC-DC converter is rated to provide smooth 5V for a wide input range of 9-36V. Even if the battery is discharged, I doubt if the voltage will drop from 24V to less than 9V, so it is a mystery why the display goes blank or displays garbage.

  • \$\begingroup\$ Have you looked at your rails and signal lines during cranking with a scope? \$\endgroup\$ Commented Oct 31, 2015 at 17:07
  • \$\begingroup\$ If you are powering the microcontroller from the starting battery, try powering it from an independent power source instead. \$\endgroup\$ Commented Oct 31, 2015 at 17:29
  • 6
    \$\begingroup\$ Adding a big cap is a good idea, but you also need to add a diode between the power source and the cap. If you don't do this, when you crank and pull down the power, the cap will simply try to help the cranking process. Add a diode to keep it from back-discharging. \$\endgroup\$ Commented Oct 31, 2015 at 18:17
  • \$\begingroup\$ Also the 1000uF cap may not be enough depending on how bright the 7-segments are. I second the scope view on the 5V supply. That will help you isolate the problem to the power supply or not. Also how long of cables are you running SPI over? Finally you may also want a series R or L in front of your power supply and MOV, that way when the MOV kicks in, your not trying to pull the voltage down on the entire battery system / starter. \$\endgroup\$
    – MadHatter
    Commented Oct 31, 2015 at 19:07
  • \$\begingroup\$ It's crazily misplaced effort to be adding most of this stuff without actually putting a scope on the 24V rail and cranking the engine. There's no point fretting about screened cables, etc, if the supply's dropping to 8V while you're cranking. Someone else has already pointed out why the 1000uF cap was doomed to failure. \$\endgroup\$
    – user1844
    Commented Oct 31, 2015 at 21:29

2 Answers 2

  • Put a 100ohm@100Mhz Ferrite Bead between the Power Supply output and the input of the voltage for the digital circuit.

  • In the SPI line, put a 100ohm@100Mhz Ferrite Bead between the Atmega and the MAX, it can help with some noise getting coupled on your PCB.

  • 100nF (X5R or X7R) capacitors everywhere on your PCB, for a project like this you can't go without them or your circuit can act "strange".

Is this possible to you post a print of your PCB? Maybe it needs some tweaking, it can be coupling the noise into it.

Every single electronics made for a car or everything that have a lot of noise involved needs beads and good noise protection, just an isolated power supply isn't going to work.

How to see the noise? Simple. Get a #18 copper wire, around a soda can make a loop with 3~4 turns, get it into the oscilloscope, if you moves it around the motor of the car with care you can see how much EMI it makes.


A single MOV and one 1000uF cap is not much protection from RF noise emitted during ignition. For a start I would add a B32529C104K189 in parallel with the MOV. Also make sure to separate your RF and digital grounds, so that they each have different paths back to the 1000uF cap.

Also you said you might increase decoupling cap MAX7219 from 10uF to 470uF. I would recommend not increasing the one decoupling cap but adding a second and a third decoupling cap. Leave the 10uF and add a 470uF as well as add a 0.1uF low esr ceramic.

This should also be done on the ATmega128 if you have not already. Each Vcc pin on the ATmega128 needs a decoupling cap of 0.1uF should be used and a second cap of 0.01 placed near by.

Here is a PDF the recommends a 50ns RC filter right in line with the SPI to try and mitigate RF interference, as well as using a ferrite bead to isolate further the individual MAX7219's power :


  • \$\begingroup\$ Thanks for the suggestions. I have implemented most of them already. Not sure if I can answer my own question, but the issue has been solved. I tested several things today and found that the noise from the large current carrying wires ( starter motor relay, stop relay) was corrupting SPI. After implementing the first 2 points I wrote in my original post, the problem disappeared completely. \$\endgroup\$
    – beta_male
    Commented Nov 4, 2015 at 14:36
  • \$\begingroup\$ Awesome! Noise is a difficult thing to manage, I'm glad it worked out for you, \$\endgroup\$ Commented Nov 4, 2015 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.