For my project I need to power a .3W LED with an Arduino pin. I am powering this LED with a 2n2222 transistor with the collector connected to a 6v battery (the battery is also powering the Arduino) and the base to a digital pinout of the Arduino with a 330ohm resistor. The problem I am having is that the LED is significantly dimmer when controlling the base pin of the transistor with the Arduino than with the battery power.
I am not to familiar with transistors but I though the gain was dependent on the current not on voltage. So the transmittor should be fully saturated and allow almost all current through just by the current provided by the Arduino Digital Pin. Where did I go wrong in my assumptions?
I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.
Section 2.7 Calculation of a Saturated Transistor Circuit
For my project I need to power a .3W LED with an Arduino pin. I am powering this LED with a 2n2222 transistor with the collector connected to a 6v battery (the battery is also powering the Arduino) and the base to a digital pinout of the Arduino with a 330ohm resistor. The problem I am having is that the LED is significantly dimmer when controlling the base pin of the transistor with the Arduino than with the battery power.
You have the transistor in the wrong place, it needs to go below the LED with the emitter connected to GND.
Reason: The transistor emitter needs to be a 0V compared to the Arduino pin. When it's above the emitter you don't know what voltage it's at.
jbarchuk:
I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.
Section 2.7 Calculation of a Saturated Transistor Circuit
jbarchuk:
I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.
Section 2.7 Calculation of a Saturated Transistor Circuit
CrossRoads:
I fixed the connection to the transistor but I still can't get full power from the Arduino pin. The transistor is only allowing 18 mA when I connect the base to the digital output of the Arduino but it allows about 90mA when the base is connected to 6+ volts.
Fungus:
Ah that makes sense, Thanks! However, I'm still not getting all the current through the resistor. Ideally, I just want it to act as an off & on switch.
Actually, cross that. I got over exited and thought it was PWM. For some reason the Digital Pin on the arduino was only sourcing .8volts when under load. Odd thing is I'm using 4 AAA batteries which source over 1A and the ardunio with the LED on is using 65 mA.
I though I was becouse kept calling DigitalWrite and when I ran the Blink code the light lit up all the way to full brightness. I was wrong and that is not the case though.