diodes in series would reduce the voltage enough to be
close to 12 at ~13V. Each diode is a drop of approximately
0.6V for a total of a 1.8V reduction. A bit of power would
be wasted in doing this.
Of course, with another cell, the charging problem
is more complicated. I’d give it a try at three first and see
A Big LED on a Pi
QI worked my way through a Raspberry Pi / Python demo on blinking an LED. Now, I’d like to control a 3W LED. Is there a simple way to do this?
AA 3W LED requires some current. Let’s see how much. LED voltage drops are usually around 3.4V. We’ll use the Ohm’s Law equation for
power to solve for the current. Since P = V x I, we can
rearrange this equation to say P/V = I. The result is 3 /
3.4V, or approximately 880 mA. That’s much more than
a Raspberry Pi can supply. That means we need a simple
We’ve talked about circuits like this before in this
column, and they’re pretty simple to make with a single
transistor. We just have to make sure that the transistor
we use can handle the current we need (which is close
to 1A) and has enough gain. We also need to choose an
appropriate current-limiting resistor since we’ll be running
the transistor into saturation, where it acts more like a
switch than a current source.
I’ll assume we have a 5V power supply available for
the LED, though the calculations could be revised for a
different voltage. The circuit is shown in Figure 3. R1 is just
to limit the base current for the transistor. R2 limits the LED
current. I’ve chosen a TIP33 as the final transistor. It has a
maximum collector current of 10A — significantly beyond
the required 800 mA. The datasheet indicates that the Vce
at saturation is about 1V max for 3A, so let’s assume a little
less at around 0.8V. We’ll need approximately 300 mA
base current to be well into saturation. That’s a problem
because our Raspberry Pi can’t supply that much current.
We can solve this by using a Darlington configuration:
one transistor to drive another, multiplying the current
through each device. We’ll use a 2N2222 to drive the
TIP33. To make a Darlington turn off effectively, we include
a resistor to drain charge from the base of the second
transistor. That is R3. It just needs to allow for a little
current flow at 0.6V - Vbe. I’ve randomly chosen about 100
ohms to give a 6 mA drain.
Let’s calculate our current-limiting resistor. If the LED
has a 3.4V drop, our saturation Vce is 0.8V; that leaves
about 0.6V for a 5V supply. We want around 800 mA, so
since V = IR or V/I = R, R = 0.8 / 0.8, or about one ohm.
If the supply were different, the value would have to be
recalculated using the new supply voltage.
Lastly, we need to figure out the base resistor, R1. The
Pi nominally gives us a 3.3V signal when it’s in the high
state. We probably only need about 10 mA to drive that
base. The Pi can deliver 16 mA max, so that should be
We have quite a large amount of current multiplication
(2N2222 at 30 and TIP33 at 15 worst case, so 30 x 15
= 450). That means 10 mA is good for several amps. To
get 10 mA from 2.1V ( 3. 3 - 2 x 0.6V), we use V = IR to
calculate ~210 ohms. Conveniently, the EIA value of 220 is
pretty close for R1. The values are annotated in Figure 3.
One thing to keep in mind about this circuit is that it is
inverting, so writing a one to the I/O port for that pin will
turn the LED off; a zero will turn it on. NV
n FIGURE 3. Raspberry Pi driver circuit for a 3W LED.
QUESTIONS and ANSWERS
10 December 2017