Go Down

Topic: LED bar driver (Read 5460 times) previous topic - next topic

andy120

Hi all
I want to driver a pair of 20 block LEDs, each on a different analog task hopefully from the same arduino. Is a Max7221 suitable to drive each block?

Andy

CrossRoads

Depends on how the block is wired internally. MAX7219/7221 expect to have groups of 8 LEDs with a common cathode per group, and the anodes from each group connected (As, Bs, Cs, etc) in common.

Do you have a link or a part number?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

andy120

I intended to use Kingbright's DC-10SGWA stacked one over the other. One pair to do voltage up to 14v DC and the other pair current (DC) for my 4 wheeled crate.
The current by voltage across a 0.01ohm shunt in a 12.5v(norm) 60A(max), that should give me 0.6v max across the shunt.
The voltage take between a pair of 1Mohm resistors. LM3914's are the other option but I don't know how to make the arduino output in the 0-5v range or if PWM can accomplish that.

Andy 

CrossRoads

Is that similar to one of these?
http://www.kingbrightusa.com/category.asp?catalog_name=LED&category_name=KCBar+Graph+Array&Page=1&orderby=
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

andy120

#4
Aug 09, 2014, 03:02 am Last Edit: Aug 09, 2014, 03:07 am by andy120 Reason: 1
Yes, DC10EWA, 3rd one down

CrossRoads

Ok, 10 discrete LEDs. Using 2, 20 discrete LEDs.
Connect them up in groups of 8 with a common cathode, treat them as 3 digits with MAX7219.
Bits of digit0 drive the first 8, digit1 the 2nd 8, digit2 the last 4.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

Hi Andy.

For each block of 20 leds, do you want one led to light up indicating the reading? Or a line of leds? In other words if the reading is 75% of maximum, do you want just led #15 to light, or leds 1 to 15? If the answer is just one led, there is an easier way and you will not need the max7219/21. If the answer is 15 leds, it can still be done with a few transistors instead of the max7219/21, but it may be easier with the max7219/21.

Paul

andy120

#7
Aug 09, 2014, 09:15 am Last Edit: Aug 09, 2014, 10:03 am by andy120 Reason: 1

Hi Andy.

For each block of 20 leds, do you want one led to light up indicating the reading? Or a line of leds? In other words if the reading is 75% of maximum, do you want just led #15 to light, or leds 1 to 15? If the answer is just one led, there is an easier way and you will not need the max7219/21. If the answer is 15 leds, it can still be done with a few transistors instead of the max7219/21, but it may be easier with the max7219/21.

Paul


Actually it appears space is going to limit me to only 1 block each side  :(.  I think 8 leds will give an easier read than a moving dot.
The voltage will have to read only 10 to 15volt range

Andy

PaulRB

You could also consider using a 16x2 lcd display. These are cheap, easy to connect to Arduino and can display numbers as well as a bar graph. For example

http://www.electronicsblog.net/arduino-lcd-horizontal-progress-bar-using-custom-characters/

andy120

I'm trying to avoid LCD's or digital numbers as they look very out of place. A bar looks fine.
Andy

PaulRB

#10
Aug 10, 2014, 12:42 pm Last Edit: Aug 10, 2014, 03:54 pm by PaulRB Reason: 1
Well, its your project. But I'm intrigued - why do lcds and digits look out of place but leds don't?

If you are down to 2 x 10 led bars, max7219 seems overkill. I would drive directly with 10 digital outputs to drive the anodes of both bars, (via 10 ~330R series resistors) plus 2 digital outputs to drive 2 npn transistors (eg. Bc337, with ~4K7 base resistors) for the common cathodes.

As for measuring your voltage and current, use the Arduino' internal voltage reference (1.024V on Uno but 2.048V on Lenonardo for example). You can directly measure the voltage across the shunt, and for the voltage, use a divider made from a 10K and 510R which should bring your 12V down to around 0.6V also.

Bob/anyone else, please critique by suggestions/schematic!

CrossRoads

So let the Arduino multiplex the LEDs as a rising bar. That works too, as long as all the IO is available.
Could do it a 4 groups of 5 also, use 9 pins.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

If pins are at a premium, it could be as low as 5 (see below).

But that's getting a bit complicated for a beginner, and we don't know if the other pins are needed for anything! Hence the original, simpler-to-understand-and-code version before.

andy120

Hi guys, I'm going to back track a bit and say that with some butchery I can indeed fit 20 segments high.
But i think folks would appreciate 10 and 20 segment options.
I guess i just don't like the look of LCD's.

Andy

PaulRB

OK, here's 4 x 10 leds using 7 Arduino outputs.

Go Up