Shop OBEX P1 Docs P2 Docs Learn Events
What is the best way to wire up 30 LED's to a Propeller? — Parallax Forums

What is the best way to wire up 30 LED's to a Propeller?

CAJ2CAJ2 Posts: 2
edited 2011-03-30 20:46 in Propeller 1
Hi Everyone,

I am wondering what is the best way to wire up 30 LED's to a Propeller? I actually have the Robot Control Board that is on the Stingray, and I don't know how exactly to go about doing this. If anyone can help me I would appreciate it.

CAJ2

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-03-29 18:34
    Shift registers like the 74HC595. What are the LED for?
  • CAJ2CAJ2 Posts: 2
    edited 2011-03-29 18:51
    I am building a robot, and I am just trying to put some LED's on it. Could you string the LED's together so that they all come on at once? I just want them to come on when the robot turns on.

    Thanks,
    CAJ2
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-03-29 18:57
    Shift registers will work well if you just need on/off control. With assembly programming, you could get PWM rates high enough to give you decent dimming. You'll need resistors inline with each LED to limit the current, and have to keep under the maximum for the chip (~70ma total, I think).

    http://bildr.org/2011/02/74hc595/

    You can also use an LED driver like the TLC5940 from Texas Instruments - This chip gives you a 12-bit brightness value for each LED, and doesn't require the current limiting resistor because it has a constant current driver built in. They can be daisy chained together like shift registers. There are at least two drivers for them in the Obex, too.
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-03-29 19:14
    CAJ2 wrote: »
    I am building a robot, and I am just trying to put some LED's on it. Could you string the LED's together so that they all come on at once? I just want them to come on when the robot turns on.

    Actually, for this, your job is easier - Yes, you can program them to come on at once - Wire them all up in parallel. Give each LED (or strip of them) a current limiting resistor, and use a transistor to switch the power to them. You can run a number of LEDs in series as long as the sum of their forward voltage ratings is lower than the supply voltage. So, if you have a 1.5v forward voltage LED, two of them in series could be wired up to a 3.3v supply, but 3 of them in series wouldn't light up.
  • M. K. BorriM. K. Borri Posts: 279
    edited 2011-03-29 20:27
    Remember that different colors = different forward voltages, and that the transistor for 30 leds probably needs to be a little beefy so don't use a 3904/3906/2222, get something that's at least in a to220 package.
  • DavidMDavidM Posts: 630
    edited 2011-03-29 23:54
    I use this chip

    http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=AS1108WL-ND

    I have working code that supports nearly all its features, and my own blinking code as well.

    requires SPI

    regards

    Dave M
  • Pence128Pence128 Posts: 20
    edited 2011-03-30 20:46
    If you just want them to come on when the robot is turned on, they don't need to be connected to the propeller. Just connect them after your power switch. If you want them to be software controlled, connect them through a suitable transistor. If you want them to be individually software controlled, charlieplexing is the cheapest if you have enough I/O; If not, use shift registers like Mike suggested. Two will give you enough for 64 leds and use 3 I/O pins. If you want them to all come on together and you're using a linear regulator, connect them before your regulator (ie, directly to your battery or power supply), and connect as many leds in series as voltage will allow. This reduces power wasted in the regulator and current limiting resistors. See http://www.kpsec.freeuk.com/components/led.htm#series for information on calculating current limiting resistors. If you want to use shift registers, email me for a schematic and explanation.
Sign In or Register to comment.