Introduction: Simple AC to DC Converter 5V

About: I'm electrical engineering student from Turkey. In electronics my interest is SMPS power suplies, high voltage and lighting technologies

WARNING! PRESENTED CIRCUIT IS CONNECTED TO DANGEROUS MAINS VOLTAGE. TOUCHING CIRCUIT WHILE IN OPERATION CAN LEAD ELECTRIC SHOCKS. DO EVERYTHING AT YOUR OWN RISK. AUTHORS DOES NOT TAKE ANY RESPONSIBILITY.

This is simple self oscillating power supply in flyback topology. It uses 1 NPN high voltage transistor and 1 general purpose transistor. It's power can be extended to 10 or 20W with bigger transformer and a heatsink on the main switching transistor. Also this circuit is a backbone of a power supply which means it lacks several features like interference suppression (which can be added if necessary).

Supplies

1x High voltage NPN transistor like MJE13003,13005 or 2SC3148

1x general purpose NPN transistor like BC547,2N3904

1x 1N4007 (for higher power replace it with bridge rectifier)

1x fusible resistor 1 - 10Ω

1x 400V electrolytic capacitor 2.2 - 10u (higher power designs will use higher value)

1x 220kΩ - 1MΩ resistor

1x high speed high voltage diode like FR107 or UF4007

1x high voltage capacitor 500V or more (I've used 1nF 1kV ceramic)

1x 100kΩ resistor

3x 1kΩ resistor

1x 2.2Ω resistor

1x 1N4148 diode

1x 120Ω resistor

1x 2.2nF capacitor

1x optocoupler like PC817

1x 1N5819 schottky diode

1x Flyback transformer (I've used ready made transformer from a cheap charger)

1x 100-1000uF 10V electrolytic capacitor

1x 470Ω resistor

Step 1: How Does It Work ?

When you connect the circuit to mains capacitor C1 will charge up through the rectifier and using 220kΩ resistor it will partly open the main switching transistor which energize the primary and some small current will flow through it. This current will create magnetic flux in the core and voltage will appear on the auxilary and secondary winding. According to winding direction the diode at the secondary will be in the reverse and won't conduct but at the auxilary winding it will charge up 2.2n capacitor and will supply more current to base of the transistor which will fully open and induces more flux in the transformer core. This flux will be accumulated in the air gap of the transformer until 2.2n capacitor discharges.

When it is discharged the transistor starts close and due to feedback from auxilary winding it will close fully faster. When the current through primary is ceased the polarity of thevoltage in the windings will be swapped and energy accumulated in the air gap of the transformer will be dumped into secondary and because of the winding directions transistor stays closed until energy runs out of the transformer and this way it will oscillate and a frequncy of oscillation will be determined by C5 (2.2nF) capacitor and base resistor (120Ω).

When the output capacitor has charged to 5V, the voltage divider of R8 and R9 will put 2.5V to reference pin of TL431 which open and illuminate the phototransistor in the optocopuler of the PC817C. When this happens, this photo transistor will shunt the base of the switching transitor to its emitter and transistor stays on shorter.

1N4148 protects the base of the transistor from negative voltages and 2N3904 limits the collector current using 2.2Ω resistor (if voltage af this resistor reaches 0.7V 2N3904 will open limits the duty cycle of the transistor)

D3,C4 and R4 protects switching transistor from high voltage from primary when it is turned off. D3 charges the C4 and the energy is dissipated in R4.

Step 2: Waveforms, Voltage and Some Comments

When you first power the circuit use an 5 to 10W tungsten lamp in series with the circuit. If you made a short the lamp will glow in full brightness. If everything is okay lamp won't be glow in full brightness, it can glow slightly or it can blink and go out and if there is 5V at the output you can remove lamp and proceed.

First photo is the secondary waveform in the scope when it is loaded with 7.5Ω power resistor and second photo is the output voltage at the same conditions.

The circuit is far from finished it is just a prototype, component values can be changed to get more efficient results and some component can be added to get more stable circuit and to supress interefence.

I couldn't measure the efficiency of the circuit because I don't have power meter to measure input power.