7-sement clock

Go To Last Post
37 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am trying to make an 7-segment display based multiplexed clock. I am confused about the right schematic to use, i have got two schematic from net.
One uses NPN transistor for switching while other uses PNP transistor for switching. Both circuit are common anode.

http://dev.pulsed.net/misc/clock.png
http://www.h-renrew.de/h/avrclock/avrclock.pdf

I am not able to get what could be the diffrence in using NPN or PNP.

Please suggest me which is the right schematic :?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PNP transistor emitter attaches to VCC, you pull down the base to turn them on. Good for sourcing vcc to the anode. NPN transistor emitter is grounded. Collector is a switch to gnd. Good for turning on led that is hanging from an R to VCC.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would prefer the npn solution.

The other schematic may cause ghost digits, if you switch on the next digit to fast (because Miller effect).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In many designs i have used common anode led displays always drived by pnp transistors and worked good.
In the design with pnp the base resistor of 22k i think is very big,3.9k to 4.7k is fine.Very important is the speed of multiplexing.Low speed gives flickering,higher speed gives ghost lighting.
The speed must above 50HZ and below 100HZ.
80HZ-85HZ gives good stable readings.
This frequency must multiplied by the number of digits to set then the timer interrupt interval.
Example 8 leds
80Hzx8digits=640HZ T=1/640HZ=0.0015625 second interrupt interval.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What i got is that some cases we would like the load to be at ground potential while other we want load at high voltage. Also depend upon pin source & sink capability.

these link clarify it :--
high side switchhttp://www.w9xt.com/page_microdesign_pt8_pnp_switching.html

high side switch, a PNP transistor will be needed ---  there are some cases we would like the load to be at ground potential. One additional thing you need to be careful with PNP high side switches is the voltage used to drive the load.  Normally it is best to use the same voltage to drive the load that is used to power the microcontroller.  

As calculation shown in example -- current sinking in controller is 6 ma  which is less tha 33ma req of load.

low side switchhttp://www.w9xt.com/page_microdesign_pt7_transistor_switching.html

low side switch, a NPN transistor will be needed ---  When the load the microcontroller must control has voltage or current requirements that exceed the capability of the micro’s output pin, an NPN transistor can be used to switch the load.

With NPN we cannot use load at emitter because ?
The reason is that the load will generate negative feedback, causing the transistor to try to turn off.  Suppose we tried that. As the port pin started to go high, current would flow through the base of the transistor, causing current to flow into the collector and out the emitter though the load. This current would cause a voltage to form on the load. As the voltage at the emitter rises, the current through the base would decrease, causing a reduction in current through the transistor. Essentially the transistor will not turn on properly in this configuration.

here in this case - VP0 = Vrb + VBE + V(drop on load)
Vrb = voltage on base resistor
Vrb = VP0 – VBE -  V(drop on load)
Ib = Vrb/rb  ---- so IB decreases

Ic directly proportional to Ib  --- Ic = Hfe*Ib

so Ic decreases, because of ths  Essentially the transistor will not turn on properly in this configuration.

One more good link for its description ;---
http://www.opencircuits.com/Basic_Circuits_and_Circuit_Building_Blocks
http://melabs.com/resources/articles/ledart.htm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

millwood wrote:
the first schematic, clock.png, is the wrong approach

Thats definitively the falsehood. :!:

The emitter follower works excellent and switch damned fast, no ghost digits.
Of course, it reduce the LED voltage a little (0.6V), but this can easy be compensated by lower LED resistors.

Also only 0.6V drop cause no dramatically heating of the transistor (no need for a heatsink).
In opposition, the overall power consumption was a little bit smaller as on the other sheet, because the base current was derived from the LED current.

Also no base resistors needed, the emitter follower has a high impedance input.
Since the schematic contain base resistors, it seems, the developer tried first the other schematic, but was unsatisfied by the result.

The base resistor on the other sheet was a critical part:
If it was to high, the voltage drop increase.
If it was to low, the switching time and the power consumption increase.

The one and only drawback of the emitter follower:
If the LED voltage was close to the VCC, the drop may be to high.
E.g. on blue LEDs (4.5V) and VCC = 5V.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

millwood wrote:
take an EE101 and you will know, ;)

What does it mean?

millwood wrote:
"miller effect"? :)

Of course, the disadvantages of the emitter circuit are the Miller capacitance and the saturation.

Both increase the switching time in opposition to the collector circuit (= emitter follower).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

millwood wrote:
danni wrote:
millwood wrote:
the first schematic, clock.png, is the wrong approach

Thats definitively the falsehood. :!:
Peter

take an EE101 and you will know, ;)

"miller effect"? :)

PASS an EE101 (or just Google "miller effect") and you'll learn that the "miller effect" pertains to inverting amplifiers, which emitter followers are not examples of.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RES

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dude, dude, dude, didn't I already tell you that you look stupid when you are just parroting what you found five seconds ago on Google?

Group delay? You have no idea what group delay is.

BTW, how much did you pay for your copy of Proteus?

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I really like the emitter follower idea for the 7-segment displays.

All benifits with no drawbacks.

Power dissipation in the transistor is a bit bigger, but power dissipation in the resistors is lower.
If Vcc and the total current is the same, then the total power dissipation is also the same.

Faster switching. (I had to ad 6 or 7 nops to preven ghosting)

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
I really like the emitter follower idea for the 7-segment displays.

All benifits with no drawbacks.

Power dissipation in the transistor is a bit bigger, but power dissipation in the resistors is lower.
If Vcc and the total current is the same, then the total power dissipation is also the same.

Faster switching. (I had to ad 6 or 7 nops to preven ghosting)

Its exactly, what I say all the whole time. :D

The emitter follower (npn schematic) works better in this application in comparison to the common emitter circuit (pnp schematic).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I believe the Miller Effect is still a factor.
For example:
Drive a CA display with an npn transistor as emitter follower (such as in clock.png in the first post of this trhead.)

1). Vcc = 5V -> Emitter is approx 4.4V.
2). Anode of the led is 2.4V (Assume 2V over LED).
3). The voltage over the current limiting resistor is also 2.4V.
4). Led is fully turned of if no current flows through the led any more.
5). This happens if the Emitter of the transistor has dropped to 2V (The turn on voltage of the led).
6). That means the Collector - Base voltage of the transistor changed from 0V to 2.6V.
7). This Base - Collector Voltage change kicks in the Miller Effect.

I think that the turn-off speed is primarily increased because the Emitter follower is not driven into saturation.

What puzzles me a bit is why the emitter follower has base resistors. (R8...R11) I believe these can be safely omitted: Even faster switching, and less components. It will generate some current spikes out of the AVR Pins during switching, but that is probably acceptable.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni wrote:

Also no base resistors needed, the emitter follower has a high impedance input.

I'm looking at implementing the NPN emitter follower circuit. I want to clarify...I don't need the base resistors? One the current limiting resistors on each cathode?

One other question. The chosen transistor is only Through Hole. What is the magic for choosing a transistor. I likely want to do surface mount because of height issues. Do I just look for something with similar characteristics? Are there any that are better than others? Are there transistor "arrays" that fit this profile?

Thanks,
PiperPilot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should use a small resistor in series with each base. The (extremely competent) old analog designers I had the pleasure of working beside would refer to these as "base stopper" resistors, and said that although one could work out ideal values for specific cases, 47 ohms is an adequate 'rule of thumb' value. The details have long since evaporated, but emitter followers can oscillate when driven by low-impedance sources; the series resistors prevent the oscillations. Assuming you directly sink individual segment currents to ground with I/O pins that you keep within the 10mA max spec, you'll have a maximum of 80mA of emitter current. Especially since you don't need to saturate the anode driver transistors, you should be able to count on a beta of about 100, so there'll only be one milliamp of current through the 'base-stopper' resistor when you're turning a digit ON, and therefore have only a 47mV drop through them (which is negligable).

Here's a schematic for an old version of a kind of kitchen-sink 'class project' board for a microcontroller class I occasionally co-instruct, that shows a muxed LED display with NPN emitter followers (jellybean 2n2222A) driving CA displays.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Levenkay wrote:
...but emitter followers can oscillate when driven by low-impedance sources; the series resistors prevent the oscillations.

You forgot to say that emitter followers w/o the series resistors are tend to generate the X-rays which can easily kill the user.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One more question. Can a ULN2803 work in this configuration? It would seem by the datasheet that it includes all required base resistors, etc. I'm trying to figure out the most effective way (both cost, board space, etc) to source current through an LED matrix. I have mostly seen the ULN2803 used in common cathode designs, not anode.

Thanks,
PiperPilot

EDIT: OK...this was a dumb question...looking closer at the ULN2803 I see that it can only Sink current. So I will be looking at discrete transistors again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use the logic level PMOS transistors instead - they are smaller, cheaper and much more efficient than those ancient Darlington drivers.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

millwood wrote:
Levenkay wrote:
The details have long since evaporated, but emitter followers can oscillate when driven by low-impedance sources; the series resistors prevent the oscillations.

just how do you get a circuit to oscillate without feedbacks?

do NOT use emitter followers as switches. They are inefficient and dissipates far more power than switches.

Those would be the details that I've forgotten, but a Google turned up this article, which seems to be in the same vein as what I vaguely recall from my AFTR class.

And as for the emitter followers, as long as nobody (so far) has been agitating for replacing the LED series resistors with inductors and switchmode techniques, what does it matter where you burn up the difference between Vsupply and the LED forward voltage? Yes, the emitter followers dissipate some of the heat that would otherwise go into resistors. In the case at hand, it's an acceptable amount. I would point out that the emitter-follower common anode driver allows you to feed the collectors from your unregulated supply, thereby dramatically lowering the dissipation in the little 3-terminal regulators everyone's circuits use for the AVR's supply.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are 8 resistors (including dp) connected to the led display, it would me more appropriate to let them share that dissipation instead of the transistor.

It is not bad to use the emitter follower as long as everyone using this way is aware of the fact that the voltage output in the emitter will ALWAYS be about 0.7v lower from the base voltage.
Keep that in mind when you try to use a lower voltage mcu (3.3v ARM) or an FPGA driving the leds to avoid any problems.

The dissipation factor is also important if you use an smd transistor with only 0.325W

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So called digital transistors are also good for such applications - they do not require external resistors and are not emmiter followers.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So what's wrong with these transistors to the OP who needs the smallest possible solution?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Transistor is by nature an analog device.
What we call a digital transistor is actually an analog transistor that has internal resistor from the input to the base and a (pull up/down) resistor between the base and emitter.

Quote:
This new series of digital transistors is designed to replace a single
device and its external resistor bias network. The digital transistor
contains a single transistor with a monolithic bias network consisting
of two resistors; a series base resistor and a base−emitter resistor. The
digital transistor eliminates these individual components by
integrating them into a single device. The use of a digital transistor can
reduce both system cost and board space. The device is housed in the
SC−89 package which is designed for low power surface mount
applications.
• Simplifies Circuit Design
• Reduces Board Space
• Reduces Component Count

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK...so for the drive side....I want to source like 160mA. I found some inexpensive PNP Darlington Tranistors that look like they will do the job:

https://www.jameco.com/Jameco/Pr...

I assume I still need a resistor on the base. A previous post was suggesting 3.9K or 4.7K for PNP type.

Thoughts?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I assume I still need a resistor on the base. A previous post was suggesting 3.9K or 4.7K for PNP type.

No you don't. Emmiter followers just do not require them by design.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting discussion, I hadn't considered the benefits of NPN transistors in this.

However, I have to say that if you want to make it as small as possible I'd use a TLC5916 constant current LED driver chip for the LEDs, and a pair of dual P channel MOSFETs like FDY2000 for the banks. There's a problem with that if you need to supply the LEDs from an unregulated source that is above the processors Vdd, in which case you could use a TLC5926 and use 4 of the other 8 outputs with a resistor pack as pull-ups to control the gate signals of the MOSFETs. Then you could use a tiny micro with an SPI interface. But I digress.

Edit: If you can afford 4 control signals on the processor maybe a pair of FDY3000 dual N channel FETs and a CAT16-103J4LF resistor pack to control the P channel gates, then you can use the TLC5916 for the LEDs.

Mark.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK...revisiting this again trying to understand. I decided to use PNP Transistors (Darlington) because I needed to SOURCE current through the LEDs and then use the ULN2803 to SINK the other side.

I found the MPSA77 PNP Darlington Transistor http://www.fairchildsemi.com/pf/... Found a good deal on them through Jameco so ordered a few up.

I am using a similar setup to the AVRclock example in the first post but not using the base resistor because someone here said it wasn't necessary.

Now...I can't get it to turn on/off. It just stays on all the time. Is this because I don't have a base resistor?

I'm driving this from a digital pin, at 3.3V and have 5V connected to the collector.

Can anyone help me figure out what I am doing wrong? I should be able to drive this PNP right?

Thanks,
PiperPilot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The PNP will shut off when the base gets pulled up to 5V. If the output to the base is only 3.3V, its on. Try adding a pullup. 4.7K maybe.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

piperpilot wrote:

I'm driving this from a digital pin, at 3.3V and have 5V connected to the collector.

:D:D:D

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lets get this straight - you have pnp darlingtons that you want to switch 5V to the common anode leds? If this is the case, the emitters go to the positive supply and the leds go to the collector. The next issue is the base being driven via 3V logic. A logic '1' is 3V (theoretically) so the base is at 3V and the emitter is at 5V, a difference of 2V. Thus we have current into the base which means the transistor will turn on.

Two months of discussion are we havent got past basic transistor theory!

Two choices- either have the AVR run on 5V or add some NPN transistors to do the level translation. How to do this? I would only have to sneeze and Google would give 100's of hits.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And in the above configuration (emitter connected to the power supply) you have to use a resistor in the base to limit the base current or you will damage the transistor.
The base resistor can only be removed when you use a transistor with the load (output) connected to the emitter, in that case the current in the base-emitter diode is already limited by the emitter resistor (load) so there is no need for the base resistor.

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK...so I just double checked my setup. I indeed do have the 5V connected to the emitter. I had my vocabulary all mixed up, as you can tell I am a bit confused.

So I tried the pullup method with a 4k7 resistor to 5V and it works like a charm. I also added a 22K base resistor (what I happen to have in front of me) and was able to get the expected behavior. Now 2 resistors plus the transistors is starting to get a little tight on the design. Does anyone know of an affordable 8 unit PNP (darlington) IC? Something like the ULN2803 but that can SOURCE current? Preferably surface mount.

Otherwise, I think this is now a viable design, I'll just have to squeeze in those extra 16 resistors I didn't have before.

Thanks everyone for the help!

PiperPilot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UDN2981A

Have you checked the voltage levels out of the darlingtons? Are they actually turning off? Are they turning on enough? It might just be 'working' but maybe not too well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman,

Yes, I checked the voltages...It definately turned off. On the drive side it drove up to 4.7v instead of the 5 that was supplied, which for this application is probably fine.

I checked out the UDN2981/2 and it looks like a decent chip. A little on the pricey side. Looking at that chip gave me some additional search terms to look around some more.

How about the Toshiba TD62783?

Datasheet here: http://www.toshiba.com/taec/comp...

From the specs, it looks like it should work well.

Thoughts?

PiperPilot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Austria Microsystem, The AS1106 and the AS1107 are compact display drivers for 7-segment numeric displays of up to 8 digits. The devices can beprogrammed via SPI, QSPI, and Microwire as well as a conventional 4-wire serial interface.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MAX7219/AS1107 - incredibly similar. Latter cheaper. Can write for the first and plug in the latter but not the other way round if you use the AS1107 Feature Register

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't forget that the processor has substrate diodes to 3.3V on the I/O pins. If you just had a resistor from the processor pin to the base and the emitter was tied to 5V the processor's pin would sink current (because the pin can't get above 3.3V + substrate diode drop), and then PNP transistor would be permanently on.

If you're tied for space a constant current LED driver will save quite a bit (no ballast resistors needed), plus it's SPI meaning a smaller micro with less I/O pins.

Mark.