Go Down

Topic: Powering LEDs using transistors controlled by arduino mega (Read 1 time) previous topic - next topic

Getronicle

Jan 14, 2013, 08:21 pm Last Edit: Jan 14, 2013, 08:53 pm by Getronicle Reason: 1
Hi, hope this is the correct place to put this, this is my first post :)

I'm not new to electronics but I'm new to arduino and what it likes/doesn't like. I'm looking for some advice regarding using transistors to switch current from a 9V battery to groups of 4 parallel LEDs. There are 25 groups, so 100 LEDs in total (think of it as a 5x5 matrix, where there are 4 LEDs for every 1). Each group will be switched by its own transistor using an arduino mega.

This schematic shows 3 of these groups to give you an idea:


I know it's not good practice to use only one resistor to limit the current going to parallel LEDs, but it works and the resistance is enough to prevent a single LED blowing.
Using a 9V source and a 360 ohm resistor each LED receives 6.25 mA of current. If all LEDs are on at once, a current draw of 625 mA from the battery will be required. I am willing to add another 360 ohm resistor to each group to lower the current as the brightness of the LEDs does not suffer too much when I do this.

I plan on using 2N2222 NPN transistors which have a beta value of ~100, so what I want to know is:
- What base current would be required from the arduino to provide an emitter current of 25 mA (from the battery)?
- Will the arduino be able to provide enough current to all pins so that 625 mA will be drawn at once? (I will be using a pin for each transistor as I will not be multiplexing). In the case that I double the resistance of each group from 360 to 720 ohms, the max current will be 312.5 mA.

Am I going in the wrong direction completely?
I would really appreciate any help any of you could give me, thanks :)

Edit: I have just realised my schematic is slightly off - the LEDs are connected correctly in reality.

jerseyguy1996

The way you have drawn that, the Cathode and Anode are at the same potential so no current will flow through the LED's.
Arduino Uno;
Mega328

HazardsMind

Whos schematic is that? The LEDs are wired wrong, they are shorting themselves out. Fix their wiring, it should be:

    from transitor
              |
  | -|<| --|
  | -|<| --|
  | -|<| --|
  | -|<| --|
  |
gnd
Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Getronicle

#3
Jan 14, 2013, 08:47 pm Last Edit: Jan 14, 2013, 08:54 pm by Getronicle Reason: 1
Yeah I just edited my post, I drew the schematic quickly and made the mistake. Apologies.

Edit: I've modified the schematic to match the correct configuration.

LarryD

Put the LEDS and R1-3 before the collectors.
Emiters go to ground.
The way you have it in your schematic isn't the same as how you have it wired up!

Go Up