I'd like to use a PICAXE to switch a few 2N2222's powering a string of 4 series LEDs on and off. I figure I'll need to add transistors used as switches so I can use the source's full 12v to drive the LEDs (PICAXE runs on a regulated 5v so I can't use it's output to drive more than 1-2 LEDs).
Here's the basic idea (the other 3 PICAXE outputs would also be wired to the same components as output0):
The issue I'm having is, this works fine with the 2N2222 when it's connected to one LED, but once I add a few more they won't light. I'm basically guessing at what the transistor's base resistor value should be--it doesn't seem to matter what resistance is used. (I've through most of the book Make: Electronics, but I didn't grasp transistor fundamentals well enough from it.)
The LEDs I'm using light fine from my 12v source when wired with a simple 100 ohm resistor. (I believe the Vfs are 2v red, 2.5v green, 3v blue, 2v yellow or so. Maybe they need to all have the same Vf per string?) Any ideas what I'm doing wrong here? How do I calculate the resistor needed for the transistor's base?
r = (e / i), so r = (5v / .002A) to get .020A out of emitter, therefore r = 2500ohm?
I think I'm screwing something up there, maybe because I'm ignoring the 100ohm resistor connected w/LEDs in series.
Since this is basically an office mini-tree Christmas project I want to minimize wiring as much as possible, that's the main driver behind using LEDs in series rather than parallel (well, I want to avoid the extra resistors too). Also I realize I could do something very similar with 555 timers (and I still may) but I figure a programmable PICAXE will be a cooler conversation starter around the office.
Here's the basic idea (the other 3 PICAXE outputs would also be wired to the same components as output0):
The issue I'm having is, this works fine with the 2N2222 when it's connected to one LED, but once I add a few more they won't light. I'm basically guessing at what the transistor's base resistor value should be--it doesn't seem to matter what resistance is used. (I've through most of the book Make: Electronics, but I didn't grasp transistor fundamentals well enough from it.)
The LEDs I'm using light fine from my 12v source when wired with a simple 100 ohm resistor. (I believe the Vfs are 2v red, 2.5v green, 3v blue, 2v yellow or so. Maybe they need to all have the same Vf per string?) Any ideas what I'm doing wrong here? How do I calculate the resistor needed for the transistor's base?
r = (e / i), so r = (5v / .002A) to get .020A out of emitter, therefore r = 2500ohm?
I think I'm screwing something up there, maybe because I'm ignoring the 100ohm resistor connected w/LEDs in series.
Since this is basically an office mini-tree Christmas project I want to minimize wiring as much as possible, that's the main driver behind using LEDs in series rather than parallel (well, I want to avoid the extra resistors too). Also I realize I could do something very similar with 555 timers (and I still may) but I figure a programmable PICAXE will be a cooler conversation starter around the office.