So far all of my projects have been powered using linear regulators, batteries, or at most a few easy to handle switching regulators, I have designed linear power supplies in the past which are pretty straight forward but I have never felt the need to design a switching power supply until very recently, this post will discuss how I went from knowing only the theory behind a switching supply to actually designing one which serves the purpose.

Well I must admit, when it comes to electronics, power is not my strongest side, up until now I was powering my NiMh charger prototypes with an external 24 volt power adapter which I never wanted to be part of the final product, it goes without saying that an integrated 24 volt switching supply was needed so the project could be powered off the AC mains directly that could feed the necessary current to the battery, the switching power supply needed to supply at least 2.5 Amps to do the job properly.

The problem? I had never tried my luck with an SMPS before which increases the likelihood of things blowing up significantly. I had a couple of IR2153 chips and a few IRF840 MOSFETs in my stack but I was delaying this until the very end. When you talk about SMPS supplies it offers certain benefits over your regular linear power supplies, first of the size as it eliminates the need to use bulky iron core transformers and instead uses light weight high frequency pulse transformers and secondly the efficiency of the design.

The Switched Mode Power Supply Working Principle

The SMPS can be implemented using several of the available topologies that suit a wide variety of power output needs, however for this particular design we will be implementing a half bridge topology and discuss its working principle.

The basic SMPS block diagram (Courtesy google images)

The simple block diagram above shows that the switched mode power supply can be divided into a few basic sections, the AC mains are rectified directly using a bridge rectifier and energy is stored in a capacitor bank, the inverter then converts DC voltage into a high frequency AC which will be stepped down using a high frequency transformer, this high frequency AC conversion is where the two MOSFETs will be connected in a half bridge configuration which gives the topology its name, the stepped down AC voltage is then rectified again using fast recovery diodes and the output voltage is finally filtered through an LC filter. Regulation can be added to an SMPS when some part of the voltage is fed back to the inverter control chip to regulate the duty cycle or like in our case implement an ON OFF control through an isolated feedback using an optocoupler.

An ATX Supply Transformer & the IR2153 MOSFET Driving Chip

I decided to keep things simple, since finding a high frequency transformer with known parameters is almost impossible in this part of the world therefore I decided to salvage a transformer from an old faulty ATX PC power supply. However I must mention there are tons of tutorials available online which can help you to wind up your transformer catering to your personalized design needs.

Winding configuration on my ATX transformer (courtesy

This particular ATX transformer  has a single primary and two secondary windings, one winding is used for the DC 5 volt rail which is capable of delivering a current of 22 Amps and the other for the 12 volt rail that could deliver up to 6 Amps as per the rated specs for this particular supply

Rating of the ATX supply

So the 12 volt rail can supply up to 72 watts of power, as a rough estimate 72 watts of power with an output regulated voltage of 24V can supply a current of around 3 Amps which is just over whats required for the charger application, one important thing to mention is that the transformer peak voltage on the transformer 12 volt output winding is around 50 volts, so this voltage can easily be rectified  and then regulated to get a stable voltage of 24 volts, but in order to get 134qa proper voltage output the transformer primary first needs to be fed with an alternating voltage of the right frequency, for this two transistors are used in a half bridge configuration as shown below.

Stage1 – FET Q1 is ON & Q2 is OFF
Stage2- FET Q1 OFF & Q2 ON

As shown above the transistors Q1 and Q2 are turned ON and OFF to produce an alternating voltage across the transformer primary, in order to drive the transistors on the high voltage side the IR2153 MOSFET driver is used.

The IR2153 configuration

The frequency at which the half bridge is to be driven can be selected by a suitable combination of the resistor and capacitor connected between RT, CT and CT, COM respectively. Since the salvaged transformer from the ATX power supply comes without any specs therefore the ATX circuit had to be analyzed to determine what frequency it was designed for.

Looking around the circuit and after going through the datasheets for the chips installed I came across the DBL494 chip which drives the half bridge in the SMPS, the resistor and capacitor combination on pin 5 and pin 6 of this  particular chip indicates that the transformer was supplied with a frequency of round 22KHz.

DBL494 chip on the ATX power supply

The shutdown feature on the IR2153 can be used to regulate the voltage at the output of the power supply, for this a TL431 regulator will be used to give isolated feedback through an optocoupler to the IR2153 telling it to stop switching the MOSFET’s once the output voltage of 24volts is reached.

The Circuit

Below is the circuit diagram I put together using the easy EDA design tool, not the best but is at least on a more acceptable level as compared to my hand drawn schematics.

schematic has been updated after some flaws were pointed out

I understand the above schematic might be a tad difficult to see clearly, just in case, you can see a PDF file here which should be easy to make out.

Reducing Ringing and Inductive Spiking

The schematic shown above has nothing new to be honest, in fact many variants of the same circuit are available online, however what those designs don’t address is the real world issue of ringing and inductive spiking that an SMPS is prone to, during my testing with an un-damped SPMS it was virtually impossible to use this power supply in conjunction with a micro-controller based system as the noise on the output causes frequent resets of the controller. At this point I started reading about techniques to suppress these unwanted effects at the output of the power supply and I cam across the relatively simple solution of RC snubber.

High Frequency Ringing

The above picture illustrates a switching cycle from low to high and then high to low, however the transition is not smooth, instead there are high frequency oscillations which settle out after a while, this is what is known as high frequency ringing and is present at the primary and secondary side of the transformer as well. This results due to the parasitic capacitance of the switching element forming an oscillator with inductive nature of the transformer windings. The ringing frequency as evident from the above picture is several times higher than the designed switching frequency of the oscillator. As in my case for a designed switching frequency of around 22 KHz the ringing frequency at the transformer primary and secondary was 4.8 MHz and 18.6 MHz respectively when probed with an oscilloscope. However knowledge of the ringing frequency is an important info to have as it helps us determine the value of the resistor in the RC snubber network which will be placed in parallel to the transformer windings.

There is an excellent technical document by Texas Instruments covering the subject in great detail, if you want to check it out click  Here

The RC snubber greatly reduces ringing and inductive spiking reducing the overall noise in the system and can now be easily used with a micro-controller based system.

The waveform with RC snubber

Good Layout Bad Layout

Working with perf boards and laying out the smps components can give rise to some serious issues that can easily be overlooked and can result in unwanted noise on the output of the power supply and even issues with MOSFET’s shorting out.

After having shorted out a good handful of IRF840’s I realized this fact the hard way, a few important points to consider while laying out the parts and routing the tracks are,

1- Identify the current loops and keep the board covered area for each current loop as small as possible, this goes specially for high power switching current loops.


2- Avoid connecting the control circuitry to dirty ground, the control circuitry in this case is the IR2153 chip and the TL431,  the dirty ground is in between the closest capacitors before and after the switching part of the circuit.


3- Keep the dirty ground trace as short as possible and avoid routing it all over the perf board, also it is highly important to avoid mixing dirty ground with clean ground.


4- If the power lines have to travel to a certain length on the perf board the +ve and -ve tracks should be routed close as differential pairs.


Following these general guide lines one can be assure of a clean and workable design on the project boards.

Safety Considerations and Conclusion

When dealing with direct AC mains and unpredictable loads I highly advise to use a series safety bulb of around 200 watts when powering your projects as this would  prevent components from exploding, saving you from potential injury in case of a short circuit.

Trust me when I say this…..

Finally here are some pictures of the final circuit which isn’t all that dangerous to work with,



This has easily been the most frustrating part of the entire universal NiMh charger project as it took many trials and errors before a respectable performance of the SMPS was achieved, however I am late with my blogging, it’s been a while since I completed the SMPS and instead of posting an update I decided to continue working on the charger itself as a final push to complete the prototype, I am quite excited as I have figured out all the remaining issues with the charger and will be posting soon on the finished final design.

I have been getting a lot of views from all around the world and this is highly encouraging, I thank you all for your interest in my efforts, if you found this helpful please like and share my blog.



Leave a Reply

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

You are commenting using your 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