Electrical – Increase voltage from 5 to 12V to deactivate a display

7segmentdisplayatmegamicrocontroller

I'm developing a timer based on this project: Digital Stop Watch with ATmega8 by Avinash Gupta (I cant put the link, because my reputation is too low)

Original schematic: enter image description here

At first, I made the same schematic (as in the image) with 13mm x19mm and 5V displays and it works fine. The displays work perfectly. Then I change the displays by larger 12V display (something like 5cm x 10 cm). Now, I have a problem: the segments of the display dont turn off at all.

I supply the display with 12V throught BC558 transistor and when I want to show a number: 1, for example, the others segments of the display dont turn off, them only dim a little bit. Later I tried many ideas about the origin of the problem we saw that the problem is this (or we think so): the digital signal from the microcontroller is 0V (to turn on the segment) or 5V (to turn off the segment). The low voltage works fine to turn on the segment because the voltage throught the led is 12V (bigger than threshold voltage), but the high voltage dont woks to turn off because the voltage trought the led is 7 (12V from the transistor – 5V from the micro) and this voltage can turn on the segment (a little dim). So we try to increase the voltage from the pin of the micro using a common emitter transistor (emitter to 10k resistor to ground, base to the micro pin and collector to 12V) and a lot of other configurations, even with an op amp in compare mode. All this in order to increase the voltage of the digital signal to 12V. But all this doesnt works.

After this, I see that that exist two reason for this problem:

1) The 5V from the Port C in the base of the PNP transistor is too low to turn off at all this transistor, when I want deactive the display. So I need increase the voltage in the base of this transistor to 12V in order to turn completly off the transistor. When I have 0V from the Port C all works fine with this transistor, because turn on perfectly.

2) Similarly, in the Port D, when I have 0V all works fine, because the voltage throught the display is 12V, enough to turn completly on this. But when I have 5V in the Port D, the voltage throught the display is near to 7V and is not low enough to turn off the display.

Thats the reason why when I tried to level shifting only in the Port D of the micro doesnt works. I need to do both two level shifting in Port C and Port D.
Then, I assembly this circuit: enter image description here, but this circuit doesnt works. I dont have idea whats happen. Just seems like if the display segments turn on almost all time and turn off when they want.

Excuse me for the large explanation. Now, can someone help me to know how can I solve this problem?

Best Answer

So what you need is a level shifter. PD1 through PD7 need to swing from low (0 volts) to hi (+12V)

One way might be to use an inverting transistor (PD1 out to 10K resistor to base, emitter to GND, collector to R11) AND in the code, to invert all your logic outputs, that is assuming you can reprogram it.

If you can't fix the code, then you need 2 inverters.

Another method might be to add a 5V zener in series between the microcontroller output and the current limiting resistors (R5 thru R11) so that when the output goes hi, there is only 2 volts to drive the led. Or even simpler add Just one zener in series with your 12V supply before the BC558 transistors. Your display might be a little dimmer, but will cut off more effectively. You can bring the brightness back up by lowering the value of R5 thru R11.