I'm new here, and relatively new to the arduino scene. I have some basic background in electronics (taken classes in college) and have completed a few projects involving LEDS. The newest project I wish to take on can be seen in the attachment. This is a concept I came up with for a wall clock. As you can see in the image, there will be a large digit in the center (designed so that the digit will always be centered, whether it is 8pm or 12pm) representing the hour, while a ring will represent the minute count. The ring should fill as minutes pass by (when it is 15 past the hour then 1/4 of the ring should be lit up) until the ring is reset at the end of each hour. The digit shall simply stay lit to represent the hour.
If possible I would like to incorporate a photo-resistor which will dim the entire display depending on room ambient light.
A friend recommended that I look into Charlieplexing to help drive all the LEDS. He pointed me to purchase a TI ULN2003AN (Darlington 16-pin NPN transistor) and an IRF9530 Mosfet to assist in setting this all up.
I assume that the best way to go about this is to imagine the ring of LEDS as an 11x11 matrix. I have segmented the inner digit (representing the hour) into 20 segments for ease of control and programming. I will use an RTC (w/ battery) circuit to keep track of time.
What would be the best way to go about driving and controlling all these LEDS? The ring contains 120 leds (which need to be individually controlled) and the inner digit contains 220, but will be divided into 20 segments (which would need to be individually controlled).
I have done research on this topic and have come across many different methods including utilizing LED Drivers such as the Philips 4794, and the MAX7221. There seems to be many different methods that I could use, but I would like some more experienced opinions.
Two MAX7219 or MAX7221 for the out ring. 15 levels of brightness control.
Inner segments, use strings of 4-5 LEDs, two strings in parallel, powered from 12-15V.
Use three TPIC6B595 to sink current from the strings to turn them on, control up to 24 segments.
PWM to OE pin for brightness control.
I have some boards that would make this easy:
MAX7219, control with SPI, daisy chain a couple
Thanks for your input -- I went ahead and purchased several MAX7219 chips.
As far as the inner digit is concerned, I had originally planned to wire 11-12 leds in parallel with a single resistor to create segments -- However it looks like each segment could consume as much as 240ma (at 5v, 20ma per led). From the datasheet, I can see that the TPIC6B595 can only handle around 150ma continuous per pin. Is there a more robust version of the TPIC6B595 that could accommodate this, or would you recommend wiring the segments differently? I've planned everything around 5v because I've already acquired a 5v power supply.
Alternatively, could I just control the segments from a third daisy-chained MAX7219?
Thanks for your help -- This is great for a beginner like me.
6A595 has 350mA outputs.
I'd recommend strings of 4-5 LEDs from 12V. Will need waaaay less current.
You need a resistor per LED string. Or a resistor per LED as the LEDs do not run at Exactly the same voltage; with a bunch in parallel, the first one to turn on can sink all the current, and end up burning out.
Or, you could add 4 more MX7219s to control the inner LEDs.
Put them in series strings that are as long as you can manage within the constraints of your available supply voltage and the max number of LEDs that should come on in a single group.
Say you have 2V red LEDs running off 5V. With one resistor per LED (chains of length one), the resistor drops 3V and wastes 60% (3/5) of the power. Or if you can put 5 LEDs in series for a total of 10V and run them from a 12V supply, the resistor wastes only 17% of the power (2/12).
Unless they're ultrabright LEDs, 20mA is probably too much. If that's the absolute-max rating, you'll probably find that they're not much dimmer at 5mA. Even if you put 20mA through every LED, that means that a TPIC6B595 (150mA) could continuously drive 7 strings (140mA) of 5 LEDs for a total of 35 LEDs per segment if you use a 12V LED supply!
Edit: deleted all this crap because it basically repeats what CrossRoads said earlier. Ooops.
Alright, you've convinced me that 12v is the way to go!
I'm a bit uneducated on the subject -- But how would I go about getting both 12v and 5v into the project? It looks like the arduino runs at 5v and the ring LEDs are prewired (with resistors) for 5v (although the inner digit LEDs are not wired at all). Would it be best to use a step-up circuit to move 5v up to 12v, or should I start with a 12v power supply and step down to 5v?
CrossRoads:
Two MAX7219 or MAX7221 for the out ring. 15 levels of brightness control.
Inner segments, use strings of 4-5 LEDs, two strings in parallel, powered from 12-15V.
Use three TPIC6B595 to sink current from the strings to turn them on, control up to 24 segments.
PWM to OE pin for brightness control.
I have some boards that would make this easy:
MAX7219, control with SPI, daisy chain a couple
For that particular board, the MAX7219 is powered from 5V and it controls the current going to 64 LEDs. I thought I had a schematic posted, looks like I forgot to add that.
For TPIC6B595, it is an open drain circuit ; +12v to anode1, cathode1 to anode2, cathode2 to anode3, cathode3 to anode4, cathode 4 to resistor, resistor to TPIC6B595 pin. Select resistor for 20mA per string, can drive 2-3 strings per output to make up a segment.
TPIC6B595 is driven from arduino directly.
You could drive both the 60 ring LED's and the segment LED's from MAX7219 chips if the individual segment LED's are wired as part of a 8x8 matrix (not in series or parallel). You could use the LedControl library but write your own functions that call it to turn on/off the required LED's for the segments your wanting to drive.
Can you include a PC power supply, at least during the prototype phase? They give you 5 and 12V. The other option is to buy a 12/15/whatever supply (eg laptop chargers are usually about 19V) and then use an LM2596 module (about $1-$3 on eBay) to produce your 5V.
I think the 7219 includes current control so you probably don't need current limiting resistors for any of the outer ring. You will definitely need resistors (1 per chain) when using the 6B595.
Riva: not really. The 7219 will drive only one maybe 2 LEDs per segment, not the 10+ required for these big digits.
polyglot:
Riva: not really. The 7219 will drive only one maybe 2 LEDs per segment, not the 10+ required for these big digits.
I realize this, that's why I said
You could drive both the 60 ring LED's and the segment LED's from MAX7219 chips if the individual segment LED's are wired as part of a 8x8 matrix (not in series or parallel).
Alright -- So I have an update and a few questions.
I went ahead and wired up a single-LED-circuit to test forward voltage deviation between the LEDS I have purchased. While doing so I noticed that I can run a single LED (3.3V forward voltage) with a 660ohm resistor. This provides the LED with 2.6ma of current. Even with such a lower amount of current the LED is plenty bright enough for what I need.
With this being said -- It's occurred to me that 8 LEDS in parallel running at 2.5ma would equal 20ma.
Would it be safe to run these LEDs in parallel since maximum current draw will be 20ma (safe for even a single LED)?
If so, could I simply create 8-LED segments in parallel and power them from a single port on a MAX7219?
If so that would be great and would eliminate several problems!
I would say yes. If any one LED had less voltage drop for any reason, you might end up noticable bright spots in your segments.
I am doing the same here, 8 digits from MAX7219, the segments are 3 LEDs.
They have been running a couple hours in a day, 3-5 times a week, since July 2011.
Interesting! It's good to know that they can be that reliable.
To avoid issues with inconsistent LEDs I am going to divide the LEDS into groups based upon relative forward voltage. Hopefully that might help avoid bright spots.
By the way, In case anyone is interested I laser-cut some lexan for the project in my universities fabrication lab. See attached. (The burn marks buff out with a bit of rubbing alcohol)
If you're putting LEDs in parallel, you still need a resistor for each one, i.e. you are making 3 parallel chains of R+LED in series. If you directly connect 3 LEDs in parallel and with one resistor in series with the whole lot, you'll usually find that one LED is taking basically all of the current and the others are pretty dark. Try it in a breadboard!
Once they all have their own resistors, the brightness variation due to Vf variation is usually not worth worrying about. If you're happy to run 8 in parallel at 2mA each off a 7219 and waste most of the power in lots and lots of resistors (so much soldering!), it will work OK.