LED sequencer question...

Discussion in 'General Electronics Chat' started by critiera119, Jan 23, 2010.

  1. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
  2. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,173
    397
    The diameter does not automatically indicate current draw, need specs.
     
  3. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    Which specs specifically would be needed so I can ask the seller?
     
  4. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    the silkscreen on that pic gives away what the parts are. the small smt between pic and led's looks like a smt resistor array.

    simple to modify that board using some fets on the outputs, then you can drive "anything" you want...
     
  5. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    Which fet(s) would be appropriate to get for it?
     
  6. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    I think it is an 8 channel LED driver between the PIC and LEDs.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I'd assume that the 16-pin SOIC critter in the middle is simply a resistor array, consisting of eight independent resistors of suitable rating to limit the current to <20mA for the particular LEDs selected, at whatever the output voltage of the regulator is.

    You could probably use the eight + outputs to drive something like a ULN2801 array, to power quite a few LEDs if you wanted to.

    You won't be able to add on more LEDs to the board by itself, as the PIC is limited in it's I/O source/sink capability to around 20mA. If you tried to just add LEDs in parallel with the existing LEDs, it wouldn't work well even if they were perfectly matched. If you tried to add them in series, there wouldn't be enough voltage.
     
  8. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    Wouldn't I have to get rid of that assumed resistor array if I were going use something like a ULN2801?
     
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Actually, I meant to type ULN2803.

    The resistor array on the board will have small values of resistance. ULN2803's have a 2.3k base resistor for each channel already. The small added resistance of the array (probably around 100 Ohms) won't make a difference that you could tell. 2.4k is within 5% of 2.3k.
     
  10. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    So connecting the Positives of the 8 channels on the board to pins 1 through 8 on the ULN2803 and then connecting two LEDs in series to each of it's outputs (11-18) should achieve what I want (to power 16 LEDs) in your opinion SgtWookie?

    Here is an image I created, sorry I understand a lot better with imagery.

    [​IMG]
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That's fine.

    You will also need to attach pin 9 to one of the '-' vias on the board, like the one next to where pin 8 of the ULN2803 connects to the board.

    The ground pin will also need to be common to whatever supply you choose to use for the LEDs.

    Oops - the ULN2803's output will sink current from the LEDs, not source it.

    The ULN2803's output sinks current when the input is high, and is electrically open when the input is low.

    You will need to connect the cathodes of the LEDs to the ULN2803's outputs. The resistors really should be between your + supply and the LEDs rather than on the ULN2803 outputs.
     
  12. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    How does this look? Please edit, if you would, if not correct.

    [​IMG]
     
    Last edited: Jan 24, 2010
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That looks good.

    Since your load is not inductive, you don't have to connect to the Vcc pin (10) on the ULN2803; that's mainly for inductive loads. If you wish, you can connect it to GND via a normally open pushbutton switch, and it will act as a test switch to see if the LEDs are all working.

    With the light load your LEDs will present to the ULN2803, it will have a Vce (Voltage collector to emitter) of around 0.6v to 0.7v.

    So, to calculate your resistors, you will also need to subtract that Vce from your Vcc supply.

    Rlimit >= (Vcc - (Vf_LED1 + Vf_LED2 + Vce)) / DesiredCurrent

    For example, if your LEDs are rated for a typical Vf of 2.5v @ 20mA, and you're using a 9v battery for Vcc, you might calculate:
    Rlimit >= (9v - (2.5v + 2.5v+ 0.6v))/20mA
    Rlimit >= (9 - 5.6)/0.02
    Rlimit >= 3.4/0.02
    Rlimit >= 170 Ohms.
     
  14. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    The seller says "You may put two leds in parallel on each output. This would be 16 leds but only 8 outputs controlled." I guess he thinks it will work ok, but like you, I am skeptical. Guess I will have to try it when it gets here and see if the ULN2803 is necessary. Thanks for your help with this SgtWookie, I will report back with my results!
     
    Last edited: Jan 24, 2010
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The datasheet for the uC is here:
    http://ww1.microchip.com/downloads/en/DeviceDoc/41203E.pdf

    Check out the current limits; +/-25mA per I/O pin, 90mA sourced/sunk total ports A and B, 95mA into/out of Vss/Vdd pins.

    See chapter 14.

    Don't run LEDs in parallel from an I/O pin. You'll likely exceed it's ratings, and burn it up.
     
  16. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    You're right. On another forum, someone suggested using 2n3904 or 2n2222a transistors and that it would raise each port to about 500ma.
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    2N3904 transistors are rated for 200mA Ic max, but have a practical limit of about 1/2 that; 100mA.

    2N2222 transistors are rated for 800mA Ic max, but have a practical limit of about 500mA.

    In either case, you would have to source Ic/10 to the base in order to saturate the transistor. Since the maximum current you can safely source/sink from a PIC pin is 20mA, the maximum collector current you can expect from a typical bjt (bipolar junction transistor) is 200mA or less.

    Darlington's don't apply for this rule o' thumb. Neither do MOSFETs; they're a whole 'nuther critter.
     
  18. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    SgtWookie,

    Just wanted to let you know I got the board and decided to try running 2 LEDs in parallel off of each port. Seems to work fine. I also found out that each resistor in the smd network array of 8 is 50ohms. The seller/source assured me it was ok to do so:

    "A lot of people ask abut the current limit for PIC. First, there are resistors on the board that limit the current already so you cannot pull excess current. Second the PICs are current limited, that means it prevents more than 25mA per output. The more load you put on it the lower the output voltage drops. You are good to go. The LEDs will just be dimmer if you add then in parallel."

    Also, do you know if it is possible for me to download/decompile the code that is on the PIC of this board? I'd like to be able to edit the current LEDs flash sequences and be able to use it for future PICs..
     
    Last edited: Feb 6, 2010
  19. critiera119

    Thread Starter Active Member

    Nov 21, 2008
    66
    0
    Also, do you know if it is possible for me to download/decompile the code that is on the PIC of this board? I'd like to be able to edit the current LEDs flash sequences and be able to use it for future PICs.
     
Loading...