Shop OBEX P1 Docs P2 Docs Learn Events
Controling 300mA with a transistor from an I/O. schematic needed — Parallax Forums

Controling 300mA with a transistor from an I/O. schematic needed

DgswanerDgswaner Posts: 795
edited 2007-11-14 20:39 in General Discussion
I want to control 5-10 LEDs all on or all off no lighting effects. each LED is 30mA so x10 that's where I'm getting the 300mA. I can find transistors at this rating and the data sheet will usually give a sample circuit but in this case they don't. and I haven't been able to find one on the web

Is this the best option? should I just use a solid state relay or something? can someone point me to a circuit for this.

Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-14 18:30
    What's the forward voltage of the LEDs at 30mA? (This info will be in the LED's datasheet .) Also, what kind of voltage do you have available to power them (e.g. 5V regulated supply, unregulated 9V wall transformer, etc.)? Such info will help determine the best configuration (series, parallel, or series/parallel combination; series resistor vs. active current regulator, etc.).

    -Phil
  • DgswanerDgswaner Posts: 795
    edited 2007-11-14 18:32
    3.6 - 4.0 MAX this is for headlights on a mobile robot, I will be powering from a 12V battery and A 5V LM7805 circuit. they can be in series or parallell.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-14 19:00
    You want to put 2 LEDs in series for a total forward voltage of 7.2 to 8V. You'll need to drop about 4V at 30mA from the 12V battery for a series resistance of 130 ohms and power dissipationof 120mW. They need to be 1/4W resistors.

    You'd need 5 of these strings for a total of 10 LEDs and a total current of 150 mA ... very switchable with pretty much any switching transistor (like a 2N2222 or 2N3604).

    Connect the resistor ends all to the +12V supply, then the anodes of the 1st LEDs go to the resistor and the anodes of the 2nd LEDS go to the cathodes of the 1st LEDs. The cathodes of all the 2nd LEDs are connected together and to the collector of the switching transistor. The emitter of the switching transistor should be connected to ground and the base should be connected through a 220 ohm resistor to an I/O pin. The LEDs should come on when the pin is made HIGH.

    There are plenty of sample schematics in the StampWorks and the Industrial Control tutorial.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-14 19:24
    Mike beat me to it! Here's a circuit that does what Mike suggests and regulates the current, in case the battery voltage varies:

    attachment.php?attachmentid=50432

    The five 12-ohm resistors help to balance the LED currents in case their forward voltages vary. The emitter resistor, along with the two 470-ohm bias resistors are what set the overall current limit. A lower value emitter resistor will give you more current; a higher value, less current. If the emitter resistor gets too hot, replace it with a 1/2-watter. The transistor will be dissipating about 380mW, which is well within its capabilities. If you alter the number of LED strings, you will have to change one or more of the resistor values.

    -Phil

    Addendum: If your battery voltage can range more than a volt or so above 12V, the transistor may get too hot. If this is a possibility, it will be necessary to adjust the bias and emitter resistor values, so the emitter resistor drops more voltage.

    Post Edited (Phil Pilgrim (PhiPi)) : 11/14/2007 7:32:56 PM GMT
    420 x 433 - 4K
  • DgswanerDgswaner Posts: 795
    edited 2007-11-14 19:46
    Wow! I was just hoping for a similar schematic, not a custom job. I plan to make 2 sets one white light one IR, the plan is to have a camera with night vision, and when controlling it via the web you have the option for either. I really appreciate the help! I'm a much better reverse engineer especially when it comes to electronics. that being said, pardon the question. I looked up the 2n222 is list the Collector current at .6A so I could add more LEDs in the same configuration if needed so long as I don't exceed 600mA. and I'm guessing leaving a margin for good measure. Thanks for the help I'll post a PCB and pics when I get it done.

    Thanks a lot guys I really appreciate it

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-14 20:13
    CAUTION:
    • If you use my schematic without changing resistors, adding more LEDs won't give you more light, since the overall current limit won't change.
    • Just because the 2N2222 can handle 600mA doesn't mean that you won't exceed its power dissipation rating, even at less than 600mA. This is particularly true in my circuit, where the transistor is operating in its linear region — not in saturaiton. Make sure that the product of the emitter current and the emitter-collector voltage is well under the absolute maximum power dissipation rating.
    • IREDs have much lower forward voltages than the white LEDs you originally spec'd. This will entail a different circuit for your night vision illumination than the one shown.

    -Phil
  • DgswanerDgswaner Posts: 795
    edited 2007-11-14 20:26
    Ok, This is good to know, Let me see if I can come up with the IR circuit, I need the practice. I know it will basically be the same but different R values and such, I just wasn't sure the best way to handle this. I need to breadboard this up and see what amount of light it optimal for the cam.
    -again thanks for the help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-14 20:39
    You can also add more IREDs to each series string, since their forward voltages will be lower.

    -Phil
Sign In or Register to comment.