Skip to main content
1 of 6

Circuit that can support Incandescent or LED bulbs

I have a project using an ESP8266 to control a lamp socket. In very simple terms the sketch switches the lamp socket on or off based on some conditions. The sketch works fine. What I would like to be able to do is put into the lamp socket either a 3V 120mA incandescent bulb or a 3V 1mA LED bulb. The ESP8266 can easily drive the LED directly but of course can't drive the incandescent bulb. So, I added a 2N4401 transistor into the circuit with the ESP8266 controlling the base of the transistor.

The problem is that the base resistors required vary dramatically. My calculations indicate the incandescent requires 383Ω while the LED requires 4.6KΩ. However, in practical testing, the incandescent requires 1KΩ to completely shut it off (much less than that and the incandescent will slightly glow when the pin connected to the base is low--i.e., off) yet fully saturate the transistor--i.e., fully on.

Strangely the LED will not shut off fully even with a 20KΩ resistor while at this level of resistance on the base, the incandescent barely lights.

So, using a standard BJT NPN transistor is not going to do the trick. I was thinking maybe a Darlington transistor or MOSFET might be a better solution. However, I have never worked with either (although I have done a bit of reading on both). Any suggestions would be greatly appreciated.