Electronic – Reducing ground level fluctuations when Multiplexing 7-Segment Displays

7segmentdisplaymultiplexerswitching

I am using a microcontroller to multiplex 6x 7-segment displays. Segments are driven by 2N3906’s and displays by a ULN2003. Average segment current is around 9mA, so instantaneous LED current pulses are around 53mA per segment.

My code is currently setup to do the following:

1) Display n is on for 1.9ms

2) When 1.9ms has elapsed, switch off all segments

3) Reset timer

4) Select Display n+1

5) Turn On correct segments for Display n+1

The delay between switching on and off (step 2 & 5) is around 150usec. The code works perfectly fine, but my issue is noise. I’m using an ADC to measure an input voltage and the reference isn’t even close to stable despite filtering and separate grounds due to the massive switching currents. This is compounded by the fact that I am switching the segments completely off, then completely on when switching displays, but this is the only way I have found to prevent bleedover between displays (similarly described in this post: Multiplexing two 7-Segment displays (Ghosting issues)) … if I keep the segments on, then switch displays, there is a bleedover of the previous digit into the next digit. The reverse is true if I switch displays first. The scope traces look somewhat better (significantly fewer spikes) if I don’t switch segments completely off first.

Does anyone have any suggestions on how I might reduce this bleedover in the code without having to completely turn segments on/off?

With regard to the noise, this is currently being done on a breadboard so ground separation isn’t great, but different strips are used for switching and chip/reference power. I’m also considering switching to MOSFETs as opposed to the 2N3906’s to reduce uC port switching currents a bit.

UPDATE:

Display Drive Schematic (there are only 2x 2200uF caps total)
enter image description here

ADC Reference Schematic, Reference is just TL431A
enter image description here

Reference Output with Microcontroller Disconnected
enter image description here

Reference Output with Segments Switched On-Off
enter image description here

While I didn't post the reference out with segments switched on-off vs on all the time, there actually isn't a significant difference between them. The real difference seems to be that the large spikes are slightly lower in amplitude, but not significant. However it can be clearly seen that the reference out is extremely noisy. The spikes are located at about 310kHz, 2x the DC-DC converter frequency (generating the 5.3V).

Any other tips to improve the noise behavior? Would MOSFETs like BSS84 replacing the 2N3906s help?

Best Answer

You can reduce the off time to maybe 1-2 usec most likely, assuming you have push-pull drive of the PNP transistors.

For dealing with noise, make sure the ground of your ULN2003 is separate from the ground reference of the ADC (probably the ground pin of your micro) and make sure the applied voltage is with reference to the latter.

The ULN2003 will switch a peak current of 53*7 = 371mA, which is problematic, especially on a breadboard.