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.
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?