• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » DIY Variable Power Supply Circuit using Arduino

DIY Variable Power Supply Circuit using Arduino

Last updated on 29 July 2025 by Admin-Lavi 1 Comment

This DIY Variable Power Supply Circuit using Arduino makes changeable power.

It uses transistor and resistors to change 9V output from IC 7809 regulator.

One 100uF capacitor help clean the output voltage.

Two pushbuttons can change the voltage by hand.

LCD screen show real output voltage.

Coding:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int button1 = 7;
int button2 = 8;
int pwmPin = 9;

int dutyCycle = 0;

void setup() {
  lcd.begin(16, 2);
  lcd.print("Variable Power Supply");
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  pinMode(pwmPin, OUTPUT);
}

void loop() {
  if (digitalRead(button1) == HIGH) {
    dutyCycle++;
    if (dutyCycle > 255) {
      dutyCycle = 255;
    }
  } else if (digitalRead(button2) == HIGH) {
    dutyCycle--;
    if (dutyCycle < 0) {
      dutyCycle = 0;
    }
  }

  analogWrite(pwmPin, dutyCycle);

  lcd.setCursor(0, 1);
  lcd.print("Voltage: ");
  lcd.print(dutyCycle * 9 / 255);
  lcd.print("V");
  delay(100);
}

Code Explanation:

  • Include Liquid Crystal library to control LCD.
  • In setup, print welcome, start LCD and set input/output pins.
  • In loop check push buttons always.
  • If button 1 is pressed duty cycle goes up.
  • If button 2 is pressed then duty cycle goes down.
  • Duty cycle change PWM output and so voltage also changes.
  • LCD will show voltage at that time.

Circuit Working:

DIY Variable Power Supply Circuit  Diagram using Arduino

Parts List:

ComponentQuantity
Resistors
1k 1/4 watt1
100k 1/4 watt2
Capacitor
100µF 25V1
Semiconductors
Arduino Uno Board1
LCD 16X21
IC 78091
Tactile switches2
Transistor 2N22221

Arduino Uno give power to this variable power supply circuit.

IC 7809 give fixed 9V output if input is more than 9V then it does not changes.

Voltage divider bring down voltage to 0 to 5V so Arduino can read it.

Pin 9 of Arduino send PWM signal.

PWM drive transistor like a switch.

Arduino read the small voltage and show it on LCD.

Arduino uses voltage divider calculation to find real output voltage.

1k resistor control transistor base current so it control how much it work.

100µF capacitor connect between 0 to 5V output and ground to make voltage stable and clean.

Capacitor also reduces the noise.

LCD show the voltage at that time.

How to Build:

To build a DIY Variable Power Supply Circuit using Arduino follow the below mentioned steps for connections:

  • Collect all parts like in circuit diagram.
  • Connect IC 7809 to give fixed 9V DC to Arduino.
  • Connect button1 with one leg to pin 7 and other leg to ground.
  • Connect button2 with one leg to pin 8 and other leg to ground.
  • Put 100k resistor between pin 7 and 5V on Arduino.
  • Put another 100k resistor between pin 8 and 5V on Arduino.
  • Connect LCD R/W pin to ground of Arduino.

Connect 2N2222 transistor:

  • Collector goes to 5V power
  • Base goes to pin 9 through 1k resistor
  • Emitter goes to 0 to 5V output.

Connect 100µF capacitor:

  • Positive leg goes to 0 to 5V output
  • Negative leg goes to ground from negative of output.

LCD Connections to Arduino Uno Board:

Arduino PinLCD PinFunction
2RSRegister Select
3ENEnable
4D4Data Bit 4
5D5Data Bit 5
6D6Data Bit 6
7D7Data Bit 7
11Backlight+Positive supply for backlight
12Backlight-Negative supply for backlight
5VVCCPositive supply for LCD
GNDGNDGround for LCD

Conclusion:

This project for DIY Variable Power Supply Circuit using Arduino show how make simple and easy variable power source.

PWM duty cycle changes so output voltage also change in a set range.

LCD give feedback to check output voltage.

Project can be made better by adding auto voltage control or more accurate voltage reading.

References:

Arduino Based VARIABLE Powersupply

Filed Under: Arduino Projects, Power Supply Circuits

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Digital Code Lock Circuit using Arduino
Next Post: Free Energy is Myths Vs Reality »

Reader Interactions

Comments

  1. TDHofstetter says

    4 January 2026 at 03:28

    How much ripple do you see, especially when loaded fairly heavily?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • Alarm Circuits (47)
  • Amplifier Circuits (67)
  • Arduino Projects (101)
  • Audio Circuits (116)
  • Automobile Circuits (19)
  • Battery Charger Circuits (65)
  • Free Energy (13)
  • Heater and Temperature Controllers (14)
  • High Voltage (1)
  • Indicator Circuits (47)
  • Inverter Circuits (20)
  • IoT projects (1)
  • LDR Circuits (26)
  • LED and Lamps (150)
  • Meters and Testers (31)
  • Motor Controllers (22)
  • Oscillator Circuits (40)
  • Power Supply Circuits (117)
  • Remote Control Circuits (10)
  • Security and Protection (29)
  • Sensors and Detectors (128)
  • Solar Circuits (30)
  • Timer Circuits (41)
  • Transistor Circuits (94)
  • Transmitter Circuit (17)
  • Tutorials (8)
  • Water Level Controller (7)

Recent Posts

  • Simple Over-Temperature Warning Indicator Circuit
  • Arduino Flash Trigger Circuit with Sound Sensor
  • Solar Cell Based Camera Flash Trigger Circuit
  • 12V Boost Converter Circuit from 3.3V to 5V Supply
  • Boost Converter Circuit From 5V to 12V using Transistors

Recent Comments

  1. TDHofstetter on DIY Variable Power Supply Circuit using Arduino
  2. feathbuff on Simple Micro Ampere Meter Circuit
  3. Admin-Lavi on Simple School Project Multimeter Circuit
  4. choke on Simple School Project Multimeter Circuit
  5. Admin-Lavi on Analog to Digital Converter Circuit using IC 555

Copyright © 2026 | New Circuit Ideas