Shop OBEX P1 Docs P2 Docs Learn Events
A fist full of LEDs for Christmas - Page 2 — Parallax Forums

A fist full of LEDs for Christmas

2

Comments

  • RaymanRayman Posts: 14,233
    edited 2007-12-27 00:18
    Clemens: After re-reading I realize you did this with just 8 pins! Very clever... If I have it right, you need n pins for an n by n-1 array, right? What do you think is the maximum array size you can do with this method?
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-27 00:28
    Charlyplexing is not necessarily the best way to make such a display.....
    The three main drawbacks are:
    - it has to become quite dim with more than 100 LEDs
    - there is no simple way to "boost" it, as all lines are bidirectional
    - it takes some concentration in soldering

    The simple soution is using a readily available 5x7 dot matrix (or two of them), they exist in many sizes. The pinout is 7+5: rows and columns of the full matrix. See enclosure with a Kingbright type

    Then you boost the 10 columns with 1.25* ULN2803, multiplex them (with an optional 74HC BCD decoder), and supply each of the 7 (or 8) row values directly from the Propeller (= max 280 mA without resistors). It should work fine with the 10% duty cycle...

    This is the standard way to do it - no kudos to me!

    Post Edited (deSilva) : 12/27/2007 2:42:36 AM GMT
    300 x 300 - 25K
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-27 00:44
    Rayman said...
    Clemens: After re-reading I realize you did this with just 8 pins! Very clever... If I have it right, you need n pins for an n by n-1 array, right? What do you think is the maximum array size you can do with this method?

    This hs been discussed many times here (well, what not...)
    It depends on the brightness you strive for.

    And Clemens has already computed how many years the soldering will take him (see above)

    But assume we use 20 pins, so 380 LEDs can be controlled (e.g. 100 each R,G and B)

    If you can afford 4.000 mcd types (most likely 20 Cents each = $76) the brighness will be reduced to 1/380; you can overdrive them with 40 mA so it will be 1/190 only in the end = 20mcd. This is still a good value. As only 200µA are driven through the LEDs however, it might bring them out of their voltage range...
    This has to be checked... I did this some months ago when we had the Charlieplexing hype here, and found that 500µA at least worked fine with some 1.000 mcd types ...

    Post Edited (deSilva) : 12/27/2007 2:59:56 PM GMT
  • ClemensClemens Posts: 236
    edited 2007-12-27 02:15
    @Toley:
    Well, frankly Charlie·may be just some poser who claims for his own an old technique developed by nubean shepherds in the late 13th century BC that allowed them to control n*(n-1) sheep with just n shepherd's dogs. (No·offense·Charles Allen just had a drink or two with a friend of mine who became father Yesterday (yes, on Christmas Eve!". - I'll erase this post in the morning...) :-P

    @Rayman:
    With the leds I used·a grid of 8 to 10 leds² seems to be end of the line. One can easily test this by just hooking up a led and simulating the duty cycle before soldering away. The speed of the prop is no problem off course.
  • ToleyToley Posts: 16
    edited 2007-12-27 04:07
    I made it, I found 56 leds. My last post is 4 hours ago, far than your half an hour Clemens...

    I have to say that I didn't use 2 boards. I've tried but I can't align all the leads so I finished up by cutting all leads and link them with wire.

    My result was not so impressive than Clemens original post. I used junked 5mm red leds that have not even the same brightness. I know now how this multiplexing works and also the limit of this process.

    Thanks to all of you for sharing this.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-12-27 10:34
    Clemens said...

    Well, frankly Charlie·may be just some poser who claims for his own an old technique developed by nubean shepherds in the late 13th century BC that allowed them to control n*(n-1) sheep with just n shepherd's dogs.

    This may need translation into spin*, but the definition of too many dogs is "at any given time, one or more has diarrhea".

    *simple to do. Wire up your big LED grid,·hand to prop programmer.

    Meanwhile, TI has a suggestion for multiplexing·their LED controller chips: http://focus.ti.com/lit/an/slva271a/slva271a.pdf·The pdf suggests that 100 hz is fast enough to make switching invisible to the eye (for just two banks?).··Their chips have a brightness control adjustment·--·could that be used·to adjust for the number of banks that are being multiplexed? TI's limit may be how fast you can send control signals for each 16·LED bank.
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-27 11:19
    TTLC5924:
    Fred, everybody does LED multiplexing for ages, and it is well understood how to choose frequences, brightness control etc., etc.

    The - most likely marketing driven ("We have to throw a new chip on the market: Think of something new") - "innovation" now is the reduction of "ghosting", well described in the document.

    "Ghosting happens when the LED driver does not drive, but. goes tristate. As Charlieplexing BUILDS on that, it should be very susceptible to this effect.

    Standard multiplexing should be able to avoid this effect by just driving both rails (see my example above, using the ULN2803)
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-12-27 14:20
    Maybe about the marketing. Most of TI's stuff that I have seen has been "here's our chip, use one for every 16 LED's".
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-27 14:24
    Well, that sounds like GOOD marketing smile.gif
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-12-28 00:58
    OakGraphics said...
    Cool! Where do you get the veroboard with the horizontand stripes at the front, and vertical stripes at the back? I don't think I have ever seen that.

    You could do that with two pieces of veroboard back to back [noparse]:)[/noparse]
  • RaymanRayman Posts: 14,233
    edited 2007-12-28 01:03
    I'm thinking about a 6x5xRGB array for a toy I 'm working on... I think this would take 18 pins, right? Or, is there an easy way to use less?
  • ClemensClemens Posts: 236
    edited 2007-12-28 01:26
    Yes 18 pins and bright rgb or you could do it with 10 pins (10*(10-1)=6*5*3) with bad brightness and a headache programming.
    But don't those RGB leds have a common cathode? For Charlieplexing you need the cathodes seperate ... on the other hand if you use the 18 pin version maybe it works, ... let's ask DeSilva.
  • RaymanRayman Posts: 14,233
    edited 2007-12-28 01:55
    Hmm... I see the problem (I think). I found a 6-DIP RGB package, but I really want the regular LED through-hole package. I would need at least 5x5. I suppose I could do this the regular way using 20 pins, right? 5 pins to control rows of cathodes and 15 for 5 RGB columns.

    I like how you didn't use resistors. I think that's a bit brave!
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 03:18
    No its not, Ray. Read all my postings in THIS thread. You will get all the answers:
    - how to do it conventionally
    - the effects of multiplexing to the brightness and average current
    - a little bit on Charlieplexing as such.

    Well, I am not quite sure I had it all in this thread, there is another one.. Nevertheless I posted all during the last three days, and there should really no question left open ... I thought smile.gif

    @Clemens: You are right with common cathods... Although I have seen 3-color SMD LEDS with 6 pads... It is indeendastonishing what different kinds of SMD LEDs are in the market... And thea are generally brighter (this is NOT ONLY an effect of their smaller size) , have a better viewing angle, and cost less!

    Consider a 10x10 RGB array: The best way might be standard multiplexing: 10 cathode rows and 3x10 anode columns.
    The cathod current should be sinked by FETs or ULD2803, multiplexed (or not) by a BCD encoder (= 4 or 19 I/O Pins)
    The 30 anodes can be multiplexed in charges of 3 each = 3x BCD encoder =12 I/O.

    I think it can also be possible to omit drivers totally and also the cathode decoder....

    Sink the cathode current into one of 10 Propeller pins (max 40mA)
    There are at most 3 LEDs shining (one from each of the three anode decoders); the get the current the decoders can provide which is not much more than 10mA, so this will match fine.... 22 Propeller pins for that.

    Something similar (with additional dimming) has been done by Reset_Vector - 1 3D-Cube only a few days ago.

    Here is the link: [noparse]/noparse]url]http://forums.parallax.com/forums/default.aspx?f=25&m=238047[noparse][[/noparse/url]

    Post Edited (deSilva) : 12/28/2007 3:32:39 AM GMT
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-12-28 03:24
    Clemens, was your gif massaged in any way? It seems peculiar to me that every frame advances exactly one led change with no duplications or omissions.

    Stopping the frames is interesting -- columns with only one led illuminated are much brighter than those with several lit up.
  • ClemensClemens Posts: 236
    edited 2007-12-28 03:28
    oh no! I was wrong about the cathodes. that's not a problem at all. I think I add more to confusion than clarification here... But if I understood deSilva right 90 LEDs (or 30 RGB) cannot be properly supplied by the prop without additional hardware, no matter how you plex them.
    I have almost no knwledge of electronics so I'm walking on thin ice now:
    I have a RGB LED and in the datasheet it says it needs 20 mA for optimum brightness (Is that per color or altogether???). The prop can sink or provide 40mA on each pin. with 9x10 Charlieplexing there are 10 cathodes per pin, hence, when all LEDs of that row are lit it would have to sink 200mA. Plus you have dimmer LEDs because of the dutycycle. So it would be a shame to waste those nice RGB LEDs like that. Or am I mixing things up again... I start dreaming of illuminated furniture like in Timothy's cool bookshelf thread... Thank god I don't know where to buy a TLC5940. wink.gif
  • ClemensClemens Posts: 236
    edited 2007-12-28 03:29
    Ooops. See what a slow typer I am. Skip my last post or just have a quick laugh...
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 03:39
    Not at all Clemens! This is an extremly tricky matter, and you easily get mislead. But the whole thing is not really "electronics" but "logistics". It is current you have to add up, rather than parcels smile.gif

    Indeed the common cathode is not an obstacle for Charlieplexing. Your own diagram showed how nicely they are all tied to the blue lines smile.gif

    But is will become a mechanical nightmare, I fear...

    I just added the link to Reset_Vectors Cube... That project is undercommented, I think smile.gif

    @Fred: With Charlieplexing ONE LED ONLY is activated at a time. so what you observed must be an artefact of the GIF animation...
    Edit:
    Sorry: This also was nonsense!!! This is my own way of using it for good reasons (explained in the next posting smile.gif ) Of course you can work yourself down row by row, and light as many LEDs as are appropriate in that row!!

    Post Edited (deSilva) : 12/28/2007 3:50:12 AM GMT
  • ClemensClemens Posts: 236
    edited 2007-12-28 03:45
    Haha, Fred, I thought noone is ever going to ask smile.gif I managed to find out the IR codes for my Casio Digital Photocamera with the very, very cool IR kit and Sony-Send-Test from the object exchange! Those objects are really easy to use and very comprehensive, thanks to the authors Bob Belleville and Tom Doyle. So I slowed the scrolling text down to 1 frame per second and put in a command to take a picture after each loop! (The IR Transmitter LED is well hidden, isn't it?)

    Yes, I think the brighter light with single Leds is probably because the prop has to sink all Leds in 1 row with the same pin. But hey, I've made enough assumptions for today I'll really have to start reading about this stuff...
  • ClemensClemens Posts: 236
    edited 2007-12-28 03:49
    Nono, DeSilva I can activate ONE WHOLE COLUMN AT ONCE, really!

    That's why I came up with that ugly line; It sets the leds for one row and puts the bit inbetween that is responsible for the anodes - so to speak...

    dira[noparse][[/noparse]16..23] :=(  plexmask / skipbit *(skipbit*2) +  plexmask // skipbit  +  skipbit)
    

    ohnonono si tacuisses, philosophus mansisses· <-- that one's adressed towards me off course!

    Post Edited (Clemens) : 12/28/2007 4:02:07 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 04:00
    @Clemens:
    There is not much reading about this special matter I think - but what WE are doing here.

    I myself use the Charlieplexing as "one LED per time". This works exactly as the TV screen!
    The main advantage is that you have a very defined current through the (one) LED that is shining. And there is never more current sent through the Propeller but its 40mA.

    By the way, I know of no adverse effects; the average current must stay below 20mA. It is however important that the pulsewidth stays in the ms-region (<100 ms); with a duty cycle <50% of course.

    When you work yourself down "row by row" you have 0 to 7 (in your device) LEDs to shine. (Or column by column, then it's 8!) This is just so possible at the anode side (7x40mA). But someone has also to SINK that current! This poor pin of the Propeller is the bottleneck! It cannot sink more than 40 mA so it will limit all the anode pins to a very convenient value. And this is what Fred observed. When only ONE LED is on, it gets the full current!!

    In non-Charlieplexed applications you add an additional current driver at the cathode side which can sink some hundred mA (the universal ULN2903 are VERY popular). However this is not possible (or at least not easy) with Charlieplexing, as all lines are bi-directional!

    Post Edited (deSilva) : 12/28/2007 4:50:44 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 04:02
    @Clemens: As you see, I had also my issues smile.gif But I think when we both re-read our last 6 postings, everything will become crystal clear smile.gif
  • ClemensClemens Posts: 236
    edited 2007-12-28 04:05
    Okay, got it! Thanks.
    But that means the duty cyle really would be 1:56 in my case, right?
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 04:34
    It would! And that made me wonder and asking for your super bright LED types smile.gif

    However when you address more than one LED at a time you can get a much better "best case balance".

    It is the same when all LEDs are ON, because no more than 40mA can flow at a time as there is only ONE cathode pin active.

    But when a certain percentage of the LEDs is OFF, my serial approch cannot take advantage if that: My average consumption will be 40mA*"percentage of shining LEDs".

    In YOUR case any row (or be it column) with AT LEAST one active LED will consume 40 mA, so your average current usage will be 40mA IN MOST cases.

    I think less than 1/4 of LEDs are ON in your example, so you will most likely have an effective duty cycle of 1:10. In other words: each of your SHINING LEDS will get 10% of the "normal" current (20mA)

    Adding a "cathode power booster" which can sink all the needed current is tricky:
    (a) you need as many "boosters" as you have lines, because each line can be a "cathode line"
    (b) However when it is not neede is has to go into tristate.

    When thinking about this, the classical bus drivers come to my mind: High current AND tristate. A 74HC241 could be the missing link! But no, it cannot switch its lines separately.... All eight or none....
    Does anyone have a suggestion?

    Post Edited (deSilva) : 12/28/2007 4:39:09 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-28 07:12
    Here's a circuit for an inverting tristate driver. When the input is low, Q1 is on, driving the output high. When the input is high, Q2 is on, driving the output low. When the input is floating, VBE in both transistors is below the 0.6V threshold, so neither one conducts, leaving the output floating.

    attachment.php?attachmentid=51139

    This may look like a lot of discretes, but transistors are available in dual (NPN/PNP) packages, some with integrated resistors.

    -Phil
    227 x 314 - 2K
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-28 12:36
    This is exactly what I could not find, Phil... Looking for MSI Chips is not always the best way, most (all?) have a seperate tri state control, which means you would have to use TWO lines (level+TS control), which would effectively defeat the pin saving approach of "Charlie" smile.gif

    Post Edited (deSilva) : 12/28/2007 1:42:43 PM GMT
  • OakGraphicsOakGraphics Posts: 202
    edited 2007-12-28 20:16
    Clemens said...
    Haha, Fred, I thought noone is ever going to ask smile.gif I managed to find out the IR codes for my Casio Digital Photocamera with the very, very cool IR kit and Sony-Send-Test from the object exchange! Those objects are really easy to use and very comprehensive, thanks to the authors Bob Belleville and Tom Doyle. So I slowed the scrolling text down to 1 frame per second and put in a command to take a picture after each loop! (The IR Transmitter LED is well hidden, isn't it?)
    Wowzers!· That's a nifty trick actually.· Being a photo-buff myself I would love to see the code on that.· I will go download the objects and take a look.
    So where did you hide that IR Led? :-)

    Makes me want to dig up my remote for my Cannon Digital Rebal and set up a time-lapse photography thing in prop.tongue.gif

    Post Edited (OakGraphics) : 12/28/2007 8:22:23 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2007-12-28 22:22
    Phill,

    That circuit looks familiar - lol .... It's the same circuit that I have used many times to drive a piezo. You can adjust the resistor values so that the quiescent current is lower. The main thing to lookout for is that in Hi-Z mode, the voltage across the B-E transistor junctions are well below the forward voltage of the junction (typically about .6V)

    http://forums.parallax.com/showthread.php?p=464410


    3mA quiescent version... http://forums.parallax.com/attachment.php?attachmentid=36227

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 12/29/2007 4:38:38 AM GMT
  • kevin101kevin101 Posts: 55
    edited 2007-12-28 23:33
    Back to rgb!

    Couldn't not use two TLC5940's to drive 10 rgb outputs and use a 10 output sequencer (4017 or equiv) and some SMT mosfets to sink the common cathodes?
    I don't think current would be a problem because the TLC5940 can source 120 ma, so that would be 12 ma for each led (I think). The mosfets would also not be a problem, a SOT- 223 can handle 500 ma. Also, if you used the entire 12 bit dimming feature on the 5940, you would get more color than a HD TV (not that the human eye could tell the difference). If you search for rgb led on ebay, you get a bunch of hong kong companies that sell rgb's dirt cheap ($8.99 for 50 + 10 for shipping). So... 40 bucks for led's, 30 for mosfets and IC's, and 10 for pref board and misc componets, and you got a 10 X 10 DIY dot matrix full color screen. It would take 2 I/O for the serial control and 1 to drive the clock on the sequencer (maybe 1 more for reset). Its not the best way, but probably the simplest for the number of I/O. If somebody is willing to give me 100 bucks to make one, ill do it, but my programming skills aren't good enough to run it.

    Still no snow in south Texas. cry.gif

    kevin
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-29 04:28
    Beau,

    Ha, interesting! Yeah, I used small resistors to make sure there was enough of the input current left over for the bases after getting shunted off through the divider. The values are just what I had lying about when I tried the circuit before posting. But a less stiff divider would probably be okay, depending on the minimum transistor betas and current drive requirements.

    -Phil
Sign In or Register to comment.