How to Build a 5V Power Supply from AC Mains Using a Transformer

Building a stable 5V DC power supply from AC mains using step down transformer is very easy and low cost. Buying any 5V SMPS board is not a good idea, it has lot of problems such as electrical shock hazard, when the component damage happened total circuit may get burns. This transformer based voltage regulator circuit can use in microcontroller, sensor and other circuits need a 5V DC. in this article I’m sharing the circuit diagram, and information about 7805 voltage regulator and its working and connection details. Using this project you can easily convert 12V or 18V AC input into a stable 5V DC output for your electronic circuits.

7805 Voltage Regulator

7805 voltage regulator

The 7805 is a most common voltage regulator IC using in electronic devices and circuits. This is because of the simplicity and user connection friendly of this IC. Comparing with any other voltage regulator device or products this 7805 is the best in use case. This Voltage regulator IC is very famous. The IC is comes from the 78xx series and the letter “xx” is denoted as the output voltage of the voltage regulator. This voltage regulator IC can give input voltage of 7V to 35V and it provides a 5V Stable output. The 7805 IC has three terminals

  • Pin 1 is input
  • Pin 2 is ground and
  • Pin 3 is output.

Circuit Diagram

5v power supply circuit

Components Required

Sl. NoComponentSpecification/ValueQuantity
1Transformer230V to 12V or 18V AC1
2Diodes1N40075
3Capacitor (Electrolytic)4700µF, 25V1
4Capacitor (Ceramic)100nF2
5Voltage Regulator IC78051
6Resistor540Ω1
7Resistor220Ω1
8LEDRed (or any color)2
9PCB / Breadboard1
10Terminal Block / Connector2-pin2

Construction of 5V Power Supply Circuit

The circuit is designed to convert 12V or 18V AC from a transformer into a regulated 5V DC output. The major components used in the construction include,

  • Transformer (external): Steps down the 230V AC mains to 12V or 18V AC.
  • D1 (Bridge Rectifier using 1N4007 diodes): Converts AC to pulsating DC.
  • C4 (4700µF capacitor): Smooths the pulsating DC from the bridge rectifier.
  • Voltage Regulator IC 7805: Regulates the voltage down to a steady 5V DC.
  • C2 and C3 (100nF capacitors): Filter out high-frequency noise and stabilize the output.
  • LED1 and R4 (540Ω): Power indicator showing that unregulated voltage is present.
  • LED2 and R1 (220Ω): Output indicator showing the presence of 5V regulated output.
  • D2 (1N4007 diode): Protects the circuit from reverse polarity or feedback from connected loads.

Working of 5V Power Supply

  1. AC Input: The AC mains voltage is stepped down to 12V or 18V AC by a transformer.
  2. Rectification (D1): The AC voltage is fed into a bridge rectifier (D1) made from four 1N4007 diodes, which converts the AC to pulsating DC.
  3. Filtering (C4): The 4700µF capacitor smooths out the rectified DC, reducing voltage ripple and creating a more constant DC voltage.
  4. Indicator (LED1 + R4): The first LED lights up when power is available after rectification, indicating the presence of unregulated DC.
  5. Voltage Regulation (7805): The smoothed DC voltage is fed to the 7805 voltage regulator IC, which outputs a constant 5V DC regardless of input fluctuations (within its input range).
  6. Filtering (C2 and C3): These small ceramic capacitors further stabilize the input and output of the 7805 IC by filtering out noise and transients.
  7. Output Indicator (LED2 + R1): This LED confirms that 5V is present at the output terminal.
  8. Protection (D2): A diode at the output prevents reverse current flow that might damage the regulator if the output is accidentally connected to a higher voltage.

Don’t Miss New Projects

Get new DIY tips, circuits & projects delivered weekly - free!

Subscribe Free
Akhil Satheesh
Akhil Satheesh

Tech enthusiast, pharmacist by profession, and entrepreneur at heart. I run an online electronics website and love working on DIY electronics projects, especially involving Arduino and programming. Passionate about learning and sharing knowledge in the fields of technology.

Articles: 32

Leave a Reply