A cycling and flow of knowledge and ideas.

Friday, 9 May 2014

Circuit analysis of typical electronic transformer

Self-starting half bridge oscillator schematic
Self-starting half bridge oscillator schematic
In this post I will go through the analysis of the design of the basic electronic transformer commonly used to provide the 12v power for halogen lighting.  Specifically the design of the common self-starting half bridge oscillator circuit.  I will not go into the actual calculation of values of the components but more why the circuit is arranged as it is and the purpose of each component within the circuit.  Looking at the final schematic of the circuit is quite daunting but it's really an elegantly simple circuit to explain. Understanding this will open a world to you, as you will see elements of this circuit built into so many other circuits, such as internally to drive LEDs and CFLs. By the end of this post you should be conversant in the design considerations of this particular circuit.


Basic overview of an Electronic transformer

What is an H-Bridge and what does it do?

What is a Half Bridge circuit?

How does a Half Bridge circuit work?

How hoes the oscillator function?

How is the oscillator initialised or triggered?

What is a bridge rectifier?

Why is there a noise filter and what is it for?

Additional protective components

Basic overview of an Electronic transformer

In my previous post Transformers, Electronic transformers and switch mode power supplies I discussed their differences and touched on each of their operations. It is useful to understand what their differences are, if only to defend yourself from the pressure of a sales man, "giving it large."

There are many ways to generate a higher frequency but the method most commonly used is an elegant circuit called a self-starting half bridge oscillator circuit. The core active components are two power transistors which switch alternately the rectified mains through the output transformer.  The arrangement of the transistors is where it gets the name "half bridge" from. It is only one side of an H-bridge and on the other side are two capacitors.  Here is a block diagram showing a black box schematic of the internal working building blocks of the electronic transformer. I have taken the liberty of hyperlinking the components within the diagram. If you can't wait and want to jump to that particular section in this article please click on the required block.

Black box model of electronic transformer
Back box model of electronic transformer

Mains noise filter. Bridge rectifier Self exciting oscillator Half Bridge driver

Don't panic!  The, "self-starting half bridge oscillator circuit," is an elegantly simple circuit and it turns up, in slightly modified forms, in many situations, such as electronic ballasts for fluorescent lights.  If you can follow the following logic in the post below, you will be able to stun your friends with your expansive knowledge.  Though be warned, do not use this new found knowledge on an electronic engineer as they will probably be sufficiently interested to ask awkward questions potentially torpedoing the illusion you've just created.

What is an H-Bridge and what does it do?

Understanding the operation of the "H bridge" circuit will make the understanding of the "half bridge" circuit simpler.  Fortunately it is a very simple concept.  Essentially it is used as a method to drive a Direct Current (DC) motor forward and backward by using a switch arrangement from a single sided  DC source. The "H" in the H bridge is not an acronym or abbreviation but literal representation of the wiring schematic.  As you can see below it look a bit like a capital letter "H". Essentially it is four switch arrangement that allows the routing of current through a load, most commonly a DC motor. The reason for the term, "bridge" in its name is, I believe, because it sits between the positive and negative DC power rails.

Basic schematic of H-bridge circuit showing 4 switches and motor
H-bridge circuit with 4 switches and DC motor

This arrangement allows for switching of the DC current enabling the motor to run forwards and backwards. Each switch needs to switch in opposite pairs to change the path of the current through the motor as shown in the diagrams below.

Current path through pairs of switches allowing control of motor direction
Current path through pairs of switches allowing control of motor direction

So no drama there!  Rather than using mechanical switches such as relays, it is possible to use solid state switches such as transistors arranged in the same way.
  • Solid state meaning it is a physical component with no moving parts.
As this circuit is going to be used to power a transformer which is used to supply a low voltage halogen, I will also show in the following diagrams the motor replaced by a schematic representation of a transformer and light bulb.  The H-bridge was designed to carry high current through a DC motor enabling it to be driven in both directions. It is not difficult to see how this circuit can be used to drive a transformer as the transformer requires an alternating current.

H Bridge circuit with solid state switches with different loads
H Bridge circuit with solid state switches with different loads

The H bridge circuit is only explained simply in this post but it does offer more advantages than just running a DC motor forwards and backwards, such as inductive breaking but an explanation of that is beyond the scope of this post.

What is a Half Bridge circuit?

The energy requirements of the transformer are far more modest and for a combination of cheapness and the effect of limiting the energy able to pass through the transformer, two of the transistor based solid state switches can be replaced by capacitors.  As it is no longer the full "H" it is now called a "Half bridge" circuit.

Half bridge circuit schematic with output transformer and light
Half bridge circuit schematic with output transformer and light

This arrangement has the added effect of:
  1. Halving the complexity of the control circuitry because it only needs to control two switches rather than four.

  2. It stops the transistors being damaged when the circuit is not oscillating, as the other end of the transformer is connected to two capacitors which naturally block the DC current path.

  3. It stops excessive current consumption as there is no direct current path between the power rails.

  4. Excess unused energy in the transformer is recycled into the caps and doesn't try and damage the transistors.
The capacitance of the capacitors is only sufficiently large to hold the energy of any one cycle and so does not cause non-linear rectified load power factor issues.

  • I wrote an article on power factor and explained the two types of power factor.  The type of power factor the electronic transformer would have is the non-linear rectified load type where there is a power spike causing excessive harmonics.  As the capacitance is small and the charging and discharging happens on each cycle at between 20 000 to 100 000 Hz this power factor is near undetectable.

How does a Half bridge circuit work?

I have made the following diagrams to help illustrate the way the current moves through the transformer while the transistors are switching alternately.  There are only two states which we are interested in for this explanation.
  1. One when the bipolar transistor T1 is switched "off" and T2 is switched "on."

  2. The other state is visa verse.

Current path through Half Bridge during operation
Current path through Half Bridge during operation

  1. At the point just before transistor T2 switches on we must assume that, capacitor C2 will be charged and capacitor C1 will be discharged. Also transistor T1 is switched on and conductive.  When Transistor T2 switches "on" Transistor T1 will also be changing to an open circuit state (off) and so can no longer conduct current.  The voltage at the transistor side of the transformer drops to the negative DC voltage power rail (well near enough). This causes the capacitor C1, which was previously discharged, to charge as the DC voltage will now appear across it. Simultaneously capacitor C2, which was previously charged, will now discharge but again through the transformer.  The net effect is the current equal to the charging and discharging current will pass through the transformer, see first diagram above. The arrows represent the current path in the circuit.

  2. Once capacitor C1 has charged and C2 discharged. Transistor T2 goes open circuit thus stopping the current flow and T1 switches "on" allowing the current to pass through it. This change will make the transistor side of the transformer go from the negative DC power rail to the positive DC power rail (near enough).  This means that the capacitor C2, which was previously discharged, will start charging.  As the voltage between C1 and C2 rises, the charged C1 capacitor will have to discharge its energy by sending its current back towards the DC source (see 2nd diagram above).  The result of this discharge is that there is a current flow from capacitor C1 through transistor T1.  The net effect is that the current flow through the transformer is the sum of the charging and discharging currents through C2 and C1 respectively, see second diagram above .  At this point we are ready to return to our starting point as capacitor C2 will be charged and C1 will be discharged.

As described in my previous post, the energy contained in the magnetic flux of each cycle is tiny compared to a standard power transformer. The power capability comes from the substantially higher frequency of the  transfer. Consequently, the inductive type of power factor (caused by left over flux) is also very small and generally an electronic transformer can be safely used with a trailing edge dimmer. Which usually means it can be used with all dimmers.

  •  Ensure you adhere to the manufacturer's instructions regarding choice of dimmers.

The Choice of C1 and C2 must be considered in the light that the output transformer is an inductor and consequently has a property called, "reluctance." This property can be perceived as the desire for an inductor to try and maintain the level of the current passing through it, thus it is reluctant to change.

  • It is actually caused by the creation and collapsing of the magnetic flux.  As described in my previous post on transformers, this flux is a temporary energy store. Be assured, an inductor does not have emotions.

If the transistors do not change in perfect unison there may be a point where the output transformer is momentarily connected by high resistance on one side.  Due to the property of reluctance this would allow the voltage to suddenly change across the transformer as it tries to maintain the current passing through it. If so it could have a voltage between the caps C1 and C2 greater or less than the DC voltage power rail of the DC source, effectively causing a super positive or negative voltage at this node.  This means the choice of the physical design of the capacitor for C1 and C2 must take account of this situation where the voltage polarity is reversed.

  • Electrolytic capacitors would be a bad choice as they would not tolerate a reversed voltage.  The choice is usually a ceramic or polyester cap with a comfortable voltage rating of 400V (assuming 240V AC mains).

Due to the same property of reluctance, there is also a danger that the transformer may attempt to back drive the bipolar transistors so a precaution of flyback diodes is often seen added to the circuit to protect against this potential risk.  In the diagram below D1 and D2 are the flyback diodes.

  • Early electronic transformers didn't have these but I have noted that they are more common for later models.

Half Bridge with optional flyback protection diodes
Half Bridge with optional flyback protection diodes

The way they work is, if the voltage of the transformer goes super positive or negative between the transistors T1 and T2, there will be an alternative safe conductive path for the current through these diodes. I have noticed that these flyback diodes are common if you search on the Internet for schematics on electronic transformers but C1 and C2 should cushion the transition of T1 and T2 if chosen properly. So for the following circuit analysis I have not included these in my schematics.

  • When I say super positive or negative I mean that the voltage has gone higher or lower than the respective DC voltage rails.  This would effectively mean that the current is trying to travel in the reverse direction through the transistor. The diode is set in the reverse direction when compared to the DC source but it's actually the right direction to allow this rogue current, and consequently escalating voltage, to bypass the transistor.

How does the oscillator function?

The transistors are driven by negative feedback making for a low component count oscillator. This feedback arrangement is why it is called, "self oscillating," or more accurately, "self exciting oscillator."  The design is use to generate a field in a transformer to switch the base on the transistor thus changing its state.  Originally this would be via additional windings on the main output power transformer.  For the fact that only a tiny current is required and simplicity, a second tiny toroid is used with only a single turn on the primary.  See the schematic below.

Half Bridge highlighting self exciting oscillator components
Half Bridge highlighting self exciting oscillator components

In the above diagram TR2 denotes the second miniature toroid transformer used to create the switching.  The small dot on the schematic represents the winding direction and consequently the current flow through the toroid transformer TR2, relative to each winding.

  • The energy is induced in the primary of TR2 which is electrically in-line with main toroid output transformer TR1. This induces a current in the other two separate secondary windings of transformer TR2, feeding the base of the transistors T1 and T2. The dots show that the current is inverted so the transistor are always in an opposite state to each other, so T1 and T2 are switched alternately. 

  • When components are electrically in-line this is known as being, "in series," so the current through one passes through the other equally.

Take the case when transistor T1 is "off," so the voltage in transformer TR2's secondary connected to T1's base is zero or negative. As the states of the transistors are symmetrically opposite, TR2's other secondary, which is connected to the base of transistor T2 must be positive, thus switching it "on."  This causes the contrary current to flow through transformers TR1 and TR2.  As the current flows in this new direction through TR2 primary it induces an opposite voltage in its secondary, switching on transistor T1 and switching off T2. This change causes the current to flow in the opposite direction through transformers TR2 and TR1 which again reverses the state of the transistors. This is the rudiments for an oscillation and is known as a "self exciting oscillation."

  • This action allows a self sustaining oscillation.  The resistors are to limit the current from TR2 into the base of the transistors.

  • Having a separate switching toroid TR2 allows for the magnetic properties of the switching toroid to be different to the main output transformer TR1 even though they share the same current.  Such a property is called, "Square-loop hysteresis," which is an intrinsic property of the transformer core. This hysteresis is essentially a residual magnetic polarisation of the core material, manifesting itself as a partial and transient magnet. Square-loop hysteresis effectively means that the magnetic core blocks the transition of the change in flux until it reaches a certain level (threshold level).  The current in the primary must get sufficiently high to generate enough flux to surpass the threshold level. Once the threshold is reached the flux in the core will reverse suddenly causing  a spiky output in the secondaries rather than a nice sinusoid.  The advantage of this is that the switching transistors T1 and T2 are driven into the "on" and "off" states alternately and quickly rather than gradually.  

    • The square-loop hysteresis property means the transformer secondary output acts more like a switch than just simply coupling the primary to the secondary, as with most transformers.

  • It is also the reason why you will often see a minimum load stated on the electronic transformer specified by the manufacturer.  Essentially, If there is not sufficient energy through the transformer TR2 there will not be sufficient energy to switch the states of the transistors T1 and T2.

You will often see circuits designs including additional capacitors such as the schematic below.

Half Bridge highlighting self exciting oscillator components and caps
Half Bridge highlighting self exciting oscillator components and caps

To be honest, I'm not sure what C3 and C4 do in this situation.  As a first look and knowing that this circuit will be oscillating at roughly 20 - 100Khz, the capacitors will allow more current into the base of the transistors at higher frequencies.  Potentially allowing for higher frequency switching?  Note that there will also be a phase lag between the primary current induced into TR2 and the generated current in the two secondaries of TR2.  This will limit the max frequency of the oscillation. The capacitors might also be used to help setup a resonance between the inductive winding of TR2 helping it reach an optimum resonance frequency but I am not sure if this is actually the case.

How is the oscillator initialised or triggered?

The preceding explanation of the operation of the self exciting oscillator is quite simple but it assumes that the circuit is already oscillating.  When the circuit initially powers up it will not be in a state where it is oscillating and some method to kick it off is required.

  • Initially at power up there is no current flowing through the transformer TR2, so there is no opportunity to start or cause a self sustaining oscillation. 

Half Bridge highlighting self starting components
Half Bridge highlighting self starting components

This is probably the hardest part of the circuit to explain. At initialisation and as the DC voltage rises the cap C3 will charge through the resistor R3.  As the voltage rises the Diode for Alternating Current (DIAC) VD2 connected to the base of the transistor T2 will reach its trigger voltage and go from its initial high resistance to a conductive state.  Once VD2 goes conductive, transistor T2 will be switched on starting the oscillation cycle.  Once the transistor T2 starts to conduct, the capacitor C3 will discharge through the diode D1 and the DIAC VD2 will switch off and go back to its high resistance state.  As the oscillation is fast and the resistor R3 is chosen so that the capacitor C3 cannot charge sufficiently before being again discharged through transistor T2 and diode D1 combination.  This ensures the DIAC VD2 doesn't trigger again, potentially disrupting the self sustaining oscillation.

  • Note Cap C2 will also be charged partially via R3, D1, TR2, TR1 and C1. This means that the value of the resistor needs to be chosen carefully to ensure it manages to charge C3 sufficiently quickly so that VD2 can get to its trigger voltage in good time.
  • This effectively describes the "self starting" part of the " half bridge oscillator" circuit. An analogy is that it has a similar affect to plucking a guitar string. The initial pluck allows the guitar string to oscillate freely at its own desired frequency and the note on the string is not dependent on the speed or power of the initial pluck.

What is a bridge rectifier?

The explanation above assumes a DC source, but we know that an electronic transformer is powered via the domestic mains, which is an Alternating Current (AC).  For simplicity the mains feeding the transistors is first rectified using a bridge rectifier, normally composed of four individual diodes (it doesn't get the "bridge" part of its name from this bit of the circuit). The raw rectified mains are put directly onto the power transistors without bothering to have any sort of smoothing capacitor.

  • The stock solution is the bridge rectifier.  This is frequently drawn as a diamond of diodes but I have changed this in my diagram for aesthetic reasons but they are electrically identical.

self starting Half Bridge oscillator highlighting bridge rectifier components
Self starting Half Bridge oscillator highlighting bridge rectifier components

The rectified mains power is not stored in a smoothing capacitor as a reservoir such as in most power supplies.  So although rectified, it goes through a zero volts phase twice per cycle. At this point the self exciting oscillation stops as there is no power within the circuit to maintain it. The self starting part of the circuit, described previously, allows the self exciting oscillation to be restarted twice per mains cycle.

This lack of smoothing capacitor is essential for the purposes of dimming as the dimmer works by cutting power part way through the main cycle.  If there was a smoothing capacitor is would/could make the dimming capability ineffectual.

Why is there a noise filter and what is it for?

To finish the explanation of the fundamental circuit design, a mains noise filter is added. This is really to remove the switching noise created by the electronic transformer, rather than modifying the power factor.  There are many designs for this part but I will describe one I prefer which uses a transformer wired in-line to cancel the noise energy by effectively inducing it as common mode energy.

  • Note to remove noise the energy needs to be either, dissipated, cancelled or consumed. The capacitors allow the high frequencies to cancel and the transformer allows a combination of dissipation and cancellation.  
  • Note if the transformer is wired incorrectly you can actually make the mains noise worse.  Unlike individual inductors, in this arrangement, it does have a correct wiring orientation.

Self starting Half Bridge oscillator highlighting mains noise filter components
Self starting Half Bridge oscillator highlighting mains noise filter components

Additional protective components

As the transistors are normally in two states, either fully "on" or fully "off," they do not tend to consume power in themselves.
  • The consumed power is described by the equation I2R.  "R", representing resistance, is either 0 or ∞ (infinity) in either transistor state. When it is ∞ the current flow, represented by "I", through the transistor is 0A (open circuit). Anything multiplied by zero is zero, so the result is the power consumed by the transistors is "near" zero.
In reality, nothing is perfect and the transistor must go between zero and infinite resistance and during that brief period it has a momentary resistance and consequently generates heat.  Fortunately, this is negligible but there is a thermal protective circuit normally built in to catch any potential thermal damage.

  • A thermal component would usually be on leads long enough to allow it to be in best thermal contact with the components it is there to protect.  In this case it would be the transistors. Although there are two transistors it can be "assumed" that they would produce the same heat so only one thermal component needs to be fitted.

Self starting Half Bridge oscillator highlighting thermal protective components
Self starting Half Bridge oscillator highlighting thermal protective components

In this particular design TH1 is used to short the primary of TR2 slowing the oscillation.  FS1 is a fusible component and is used as a general protection measure.

For further reading and references: please see my resource page


  1. Very awesome writeup! I bought one of these not knowing that it had a minimum load. Is there any way I can modify mine so it is 0 load? Thanks.

  2. Hi Rick, The short answer to your question is "no" not safely. The longer answer is in three parts:

    1. If you have a transformer that’s driving several fittings and you cannot meet the minimum load requirement, then the simple answer is to use LEDs in some fittings and meet the load deficit with a halogen.

    e.g. a 150w electronic transformer with a 30w minimum load, driving 3 x 50w light fittings. If you wanted to change to 7w LEDs you would only make 21w load in total, which is insufficient for your transformer. The cheapest answer is to use two 7w LEDs and one 20w halogen making a total of 34w, therefore meeting the minimum load requirement.

    Other than replacing the transformer, this workaround is the safest method to allow the use of low wattage LEDs by effectively "preloading" the transformer. It certainly isn't the most energy efficient or cost effective way to achieve the desired effect.

    2. If you're planning on using the transformer domestically, it is never a good idea to make any personal modification to safety circuitry. Not only are there many variations to the circuit I describe but you may make the circuit dangerous or render the protection circuitry ineffective. Before any manufacturer can sell a product in your country, they will usually go through a barrage of tests to ensure their product meets all safety standards and conforms to all electrical requirements. Home made modification can render these ineffective, void the warranty and pose a serious risk to you, the people around you and your property.

    Just because you know what you've done doesn't mean anyone else does, so it’s best to stick with the readily available commercial options as they were designed.

    3. If you were making a change just from a purely academic perspective and had no interest to use this in a domestic or commercial environment then please consider your safety before considering starting any work. Remember the electronic transformer is designed to be plugged into the domestic mains and so must be treated with the greatest respect. If possible RCDs and fully protected isolated power supplies are recommended. If you're not sure what these are do not even contemplate doing anything.

    I have not really thought about this modification but if I was to be put on the spot and had to come out, "shooting from the hip," I'd say that breaking into the feedback toroid to drive the oscillation would be my first speculative approach. Using this method you would be isolated from the most dangerous parts of the circuit.

    If you can pick out the fundamental frequency of the transformer's operation, you can make an oscillator, which runs at that frequency which directly drives the feedback toroid. The oscillator could be based on something like an astable multivibrator, 555 timer or a more exotic PLL based oscillator.

    If you were to bypass the feedback toroid so the feedback current was decoupled from the power transformer you would have total control of the oscillation driving the power transistors. Essentially you would be looking to have the oscillation driving the H bridge regardless of the loading.

    Of course this is pure speculation and would be a fun project for the future.

    As far as an, "off the shelf," option, there isn't one I'm aware of.

    I hope this helps?