I'm trying to run a bank of high-power LEDs from the Arduino (well, actually, an ATTiny85, but prototyped on Arduino and programmed using the Arduino IDE). I'm taking input from a potentiometer and using that to allow the LEDs to be dimmed. I'm using a 2N2907 transistor off of PWM pin because the current coming off the chip isn't sufficient to drive the whole bank of LEDs. It's kind of working, but instead of dimming from off to high, it's dimming from bright to really really bright. Manually setting the pin to 0 or LOW doesn't turn the pin off, just dims it down a bit, though physically removing the wire from pin 2 of the transistor does shut down the LEDs.
It's setup like this:
Pin 1 of the transistor is connected to VIN (9V battery) Pin 2 connects to Pin 11 when using Arduino, or Pin 0 (IC pin 5) when using the ATTiny85, both of which support PWM Pin 3 is connected to ground
I've checked the potentiometer, and am getting the correct expected value as input from it. I've also made sure that the output values I'm sending to the transistor range from 0 to 255. The spec sheet for the 2N2907 seems to indicate it can handle a 9v DC.
I suspect I'm doing something boneheaded. This is my first attempt to use transistors to run something requiring higher voltage and I'm relatively new to hardware and microcontrollers. If anyone has an idea what I'm doing wrong, I'd appreciate being pointed in the right direction (and it's okay to point it out if I'm doing something dumb).
Thanks in advance!