Home ==> Power supply software


Software for transformer power supplies

This piece of Open-Source software can be used to simulate transformer power supplies and to select components for that.

Power Supply Software The software allows to simulate three different configurations:
  1. A transformer with a single secondary coil, a diode for rectification and an electrolytical capacitor to produce a DC current,
  2. A transformer with a single coil and four diodes for full-wave rectification, and
  3. A transformer with two coils and two diodes for rectification.
All parameters for the simulation are configuable. The result can be saved as graphics file.

The software is written in Lazarus Pascal. Four versions are available. The latest version 6 provides convenient ways to model the forward voltage of diodes and diode bridges: With these tools the forward voltages can be estimated in a very exact way.

If you encounter the error message that the root is negative (which appears only once), switch to mode 3, please.

Version 6 also fixes a number of issues of previous versions.

Version 5 provided the following added changes: Version 4 had the following changes: Version 3 has the following changes compared to 2: The previous version 2 changed the following features of version 1:

Source code for Lazarus and compiled versions for 64-Bit operating systems are provided here. If you compile the source code with Linux or other operating systems use the win source code and change the target system.

Source codeExecutableSource codeExecutable
6V6 Win Source V6 Win64 Executable V6 Lin Source V6 Lin64 Executable
5V5 Win Source V5 Win64 Executable V5 Lin Source V5 Lin64 Executable
4V4 Win Source V4 Win64 Executable V4 Lin Source V4 Lin64 Executable
3V3 Win Source V2 Win64 Executable (not provided)
2V2 Win Source V2 Win64 Executable
1V1 Win Source V1 Win64 Executable V1 Lin Source V1 Lin Executable

Use of the software

  1. Selecting type
  2. Transformer properties
  3. Diodes/Rectifiers
  4. Capacitor, DC current
  5. Simulation
  6. Results

1 Selecting type

If you prefer German language and notation for number formats, unselect the language entry field.

In the drop down field in the upper left the type of power supply can be selected.
Single diode Rectification with one single diode, one transformer coil, half wave rectification
Bridge rectifier Rectification with a rectifier bridge of the Graetz type with four diodes, a single transformer coil, full wave rectification
Double coil Rectification with two transformer coils and two diodes, full wave rectification
Changing the type comes immediately into effect:

One way In half wave rectification only the positive halfwave is active, the duration over which the capacitor is loaded is shorter, the duration over which the consumed DC current has to be supplied from the electrolytic capacitor alone is longer.

The four-diode full-wave version can be seen above. Loading is double as often and unloading is half the time than with a single diode.

Double coil When using a two coil transformer with two diodes both half waves are actively loading the capacitor. As only one diode with its conducting state voltage drop is required, the voltages are at their maximum.

As only one of the two coils loads over a certain time and the other one takes over duty in the next half-wave, the load of the two coils is halfed.

Top of page Type Transformer Diodes/Rectifiers Capacitor Simulation Results

2 Selecting transformer properties

Editing transformer properties Finishing editing with return By changing a transformer parameter the editor fields turn green (left). On hitting the return key the changed parameter is checked and applied (the edit field changes its color, to white if fine or to red if not readable or beyond limits). The related parameters that are also changed, as a consequence of the new entry, are colored yellow. By editing a different editor field, the previous entry is also applied.

Transformer equations Central parameters for the transformer are its nominal power (VA), the mathmatical product of nominal voltage Unom and nominal current Inom.

The input of the nominal power of the transformer can be done in two ways: by selecting from the drop-down-field or by inputting the value in the entry field. Changes in this field come immediately into effect, unlike to editor fields the return key is unnecessary. The no-load-voltage and the nominal current are changed accordingly and those editor fields turn yellow.

The other parameters are optional, but are required for a realistic modelling. The transformer coil(s) consist of a wire with a resistance (Ohm's law). The coil resistance in Ω can be measured on the transformer. To account for the voltage losses over this inner resistance Ri the transformer is designed for a higher voltage. This higher voltage is called the zero-load voltage, V. Only if the design current flows the nominal voltage is reached, the over voltage is consumed by the inner resistance of the coil(s).

Some transformer sellers publish the zero-load voltage or the zero-load voltage factor, UTr = fzlv * Unom, others find those information not worth publishing, even though it influences voltages a lot (especially in small power transformers.

An additional effect that occurs in rectification is that all voltages are effective values Ueff. The effective voltage is the voltage that determines power, not the peak voltage of the alternating current. The mean voltage, with negative half waves changing their sign, averages the peaks by filling the valleys of the AC, thereby yielding an average power. With a sine wave AC the difference between the peak voltage and the effective voltage is of a factor of √2 or the 1.414-fold. With a 9 V transformer the zero-load voltage behaves as follows:

No load Voltage 9Veff Rectifying this voltage with a diode and loading a capacitor with that yields approximately 12 V and not 9 V!

Additionally considering the compensation of the inner resistance yields even higher voltages following rectification (zero-load):

Voltage with compensating the inner resistance The maximum voltage of the 9 V transformer now is higher than 17 V. A 16 V capacitor would be overcharged with that. This effect is even more dramatic with very small transformers with less than 1 VA.

If you change the power of the transformer in the software, the zero-load voltage factor is estimated from the size of the transformer and changes occur in the factor and in the zero-load voltage. If the nominal current (in mA) is changed the transformer power and the other parameters are changed, too. So better first select nominal current and/or power first, no load voltage, no load voltage factor and coil resistance later on. With double coil transformers the parameters voltage, current and inner resistance apply for one coil each. Not for the power of the transformer: as the two coils share the loading the inactive coild does not provide/consume power, so their power provides only half for each coil.

Top of page Type Transformer Diodes/Rectifiers Capacitor Simulation Results

3 Selecting the diodes/bridges

By klicking on the button Config diodes a window opens that allows the diode configuration:

Diode configuration In this window The four modes of the forward voltage selection are displayed in the following four pictures.

1N4001 in mode 1 1N4001 in mode 2

1N4001 in mode 3 1N4001 in mode 4 The selected mode is immediately used for all calculations. The update of the diagram can be delayed by one second at maximum.

Top of page Type Transformer Diodes/Rectifiers Capacitor Simulation Results

5 Selecting simulation parameters

The number of waves to be displayed can be selected in the two edit fields. The picture that is displayed can be saved as a graphics file, either in PNG or in BMP format.

6 Result field

The picture displays relevant parameters and results in the yellow field: Maximum and minimum voltage of the capacitor, the resulting ripple and the maximum current through the diodes during the last displayed wave.

The heat power output gives the VA of the secondary transformer coil(s) and of the diodes. It calculates the efficiency of the rectifier from this.

Note that the results are derived from that the last wave only and are only averaged over this wave duration.

7 Comparing real power supplies with simulations

Comparison of real and simulated power supplies How exact is that software? Are real power supplies as good as the simulated ones here?

The picture shows that simulation mometimes is not as exact as expected. This in both directions: simulated voltages can be higher or lower than in reality. Only in rare cases both are within a small band of differences.

The first case is the rarer one: a 24V/16VA power supply with a diode bridge rectifier shows an exact match between reality and simulation. The voltage differences are below 1 V.

The 2x15V power supply shows too low voltages, while the 2x12V shows too high voltages in simulation. In both cases, the differences increase with higher currents. Only with the 2x7.5V power supply the too high voltages decrease with larger currents, so both get nearer to each other.

The reasons for those differences can be manyfold: In any case:

8 Testing of power supplies

To test power supplies, you'll need a dummy load. This simulates an adjustable constant current. Such a dummy load, equipped with a PNP-Darlington power transistor, is described here. With that you can easily test your power supplies.

Top of page Type Transformer Diodes/Rectifiers Capacitor Simulation Results

Email me at

Mail me

©2017/2021 by http://www.gsc-elektronic.net