Shop OBEX P1 Docs P2 Docs Learn Events
Question about multiple LEDs, sound activation & power... — Parallax Forums

Question about multiple LEDs, sound activation & power...

Ryan ClarkeRyan Clarke Posts: 738
edited 2005-03-17 15:30 in BASIC Stamp
Any suggestions or advice would be appreciated:

I am trying to design the most efficient way to run approximately 60 LEDs, grouped as four, eight, sixteen and 32 (ie groups will be on together)- I want to use a BS2 (or BS1, possibly) to control the groupings of LEDs turning on and off driven by sound (like a meter on a stereo)- and I want to run off of batteries for approximately 6 hours (or more)-

I plan on using a carrier board for the BS2s power (9v and voltage reg. to get my 5v, a home brew board)- what do you think the best way to power the groups of LEDs will be? (As in what battery pack setup would you suggest?) I'm thinking C or D cells here, any help?

I'm also looking at the MAX7219 from Parallax (because I already have one) to possibly assist in driving the groups. (Overkill? I haven't used a 7219 before, so I thought it might be a good way to learn about it...)

What do you think?


(And just for grins I think I'm going to try and do this project with a BS1 or BS2 then re-create the entire thing with the SX chips...also for a learning experience)-

Thanks!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-15 12:56
    Since you want to control so many LEDs, using the MAX7219 is a good idea -- it will let you control up to 64 discrete LEDs and control the current (important for a battery-based application).

    For the BS1 you'll have to synthesize the SHIFTOUT function as it is not part of PBASIC 1.0.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-15 16:29
    Given your constraints, you'll want to use a current controlled driving mechanism, like the part Jon suggested. This will place nearly all the power used into your LEDs and not current limiting resistors, another option is to PWM the LEDs which should further reduce the power used. Lithium Ion batteries have the highest charge density and will not drop in voltage until they are just about exhausted, and some chemistries are rechargable. You don't need a 9V supply, 6V worth of Li-ions with an LDO regulator should be just fine. There are current limitations to Li-ion, you could either parallel them or use NiMH if its a problem.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-15 17:32
    If the MAX7219 is used, the LEDs are under PWM control (they're multiplexed), and a single resistor sets the current (hence brightness) for the leds)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-15 18:02
    I believe the MAX7219 also has a 'brightness' setting in it -- but it sets the brightness for ALL the LED's simultaneously. This setting adjusts the brightness PWM for the chip -- where the single resistor above sets the current limit for the 'full-bright' level.

    Another possibility is 8 74HC595 chips. These will give you MUCH greater control of individual LED's, but give you the added difficulty of pre-figuring your patterns and putting them into the EEPROM as DATA statements. It's also more hardware -- a resistor per LED, and the chips themselves. The '595 can drive larger currents than the BS2, so 8 led's off a 595 is no problem.

    You can drive a '595 with the SHIFTOUT statement. Daisy-chain them together and this takes 3 wires -- data, clock, and ground.

    Note all 60 LED's on at the same time takes 900 mA -- worst case would be 900 mA for 6 hours, or a 5.4 A-Hour battery.

    Post Edited (allanlane5) : 3/15/2005 7:10:04 PM GMT
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-03-15 18:51
    Thanks for all the help....

    Am I correct in assuming that if I use the MAX7219 the max draw at any single time would be the equivalent of 8 LEDs (because doesn't the MAX7219 just pulse the 8 segment groups?)- so when you figure the limiting resistor value you really figure it for a max of 8 LEDs at a time, right?

    Thanks again!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-15 18:56
    You're right that only eight LEDs are on at one time, but they're multiplexed so quickly that it will appear that as many as 64 are on.· Consult the docs for the current limiter setting; I believe it is set for one LED.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • KenMKenM Posts: 657
    edited 2005-03-15 21:02
    Along with the one resistor used for current setting, you still have lots of room to control brightness, 16 levels.

    Below is a brief excerpt of a posting several months ago that describes how to control different levels of brightness.

    ;INTENSITY - Address $XA
    ;Options·$00 = minimum intensity
    ;$FF = maximum intensity
    ;See MAX7219 data sheet for resistor selection and current

    ;To set "medium" intensity ( I had a 47 k ohm resistor from pin 18 of the 7219 to vcc)

    The bs2 code to do this is:

    'Set intensity of LEDs
    'LSNibble 0 = min intensity and F = max intensity


    Intensity:
    · LOW Load
    · SHIFTOUT DOUT, CLK, MSBFIRST,[noparse][[/noparse]$0A07\16]
    · HIGH Load
    · RETURN
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-03-15 21:32
    What about getting battery power into the MAX7219? A seperate 5v source is pretty much required, from what I can see.
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-03-17 08:36
    Ok, just to get started, I built this circuit today:

    http://ourworld.compuserve.com/homepages/Bill_Bowden/555leds.gif

    and it works fine. Now I think I'm going to use that as a base, and add in the BS2 so that I can control 'groups' - I'm going to use 4 AAs (6v) to power four 'sets' of LEDs and give the BS2 it's own 9v on a mockup super carrier. Using two seperate power sources, will I run into a problem with 'uncommon' grounds that anyone can see? (I don't have much experience using multiple power sources like this-)

    Ryan
  • KenMKenM Posts: 657
    edited 2005-03-17 15:30
    You wrote>Using two seperate power sources, will I run into a problem with 'uncommon' grounds that anyone can see? (I don't have much experience using multiple power sources like this-)

    To answer the question it depends on how you will enable the 555-LED circuit. Can you post a schematic that shows your plan to enable the 555-LED circuit?
Sign In or Register to comment.