White LED Drive Circuit using Tiny microcontroller

Be Careful About Peak Current
A note of caution: These LEDs are comparatively expensive, so I suggest putting a small resistor (1 to 10 Ohms) in series with the cathode of the LED and measuring the peak current as inferred from the IR drop using either a scope or a peak detection probe (as described elsewhere in these pages) while testing this circuit to be sure you don’t exceed the Manufacturer’s recommendations. In lieu of specific guidance from the manufacturer, for greater reliability try to keep the peak current to half of the manufacturer’s recommended maximum.
A minimum number of parts yields a compact switching converter that can provide sufficient voltage to drive white LEDs. The resulting lamp is much more efficient, in terms of lumen hours per pound of battery, than incandescent bulbs, and because the color of the light is determined by fluorescence of phosphors within the LED assembly, the color of the lamp does not change perceptibly as the battery runs down. As a result, very long battery life is achievable. This circuit is suitable for powering flashlights, emergency lighting, and other applications in which it is desirable to power white LEDs from one or two primary cell batteries using a low cost circuit.
The Circuit
The circuit could not be simpler than this. The transistor, 1K resistor and the tapped inductor form a blocking oscillator. When the power button is pressed, the transistor is biased on through the 1 k resistor. Voltage that appears from the tap on the inductor to the collector causes the voltage on the 1K resistor to be even higher than the battery voltage, thereby providing positive feedback. Also because there is voltage across the inductance between the tap and the collector of the transistor, collector current increases with time (this is in addition to a starting value that relates to the current supplied to the base, but this part of the collector current is rather small. Because of the positive feedback the transistor stays saturated until something happens to change its base current.
At some point the IR drop across the inductor from the tap to the collector approaches the battery voltage (actually battery voltage – VCEsat). As this happens voltage is no longer induced in the winding from the tap to the 1k resistor and the base voltage starts to drop, and this forces the base voltage to go negative, thereby accelerating the switching off of the transistor. Now, the transistor is off, but the inductor continues to source current and the collector voltage rises.
Quickly, the collector voltage gets high enough for the LED to conduct current, and it does for a little while, until the inductor runs out of current, then the collector voltage starts to ring toward ground base voltage swings positive again, turning the transistor on again for another cycle.
The Inductor
If you aren’t designing this as part of a commercial product, you have a lot of latitude in the design of the inductor. The size of the core, its permeability, and its saturation characteristic (Physical dimensions, u and Bs) determine how many amper-turns it can sustain before it saturates. If the core saturates before the IR drop from tap to collector approaches the battery voltage, the circuit will switch quickly anyway because saturating the core makes the coil look like a resistor and coupling between the collector half and the base half (the side with the 1k resistor) drops to very little, so the effect is the same as the IR drop approaching battery voltage. The wire size determines how many amps the circuit will dray (well, ok, milliamps) before the IR drop gets large enough for the circuit to switch. The inductance constant of the core (physical dimensions and u mostly) determine how man microseconds it takes the collector current to rise to the point the circuit switches off, and it also determines how long current will be delivered to the LED when the transistor is off. Nearly every inductor parameter affects the performance of this circuit.
I have made this with ferrite beads a few millimeters in diameter and toroid cores up to a few centimeters across (take a look at the Rust Nail Inductor further down on this page). Here is the general relationship between core size and characteristics:
Large core: Easy to wind, lower frequency operation, higher power.
Small core: Harder to wind, higher frequency operation, lower power.
How to get started: Get a transformer core, preferably ferrite, and wind 20 turns on it. Tap by pulling a short loop of wire off to the side, then continue winding another 20 turns. Increase turns to lower frequency, decrease turns to increase frequency. I’ve used as little as 10 turns, center tapped (5+5) and operated this at 200 kHz. Experiment. Scroll down to the bottom of the page – the tiny ferrite core used in the #222 bulb base run at about 200 kHz.
A Circuit Enhancement
The neat thing about this circuit is that it has the bare minimum number of parts to do the job. The LED runs from pulsating DC and since its forward voltage is higher than the battery voltage, it does not interfere with the switching of the transistor. The drawback is that the peak-to-average current of the LED is pretty high, it could be 3:1 or 5:1, depending on the circuit (mostly on the inductor and battery voltage). If you want the LED to be brighter for a given peak current, you can add the diode and capacitor shown in the schematic below.
Something that one online critic has pointed out is that where space if is available, it is a good idea to add a bypass capacitor between the negative terminal of the battery and the center tap of the inductor. Some batteries have a high impedance, and the decoupling capacitor might serve to increase the output of the circuit. A value of 10 microfarads should be sufficient unless you are using a very high inductance inductor, in which case a larger one might be better.
Where Can You Put the Power Supply?
Since this circuit has so few parts, I was able to make a couple of them so small that I could fit the entire circuit, including the inductor, 1 k resistor, 2N4401 (TO-92 package by the way), rectifier, chip capacitor, and Nichea NSPW315BS along with a little glue to hold it in, into the base of a number 222 incandescent penlight bulb.
Using the LED replacement for the number 222 lamp, allows operation in a compact penlight. It gives enough light to walk outside on a moonless night. Based on about 35 ma currant drain at 1.5V, I estimated operating time, I estimated that this flashlight will operate for at least 30 hours of continuous use. That’s a long time if your holding down the button. Data sheets for several of Duracell’s alkaline cells can be found here.
Even though the battery voltage drops, the color of the light is always a crisp bluish-white. If its taken care of, this light “bulb” should last longer than me. I’ve had this one for 18 months as the latest update to this page and use this flashlight every night. I only had to change the battery twice. If the battery contacts didn’t start to get intermittent from the corrosion, I wouldn’t have know it was time to change the battery since the light was working fine.
LED replacement for the 222 lamp is on the left. The entire power supply is contained within its base.
The hard part was taking apart the #222 lamp so I could reuse the base.
Rusty Nail Night Light
2 rusty nail
These blocking oscillator type power supplies work best with ferrite cores, and sometimes they can be hard to locate. Some readers have expressed anxiety over making inductors, and that is understandable since to many, inductors have an aura of mystery about them.
Just to prove that these inductors aren’t magic, or even that critical for that matter, I wound one on a rusty nail that I noticed laying beside the road one day while waiting for a tow truck. It is a 2-1/2 inch (6.5 cm) long flooring nail, which serves as the inductor’s core.
The wire is a twisted pair of #24 solid copper wire that I pulled from a length of CAT-5 (ethernet) cable, which is similar to the wire used to connect telephones inside buildings. I wound 60 turns of the twisted pair in about three layers around the flooring nail, then I connected the start end of one conductor to the finish end of the other conductor and that made it into a 120 turn center tapped inductor.
I connected it to a 2N2222, a 1K resistor, a 1.5 volt penlight cell, and a white LED. Nothing happened. Then, I put a .0027 uf capacitor across the 1 K resistor (it happened to be on the work bench) and the LED came on. Sometimes you need .001 uf or so. The LED glows nicely and the circuit draws 20 milliamps from the AA cell. The waveform on the oscilloscope looks terrible, but the point is that the circuit oscillated with even this rusty nail, and it boosted the output of the 1.5 volt AA cell to over 3 volts peak to drive the LED.
Those who are familiar with some aspects of coil core selection would quickly point out that the eddy currents would be huge since iron has a low resistance compared to ferrite, or air for that matter, and that there would also likely be other types of large losses.  The point here is not that you should run out and buy some flooring nails to make LED lamps, but that this circuit was not “designed”, but was thrown together and worked quite readily. If a rusty nail and some telephone wire is enough to light up a white LED, then the inductor is not so critical. So, relax, go buy a ferrite core and get started on your project.
For more detail: White LED Drive Circuit using Tiny microcontroller

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top