Shop OBEX P1 Docs P2 Docs Learn Events
Persistance of vision & max LED's driveable? — Parallax Forums

Persistance of vision & max LED's driveable?

JavalinJavalin Posts: 892
edited 2010-01-20 03:21 in General Discussion
Hello,

Is there a maximum number of LED's (the 7-segment "8" style) that can be driven using the POV technique of switching them on-off sequentially, but without flicker?

Currently 6 is the minimum I need to drive, but 8 might be better...

??

James

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-09 18:40
    It's called multiplexing. You need to turn each one on maybe 50 times a second to avoid flicker (Google "wiki persistence of vision"). You should do fine with 6 or 8 7-segment displays.
  • JavalinJavalin Posts: 892
    edited 2009-11-09 18:43
    thanks Mike! 8 displays would give me about 2.5ms on time per led at 50htz.

    James
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-09 18:48
    Remember, that's 2.5ms per 20ms or 12% on-time. Be careful of I/O pin current and LED current
  • JavalinJavalin Posts: 892
    edited 2009-11-09 18:51
    Ok - will do. Using transistors to drive the load (darlington array and some 2N2222A's) for high side supply and low side switching on/off.
  • kwinnkwinn Posts: 8,697
    edited 2009-11-10 05:49
    The nice thing about driving 7 segment leds with a microprocessor is that you can drive pretty much as many digits as you want without loosing brightness or having high peak segment currents. Instead of selecting a digit and driving the segments to display a number you can select a segment and enable all the digits that need that segment lit. A bit more complex to program but the segments are all lit for ~14 % of the time regardless of the number of digits.
  • JavalinJavalin Posts: 892
    edited 2009-11-10 08:48
    kwinn - interesting - thanks for sharing. I'll have to give some thought.

    James
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-18 10:53
    kwinn - that is brilliant. I never thought of doing it that way and it makes so much sense. I wonder if the same principle could apply to 14 segment alphanumeric displays? The % on time is now 7% but one could always ramp up the current. I've always wanted an old-school display with 14 segment displays, even if it was only a 16x2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build
  • kwinnkwinn Posts: 8,697
    edited 2009-11-18 17:34
    Dr_Acula,

    Thanks for the compliment. I am a bit surprised I have never seen this technique in use anywhere. It makes so much sense when you have a large number of digits to display. I don't see any reason why it can't be used for 14 segments as long as a 7% on time provides the required brightness. I have not used it on 14 segment displays, only 7 segment plus decimal ones. It is also quite flexible in that you can use a shift register, counter/decoder, or similar chip to save on I/O pins when required.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-19 00:44
    This has got me thinking. www.futurlec.com/LED/14DR5421AS.shtml = $1.30 for two characters. Looking at the pinout (and this would be equally applicable to 7 seg displays), you have 15 inputs. They are paralled (almost in anticipation of your system of multiplexing). Ok, now lets light up segment A on 20 displays. Put a dropping resistor on the outputs and switch it with a small signal transistor (2N2222 or BC547, or maybe even a ca3046 transistor array).

    But the supply side, that might need to supply quite a bit of current if it is lighting up 20 or 40 or more segments all at once. So would that need a high current supply side switch - eg a small signal NPN transistor driving something like a PNP BC328?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build

    Post Edited (Dr_Acula) : 11/19/2009 12:52:57 AM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-11-19 23:17
    First, lets clarify the terms so there is no confusion. Each display has 14 connections going to one of 14 segments (the "segment select" connection) and one connection going to the opposite side of every segment led in that display (the "digit select" connection).

    All of the pins for a specific segment on each digit would be connected in parallel, and be connected to the power supply through a "segment select" transistor or driver of some kind. If brightness is to be controlled this is where PWM would be done. As the number of digits goes up the current through these drivers will also increase.

    The "digit select" transistor or driver would be where the current limiting is done since only one segment on a digit is lit at any time. Since peak currents through a segment is low (150mA for the one you mentioned) something similar to a TPIC6595 would be a good choice of driver.

    As more digits are added the current draw from the power supply and through the "segment select" will get higher, and one or the other will be the practical limit on how many digits are possible.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-22 06:22
    Yes, I need to get some actual displays to test them out. But in general terms both 7 and 14segment displays would be either common anode or common cathode. If they are common cathode, then using the 'kwinn' switching technique, the low side transistor has very little current, maybe max 100mA and possibly only 20mA and so a 2N2222 or BC549 could do that. Anything more like a UL2003 or the TPIC6595 would probably be overkill. It is the high side switch that has the high current and the current would depend on how many displays.

    This is relevant to the original post too. Eg you can have 100 displays. If each segment has a current drain of 20mA then you need a transistor or mosfet that can handle 2A. 14 of these for 14 seg displays, and 7 for 7 segment displays. So still quite possible to do with relatively cheap discrete components. They are the sort of transistors you have on output stages for audio amps. Eg a BC640 is good up to 1A so that could do 50 displays.

    There are a myriad of chips out there like the TPIC6595 that do low side switching. I'm not sure if there are as many that do high side. Mind you, it isn't that hard to solder in 7 or 14 power transistors.

    Futurlec take 2-3 weeks to deliver but I am going to order some of these displays and do some current vs brightness tests.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build
  • kwinnkwinn Posts: 8,697
    edited 2009-11-22 15:21
    Regardless of whether the display is common anode or cathode, when you are "winn plexing" the peak current from each digit driver to the digit remains constant while the number of drivers increases proportionally with the number of digits.

    The number of segment drivers on the other hand remains constant at 7 or 14 while the current through each driver increases in proportion to the number of digits.

    This is particularly nice for driving common cathode leds because you can use something like a TPIC with 8 resistors to drive a group of 8 digits. Use 1 (for 7 segment) or 2 (for 14 segment) TPICS (or '595s) to drive the segment drivers and the number of digits you can drive is quite large (as is the total current).

    Imagine using 8 TPICS and 7/14 transistors to drive 56 7 segment or 48 14 segment digits with 3 prop pins.

    Post Edited (kwinn) : 11/22/2009 3:29:12 PM GMT
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-12-22 13:08
    Well, I've got my displays and experiments are progressing very well. This form of multiplexing looks perfect!

    Latches eg 374 are a possibility, but in a way, the HC595 might be the best way to go. Only three pins, but with a propeller, you set up all the outputs, send them out, then light up the leds, but then there is a long delay (relative to a propeller clock cycle) while you send out the data for the next segment. Use that time to send out all the cathode bits. I think it ought to be possible to still run at very high multiplex speeds so no flicker.

    First little experiment, how bright is a 14 segment display segment with a 14:1 clock ratio? I hooked up a simple 555 timer and set it to 14:1 and found that at 5V, 220R was still a little dim, but 100R looked good. Looking at the currents, I think that means the cathodes can't go straight into a HC595 and really are going to need small signal transistors. No matter; BC549s or 2N2222s are cheap. Or DIP16 transistor arrays.

    So, for a crazy 20x4 display the 14 high side switchers could be switching maybe an amp or more, so that sets the transistors - maybe a TIP32?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • kwinnkwinn Posts: 8,697
    edited 2009-12-22 18:09
    Why not use TPIC6595's or similar? 8 bit shift register and 8 drive transistors in one chip (595+ULN2803 equiv). Your 20x4 display would require 12 TPICS and 14 TIP32's (if you use 2 TPICS to drive the TIP32) and only 3 prop pins. A small PASM program could easily shift out the data to multiplex the display 60 times a second or faster.
  • ercoerco Posts: 20,260
    edited 2009-12-22 23:45
    Since you guys are into multiplexing, have a peek at this tricolor graphic display for just $1.95 at http://www.mpja.com/prodinfo.asp?number=18050+OP· An amazing price! Lots of interesting items there, well worth poking around a bit. They offer discounts on some items in quantity.

    attachment.php?attachmentid=73907

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
    780 x 392 - 10K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-12-23 00:12
    Hey, that 6595 looks a nifty chip. Perfect for the low side. I wonder, is there a high side equivalent?

    Mind you, 14 TIP32s is no big deal (I'd drive them with BC549s or 2N2222).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • kwinnkwinn Posts: 8,697
    edited 2009-12-23 03:58
    Dr_Acula, I don't think there is an equivalent chip for the high side and even if there was it would not handle the current you need. I really would recommend using 2 TPIC's to drive the TIP32's for several reasons.

    1- It reduces the number of different parts you need to inventory.
    2- It simplifies the board layout since you have one long shift register composed of one chip type.
    3- The chip is also useful for driving solenoids, steppers, and other small loads that 7400CMOS chips can't handle.
    4- Volume pricing.

    It has become my chip of choice for small loads beyond what a '595 can handle.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-12-23 04:51
    Ah, I see, use the higher current 6595s to drive the TIP32s as well? Yes, that would work. Either 3V or 5V supply, but there might be an advantage is a 3V supply and use switchers and then very little energy is being wasted in the dropping resistors. So, if a TIP32 is switching 3V and its base goes from 0V to 3V it will switch ok. Just to double check though, does the 6595 go from low to high or from low to open circuit? If the latter, the base of the TIP32 will be floating and would need a pullup to 3V.

    Looking at the spec sheet the TIP32 has a gain of 50, so 10mA on the base switches 0.5A. So there will need to be some sort of amplification on base as 8x10mA would be beyond a 595.

    Thinking further, I've been using simple switchers LM2574 for 3V and these have a max of 0.5A, so if that chip was used might need to break it up into groups powered by different switchers. Then you might need different groups of 14 transistors. Hmm, then may as well go for lower current transistors??

    OR use a switcher that can give higher currents. Though 1A seems to be the upper limit of many of them as lots of diodes max out at 1A and so do lots of inductors.

    And some back of an envelope calcs, 30mA is the current per segment which is 1/14th of the time, so that is equivalent to all segments being on at 30/14 mA or 30mA per digit. So 10 digits is 300mA, maybe you get 15 digits for a 500mA switcher and 30 digits for a 1A switcher.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • kwinnkwinn Posts: 8,697
    edited 2009-12-23 18:11
    By the time you add up the forward voltage drop of the led, the digit drive transistor, and the segment drive transistor I am pretty sure 3.3V will not be enough to drive the displays.

    The TPIC output is an open collector transistor so no pullup is required. The transistor goes from open circuit (0) to fully on (1).

    I normally run the displays from the unregulated input voltage to avoid having a high current through the regulator. If you use 6 or 7 volts in and an LDO regulator for the 5V to the TPIC's, and a 3.3V regulator for the prop you can run the displays from the unregulated input. Having the power dissipated over several transistors, resistors, and chips instead of a single regulator makes life easier.

    If you are concerned over efficiency you could have a separate switching regulator to provide the exact voltage required to drive the display.
  • kwinnkwinn Posts: 8,697
    edited 2010-01-16 16:26
    As a result of another thread by Timothy Gilmore ( T&E Engineer - Electronics I/O (outputs to common anode RGB LED matrix) question :: Parallax Forums ) I have been made aware of another chip that can be used to multiplexing a large number of led displays.
    The Sure Electronics HT1632C (http://www.sureelectronics.net/goods.php?id=979) is intended to drive an array of RGB leds but it can also be used to drive as many as 32 7segment displays with decimal points or 24 14 or 16 segment displays. Each display can have 16 brightness levels, and multiple chips can be connected in a master/slave mode to increase the number of displays.

    Oops.. here is the forum link http://forums.parallax.com/showthread.php?p=854567

    Post Edited (kwinn) : 1/16/2010 4:41:20 PM GMT
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-01-20 01:38
    What a fascinating find.

    The module from Sure is listed at $11.64 for 8x8x6 leds. Comparing with other solutions, eg Prop+PCB+leds or Other Chip+PCB+leds, other solutions come in at least twice the price.

    Interestingly, a search for the datasheet comes up with a link at the top of Google that is linked to the Propeller forum http://forums.parallax.com/attachment.php?attachmentid=64974

    Scrolling down the datasheet the common pins can sink 250mA which ought to be plenty (there are examples with transistor drivers too)

    For dot displays eg 8x8, I think nothing would beat those pre-made modules for value.

    Scrolling down to page 11 you can start to see how this could work for other displays besides dot displays.

    Thinking aloud here, but say instead of 32 rows you had 4 7seg displays (+dp=8). Join all the commons and you get 4 segments per common, and with 8 commons, as you say, 32 7 segment displays.

    Ditto a similar principle with 16 segment displays (though I'm getting a total of 16 characters, not 24).

    For a dot display, that pre made module is exceptional value.

    For 7 seg or 14 or 16 seg displays, do Sure sell just the chip?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • kwinnkwinn Posts: 8,697
    edited 2010-01-20 03:21
    Don't know what Sure sells or who else might carry the chip. Timothy Gilmore would know since he built the project. I only helped a bit with decoding the data sheet information.

    The interesting thing from my point of view was that any of the chips that are now coming out to control an array of leds can almost certainly be used for driving segment type displays as well. I will certainly keep this type of chip in mind if I need to build a new display board.
Sign In or Register to comment.