LED Light Replacement for AC Halogen Lamps

LED based home lights are becoming more and more common each day due to their higher efficiency, and their price is starting to fall to an affordable level. Most commercial AC LED lights on the market are meant to replace 230V E27 lamps, as that socket is big enough to fit an AC/DC converter inside.

I have recently found myself with some floor and roof halogen lamps that I wanted to convert to LED, but I wasn’t able to find a commercial replacement for the 12V AC powered G4 lamps and I did not want to replace the power supply, so I decided to run my own design!


This project is a small LED based lamp designed to replace AC halogen bulbs, and to fit in a small 3cm diameter PCB.

Power Source

The main requirement I had for this project was that the LED lamps needed to run from the standard AC/AC converter used with the normal halogen bulbs. This type of electronic transformerless converters has an output waveform that is less than ideal to build a rectifier and which varies a lot depending on the implementation and the load.

This is an example of a waveform from one of my lamps with the dimmer set at a low level:


The waveform looks like an high frequency AC signal modulated on mains voltage, so that the low frequency repetition is actually 100Hz (in countries where mains is 50Hz) with a maximum peak value of about 15V.

As for the high frequency oscillation, the actual frequency seems to be related to the load, and on the converters I tested it seems to range from 20 to 40kHz.

This is a detail of the initial AC transient for the above waveform:


One detail on this type of transformers is that they require a minimum load in order to start oscillating, which means that you have to either add a bleeding power resistor, or keep at least one of the standard halogen lamps in the system as a ballast.

In my case I have 6 sockets per transformer, and I had to keep the standard lamp in one of them.

Rectifier Circuit

Despite the unusual power waveform, the frequencies are slow enough to be rectified with a standard diode bridge.


After the rectifier, you would be tempted to put a big capacitor to obtain a smooth DC waveform, but when I tried to run the lamp with 44uF filtering caps, this resulted in a lot of mains hum, possibly from the lamp cables or the light socket itself. This is probably a consequence of the input current waveform obtained by the diode-cap filtering circuit, as it resembles a series of spikes at the rectified frequency. See this link for more details.

In this case, as the LEDs do not really care much about the power waveform, the solution was just to remove the filtering capacitors altogether.

Choosing the LED

When choosing the LED, the key parameter is the color temperature and for home usage a warm color is preferred. A good reference for that is 2700K for incandescent bulbs, 3000K for halogen and 3500K for CFL bulbs.

After the color temperature, the LEDs should be compact, highly efficient, and usable on a standard 1.6mm FR4 PCB.

The LEDs I used are a CREE XLAMP XH-G, in the HWE7 variant, with a color temperature between 2600K and 3700K and a nominal flux of 23.5lm at 65mA. The LED has a 130 degree viewing angle and comes in a 3x3mm reflow solderable package with the thermal pad shared with the cathode.


The downside of this LED is that the contacts do not extend to the package sides, so it requires solder paste and hot air to mount, but at least the pads are big enough that solder can be dispensed by hand, without using a stencil.

After choosing the LED, you need to decide how many of those you want to mount on each lamp. As I wanted to obtain a light flux similar to the one of a 100W incandescent light, which should be about 1200lm, I went for 9 LEDs on each board, that translates to 27lm per LED if 5 boards are used. The LEDs are wired as 3 parallel strings of 3 LEDs each, so that the voltage drop at the nominal current (65mA) is a bit less than 9V. The input circuit will run up to more than 15V, so that would allow for some degree of regulation.

The LED strings are going to be driven by a linear regulator in current limit configuration, so I tried to calculate an initial approximate set-point for the current limit while ignoring the input voltage waveform (too complex and variable with the load) and power dissipation (it’s easier to do practical measurements). What I had in mind was to find a reasonable value and then do the tuning on the prototypes.

In this case, starting from the nominal flux of 23.5lm at 65mA, you need to account for the desired flux plus some derating due to the temperature (there is a characteristic curve in the datasheet), and raise the current accordingly.


(images from XH-G datasheet)

The flux vs current characteristic is quite linear, so the resulting approximate value for me was about 90mA per string, so 270mA for the three string parallel.

With the average value, it should be possible to calculate the exact value to be set on the regulator accounting for the input waveform, LDO dropout and input voltage waveform, but I decided to just use the average value and use the practical circuit to see the result.

Driving Circuit

The LED driving circuit is just a linear regulator (LD1117) in current limit mode, with the idea that the driving waveform should just follow the input one (less the regulator dropout) until the resulting LED current reaches the set point. After that the excess voltage is just absorbed by the regulator.

This is the actual schematic of the circuit – again, the filtering capacitor has just been left out on the PCB.


After mounting and powering up the LED module, this is the resulting waveform:


Here the yellow waveform is the input voltage, while the red one is the voltage after the regulator. You can tell that the high frequency oscillation is still present after the rectifier and regulator, but the regulator is doing its job in limiting the output voltage to the specified set-point: while the yellow waveform envelope tries to follow the input sine waveform, the red one is clamped at about 10V. Also, the current seems to be able to reach the set point for approximately 70% of the input cycle, which means that the current set point can be increased accordingly.

Color LEDs

In addition to the white LEDs mounted on the top side of the PCB, the circuit also spots two strings of colored LEDs, just as a finishing touch if used with an appropriate light cover.

The circuit is the same as the white one, just with a lower current set point.


That’s a picture of the bottom of the board, with the rectifier, regulators and color LEDs:


Final Result

This is a picture of the final fixture for my lamp:


Inside the white element I took a measurement of the top side of the PCB at about 85 degree with 20 degree ambient temperature. This is a bit high, but may be acceptable as the light is used only for a few hours a day.

Design Files

As usual, my design files are available on GitHub.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s