Shop OBEX P1 Docs P2 Docs Learn Events
Need help in Driving LED Array — Parallax Forums

Need help in Driving LED Array

GogsGogs Posts: 19
edited 2008-07-16 06:57 in BASIC Stamp
I have just started with the Stamp2 and have been looking to dim a 21 bit array of 5mm white ultra bright LEDS. I have already completed a program with two switches and two low power red LEDS. One·Switch for increase brightness using the BUTTON command and second switch for decrease brightness. This works and I am pleased.

Switch1· - RA8
Switch2· - RA9
CNTRL Signal ·0UT - PIN0

However I know the Stamp's I/O is limited·with how many leds·you can drive. Also I wish the lighting array to be on a seperate voltage supply to the Stamp.

However I wish to·know what type of Transistors or FET's·to use to drive a 21·white LED array. I wish to use the signal coming from·Pin0 of the Stamp.

Can anyone give Help.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2008-07-15 19:01
    There is a MAX7219 and MAX7221 that will work for this project.· We also have documentation regarding wiring and sample code.· However, we do not sell these chips and you might search for them on Google.· I've attached a file for to look at.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support
  • GogsGogs Posts: 19
    edited 2008-07-16 00:25
    The circuit I am working on has 21 high powered LED'd each drawing 30mA at full power. All I want to do is take the pulse from the stamp and put this through a transistor to my array I want. I will be drawing 600mA of power which I know the stamp cannot handle. would a 2N2222 do for the switching?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-16 00:32
    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv6.pdf

    One pin could be used for several transistors.
  • GogsGogs Posts: 19
    edited 2008-07-16 01:40
    Are you talking about the ULN 2003?

    If so the max output of this is 500ma so I could use two I/O pins and share the outputs to two arrays.

    You think this is the way?
  • GogsGogs Posts: 19
    edited 2008-07-16 02:01
    Here is the code using two switches seperate to the output that drives one or two LED's. I want to use this signal so I can control 21 high power LED's

    '**********************************************************
    ' Program :·
    ' Description :· Light Dimmer
    ' For :··· i-Stamp2P
    ' Hardware :· Connect LED to P0
    '··· Connect active low switch "INC" to P9
    '··· Connect active low switch "DEC" to P8
    '**********************************************************
    '{$STAMP BS2p}

    LED_STEP· VAR Byte······· ' Define Byte variable to keep current step
    SW_VAR1··· VAR Byte······· ' Define Byte variable to use with BUTTON command
    SW_VAR2··· VAR Byte······· ' Define Byte variable to use with BUTTON command

    ··· INPUT 8········· ' Make P8 as input
    ··· INPUT 9········· ' Make P9 as input
    ··· OUTPUT 0······· ' Make P0 as output
    ··· LED_STEP=0······· ' Clear state to 0

    LOOP:··· PWM 0,LED_STEP,5
    ··· BUTTON 8,0,50,10,SW_VAR1,1,DEC_LIGHT
    ··· BUTTON 9,0,50,10,SW_VAR2,1,INC_LIGHT
    ··· GOTO LOOP

    DEC_LIGHT:· IF LED_STEP=0· THEN LOOP··· ' Check min value
    ··· LED_STEP=LED_STEP-1····· ' Decrease brightness
    ··· GOTO LOOP······· ' Goto loop

    INC_LIGHT:· IF LED_STEP=255· THEN LOOP··· ' Check max value
    ··· LED_STEP=LED_STEP+1····· ' Increase brightness
    ··· GOTO LOOP······· ' Goto loop
  • GogsGogs Posts: 19
    edited 2008-07-16 06:57
    Can somene help me with finding a component. From The outout I want to know whether I can put the signal through something like a 2n2222 and a seperate power supply therefor prtecting the stamp.

    Cheers.
Sign In or Register to comment.