Shop OBEX P1 Docs P2 Docs Learn Events
one I/O pin multiple led's? — Parallax Forums

one I/O pin multiple led's?

Jayguy5000Jayguy5000 Posts: 139
edited 2009-03-13 17:08 in BASIC Stamp
Argghhhh another question from me! ok sorry, I am in need of using one I/O pin to put the same pulse through 13 ir led's. I am sure this is do able in some sort of way but I don't know how. I am pretty sure the stamp cannot drive 13 led's with a single I/O pin but maybe by putting all that power through a switching transistor and using the I/O pin to turn that transistor on and off really fast? maybe not possible. what ever the case my goal is to simply put 40000 Khz through 13 IR led's using 1 I/O. THANKS!!!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.

Comments

  • Craig EidCraig Eid Posts: 106
    edited 2009-03-06 23:53
    You can use the single· I/O pin to control two of the ULN2800 family of·darlington transistor arrays (http://www.st.com/stonline/products/literature/ds/1536/uln2805a.pdf). They·contain 8 output drivers, can drive up to 500mA per driver and have plenty of bandwidth for your application. Do the math on power dissipation before you turn on the power to ensure that you do not smoke any of the devices.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Craig Eid

    www.TriadRD.com
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-06 23:55
    You definitely will need a power transistor to switch this. An LED will draw about 10 - 20mA. You can put two in series if you're running them from a 5V power source. Each series pair of LEDs will need a current limiting resistor of around 100 Ohms (for a 16mA current). 7 pairs of LEDs will draw about 120 mA total. Since you want 13 IR LEDs, you could use a red LED for the 14th and have a visual indicator of what's happening.

    The power transistor hookup is the same as for a relay except that there's no coil, so no need for a protective diode.

    The 7 series pairs with their resistors are wired in parallel and driven by the power transistor.
    ·
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2009-03-07 00:37
    Im at a loss, what power transistor should I use? can I use the same code on the bs2 and just put out 40Khz through a given pin and connect that pin to the power transistor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • Craig EidCraig Eid Posts: 106
    edited 2009-03-07 02:07
    See the attached schematic that shows an external current limiting resistor - per the datasheet,·the ULN 2801 has an onboard current limiting resistor. You will be driving the low side with your application which means you must supply a HIGH at the I/O pin to enable the driver to conduct and sink the required current.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Craig Eid

    www.TriadRD.com
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-07 02:49
    Read the Nuts and Volts Column #6. It goes into detail on the use of switching transistors (and describes a couple) and also discusses using the Darlington arrays like the ULN2803.

    Go to the main Parallax webpage, click on Resources, then the link to the Nuts and Volts Columns index.
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2009-03-10 21:31
    ok let me see if I have this correct, after looking at the Nuts and Volts column 6

    http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv6.pdf

    I Think I understand I can directly connect a single I/O pin from the stamp to a single Input pin on a darlington ULN2803 and have up to 8 outputs, all outputs being the same as what is coming out of the I/O pin of the stamp, is this right? (and ofcoarse I have to connect power and ground to the 2803)
    My simple mission is to drive 13 IR led's from 1 or 2 stamp I/O pins. Am I on the right track with this type of set up?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2009-03-12 22:44
    and looking at the schematic that Craig Eid posted for (which was very nice) I am a bit confused as to what U1A U1b U1C are. Can some one hold my hand and explain this part to me please?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-13 01:30
    See attached.

    attachment.php?attachmentid=59301
    418 x 399 - 29K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-13 01:39
    You originally stated that you wanted to do 13 IR LEDs using one pin.· Here's how to do 12:

    attachment.php?attachmentid=59302
    501 x 399 - 29K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-13 01:45
    Of note:· Unlike the ULN2803, the ULN2801 does·NOT have a limiting resistor incorporated for each of the inputs, so you will need one between the Stamp and the 2801 input (1K-4KΩ.)
    attachment.php?attachmentid=59303

    Post Edited (PJ Allen) : 3/13/2009 1:56:12 AM GMT
    624 x 407 - 45K
  • Craig EidCraig Eid Posts: 106
    edited 2009-03-13 17:08
    Jay,

    I have updated the schematic and added annotation that conforms to the information on the datasheet. The schematic shows two driver chips, U1 and U2, and lists the pin number next to the input and output pins and 13 IR LED's.·You can drive a total of·16 IR LED's using this configuration but you will be pushing the limit on the single pin output current specification for the Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com

    Post Edited (Craig Eid) : 3/13/2009 5:59:30 PM GMT
Sign In or Register to comment.