1
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ Any schematic available? The tool built-in on the editor toolbar is pretty good and easy to use. \$\endgroup\$ – Transistor Nov 6 '17 at 17:10
  • \$\begingroup\$ 150 us seems a bit large for bleedover latency...optimized code should be able to reduce this considerably, provided you're not clocking the microcontroller slowly. \$\endgroup\$ – glen_geek Nov 6 '17 at 17:53
  • 1
    \$\begingroup\$ How about arranging to do the entire conversion during one of your blanking periods? Most converters in UPs can go at above 10khz so you should be able to do the whole conversion during the blanking interval. Push comes to shove leave everything off for a ms or so at the end of the cycle and do the conversion there. Other then that, layout, decoupling, reference voltage connection points, the usual. \$\endgroup\$ – Dan Mills Nov 6 '17 at 23:05
  • \$\begingroup\$ @Glen_geek: The 150usec off time is coincidental (this is how long it takes to run the routines called between turn-off and turn-on) but also intentional, in that I wanted these routines there as the longer off time seemed to result in a smoother looking display appearance with less bleed-over. \$\endgroup\$ – User7251 Nov 7 '17 at 23:51
  • \$\begingroup\$ @DanMills: I like that idea ... will have to give it a shot. Right now I'm running the ADC every 25ms, then averaging the values for display after 125ms (no interrupts, just non-blocking). The measured ADC conv time takes 100us, I may be able to put that in there while the displays are turned off \$\endgroup\$ – User7251 Nov 7 '17 at 23:51
0
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ The 150usec off time is coincidental (this is how long it takes to run the routines called between turn-off and turn-on) but also intentional, in that I wanted these routines there as the longer off time seemed to result in a smoother looking display appearance with less bleed-over. Would minimizing this help to minimize the voltage fluctuation on ground? The chip and ULN2003 have different ground strips on breadboard currently, spaced across the board from each other. And yeah, it's a large current, one display uses the decimal point as well so it's even higher than that. \$\endgroup\$ – User7251 Nov 7 '17 at 23:45

Your Answer

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

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