# Powering a 14v incandescent bulb with Raspberry Pi & Transistors

I am trying to drive 14V #73 incandescent wedge bulbs using a Raspberry PI and separate GPIO pins (which run at 3.3V), combined with transistors, to control them 100% electronically. I understand the concept and why I can't run lights off of the GPIO pins directly, and I have a 14V power supply ready to supply voltage to my lights.

I am trying to learn about transistors and how to incorporate them into my design, but I am having trouble figuring out the values for the resistors in the circuit, and I'm also unsure if I still need to utilize a resistor on the collector line since I am using an incandescent bulb and not an LED. Most/all questions asked in this vein are utilizing LEDs so I don't feel those questions accurately can help my project. The bulb is rated for 14V, but in theory, it can handle fluctuation (gets dimmer/brighter) unlike an LED. It also draws a lot more current, and has more resistance than an LED... because of all of that, can I disregard using a resistor in that line, or is it still a good idea? (I don't think I fully grasp the idea of current/resistance/short circuits)

• What values do my resistors need to be in a circuit like this? How do I determine these?
• Do I still need a resistor on the line for the bulb, despite it not being an LED?

Here is my circuit:

You've chosen a good incandescent bulb with a relatively long life. Here's a datasheet I found at Farnell: Chicago Miniature Lighting. There, find the CM73 entry. You can infer from the data that it is operated at a lower filament temperature than most of the similar choices at $$\14\:\text{V}\$$. (MSCP relates to the "candle power" and it's less than most of the choices there and the expected lifetime is correspondingly higher, as well.)

The above might be important to consider because of the following information on Tungsten: Tungsten Relative Resistivity vs Temperature. Without knowing a lot about incandescents (I'm no expert), I do know that the filaments are typically operated at or below $$\2900\:\text{K}\$$ (sometimes as high as $$\3300\:\text{K}\$$ for photography lighting reasons related to the blackbody radiative distribution of wavelengths.) If I had to guess (and I do), your bulb is probably operated at or below $$\2400\:\text{K}\$$. If you look at the chart, you'll see that this implies about a 12:1 ratio. This suggests that the bulb will have about $$\\frac1{12}\$$$$\^\text{th}\$$ the resistance when cold, as when it reaches a stable and hot temperature.

The reason I said this might be important is that there are times when it's helpful to know these details when designing a circuit. Having to deal with such a wide range of operating currents can mean the difference of one approach over another. In the case of your BJT switch, the collector current is limited (to first approximation) by the base recombination current and the BJT's unique $$\\beta\$$ value. So there is a kind of self-limiting taking place with the BJT switch, though just how much limit there is will depend on the individual BJT itself.

An easy way to insert some negative feedback (opposition) into the circuit is to add an emitter resistor. If the current pulses really high, then the voltage drop across the emitter resistor will act to reduce the base-emitter voltage and that will reduce the collector current in response. Then, as the current requirements decline the resistor will have a smaller voltage drop across it, allowing the BJT to act more like a switch and supply the desired collector current. It's cheap and easy.

With perhaps 12:1 current variation as it warms up (assuming no managed limits were added to your circuit), adding this emitter resistor can do a good job of limiting the cold-start current without limiting the warm operating current.

So let's look at a circuit:

simulate this circuit – Schematic created using CircuitLab

There are other considerations to get to (mostly about dissipation.) But let me walk you through my thinking process here:

1. I know that $$\80\:\text{mA}\$$ (operating at temperature) is a collector current that most small signal BJTs can handle, continuously. So this opens the door to a smaller BJT, which is nice.
2. For selecting an emitter resistor, I want one that won't drop too much voltage when running normally with $$\80\:\text{mA}\$$ but I also want one that will drop enough voltage at significantly higher currents that the BJT will be almost off. A small signal BJT in this context is almost off when the base-emitter voltage is about $$\600\:\text{mV}\$$ (though with larger BJTs that might be closer to $$\500\:\text{mV}\$$.) So let's use the smaller figure of $$\500\:\text{mV}\$$ for off.
3. The base recombination current is usually chosen to be $$\\frac{1}{10}\$$$$\^\text{th}\$$ the collector current so that the BJT acts very close to a switch behavior. ($$\V_\text{CE}\le 200\:\text{mV}\$$, not uncommonly.) You can almost always get by with less than that -- though again with larger BJTs designed for more current the situation is a little different. Given that you are using a Raspberry PI, it can probably handle the implied $$\8\:\text{mA}\$$. But there are port limitations, too, and I think we should design this for a base recombination current of $$\5\:\text{mA}\$$ to avoid other complications. It's likely to be sufficient because it uses $$\\beta=\frac{80\:\text{mA}}{5\:\text{mA}}=16\$$. Experience tells me this is probably fine.
4. At $$\3.3\:\text{V}\$$ on your I/O pin and an expected source current of $$\5\:\text{mA}\$$, I would expect to see something like $$\3.3\:\text{V}-5\:\text{mA}\cdot 70\:\Omega\approx 3\:\text{V}\$$ at the loaded I/O pin, itself.
5. I'd like to see the emitter resistor drop no more than about $$\200\:\text{mV}\$$ at an operating $$\80\:\text{mA}\$$ for the bulb. So this suggests $$\\frac{200\:\text{mV}}{80\:\text{mA}}=2.5\:\Omega\$$. Let's use a nearby (and slightly lower) $$\R_1=2.2\:\Omega\$$.
6. The base resistor should be $$\R_2=\frac{3\:\text{V}-900\:\text{mV}-80\:\text{mA}\cdot 2.2\:\Omega}{5\:\text{mA}}\approx 390\:\Omega\$$. The $$\3\:\text{V}\$$ comes from the calculation at step 4. The $$\900\:\text{mV}\$$ comes from my experience guessing about the base-emitter voltage required for a collector current of $$\80\:\text{mA}\$$ in small signal BJTs.

The remaining question is what happens when the bulb is cold and is it worth the bother putting that emitter resistor in place. The base recombination current as a function of lamp current is probably the best way to examine this circuit. I'll use a very simple, fixed value for the base-emitter voltage of $$\V_\text{BE}\approx 700\:\text{mV}\$$ as a broad estimate that covers a lot. (The base-emitter voltage will change by about $$\60\:\text{mV}\$$ for each 10-fold change in collector current and the 12:1 ratio for the lamp suggests that in the worst case we'd see perhaps $$\60-70\:\text{mV}\$$ variation of the base-emitter voltage over the entire range of currents possible for the lamp. So we can ignore it, as it's small.)

The formula for the base current can then be approximated with $$\I_\text{B}=\frac{3\:\text{V}-700\:\text{mV}-I_\text{LAMP}\cdot 2.2\:\Omega}{390\:\Omega}\$$ and assuming that $$\I_\text{E}\approx I_\text{C}\$$ for simplification purposes, we find that the transistor must provide $$\\beta=\frac{I_\text{LAMP}\cdot 390\:\Omega}{2.3\:\text{V}-I_\text{LAMP}\cdot 2.2\:\Omega}\$$. For a switch, it's almost certain that this value must be at or below about 50. (That's if you are lucky. It's likely even less than that.) This turns into $$\I_\text{LAMP}=\frac{2.3\:\text{V}}{2.2\:\Omega+\frac{390\:\Omega}{\beta}}\$$. Estimating a saturated $$\\beta=50\$$ gives $$\I_\text{LAMP}\le 230\:\text{mA}\$$. Estimating a saturated $$\\beta=30\$$ gives $$\I_\text{LAMP}\le 150\:\text{mA}\$$. And even if you happened to get a saturated BJT with an unlikely high $$\\beta=100\$$, that would only give $$\I_\text{LAMP}\le 375\:\text{mA}\$$.

So as you can see this does seem to perform nicely. It limits the cold start current while still allowing normal operation once the bulb has fully warmed. The slight downside is that this adds a little overhead to the BJT switch, leaving just a slightly smaller voltage left over for the lamp. I don't believe the loss of a few hundred millivolts is enough to be any problem with a $$\14\:\text{V}\$$ bulb, though. So I'd give that a go and see.

If I have understood it correctly, when the bulb is powered from a 14V source it drains automatically 80mA from it due to impedance of the bulb itself. If this is correct, I would suggest the following:

Firstly, I would check if the transistor can manage 80mA on the collector (you can check this easily on the datasheet). If this is the case, then I would start removing the resistor that is between the 14V power source and the bulb to make it work on its full capabilities.

Now, what you want is a turn on/off operation that should be controlled from the base terminal from the Raspberry-Pi, and that will be conditioned by the other resistor. When talking about transistors (and more precisely with BJT as the one of your schematics), this means we want to make the transistor switch between the cut-off state and the saturation state.

In the cut-off region, the transistor will not drain current from the collector and the bulb will be turned off. This is easy to achieve just by driving 0V from the raspberry, therefore no current goes into the base and the transistor is inactive, so the base resistor is not a problem. However, in this state the transistor will hold the 14V of the power source between the collector and the emitter, so check the datasheet to be sure that it can do the job without burning.

In the saturation state, the transistor will drive all the possible current on the collector and the voltage drop between the collector and the emitter will be almost 0V (0.1V - 0.3V depending on the real transistor). So the bulb will take those 14V and turn on. The thing is that you have to make that 80mA that your bulb needs become the saturation current for your transistor. Since the collector current is the base current times the gain of the transistor, divide the 80mA with that gain. You can check the value of the gain on the datasheet but it may differ a lot because of manufacturing stuff, so if you can use a multimeter capable of measuring the gain it would be better. A better approach to be sure it gets saturated, it is to use the minimum rating for the gain on the datasheet instead of the typical one or the measured one. Now that you know the base current needed, you can calculate the resistor needed to get it from the 3.3V of the Raspberry. If that current is Ib, a good approximation could be (3.3 - 0.7)/Ib , because the transistor will have a voltage drop between the base and the emitter, which is typically around 0-6V - 0.7V for silicon devices. Any resistance below that calculated value will be ok to saturate the transistor. Again, check that the final base current after choosing the real resistor can be driven by the transistor so it won't get damaged.