DIY Low-Voltage AC Inverter Using Arduino and H-Bridge

by Patrik_Horinek in Circuits > Arduino

54 Views, 1 Favorites, 0 Comments

DIY Low-Voltage AC Inverter Using Arduino and H-Bridge

6DE39A58-C6E2-4E4C-9D03-93F0BD71AFC8.png

In this project, we’ll create a simple low-voltage AC inverter using an Arduino and an H-bridge motor driver (L293D). This is an educational experiment, demonstrating the principle of DC-to-AC conversion at low voltage. Important: This project only works at small voltages (like 5–9V) and is not suitable for mains AC.

Supplies

For supplieswe need:

  1. Arduino Uno (or compatible)
  2. L293D H-Bridge motor driver
  3. Breadboard and jumper wires
  4. Small DC power source (5–9V battery)
  5. Multimeter for measuring output
  6. DC motor
  7. PC with Arduino ID
  8. Optional: small transformer (low-voltage) for demonstration

How It Works?

Normaly L293D is used for controling which way motor spins by changing polarity. We are gonna use it as DC to AC converter.

L293D is a chip that rotates the current into the load one way or the other. It allows you to steer the direction and turn on/off the motor or other tiny electronics.

Connect Everything

Schematic_dc-to-ac_2026-04-02.png
Snímek obrazovky 2026-04-02 104944.png

First connect everything as showed at the schematich or image. Make sure you have everything well connected, before plugging the arduino to the ccomputer.

Coding

If you checked that you have everything well connected, upload the code to the ARDUINO IDE.


Code:

#define EN 9

#define IN1 8

#define IN2 7


const int speed = 2000; //how fast the polarity changes-frequency


void setup() {

pinMode(EN, OUTPUT);

pinMode(IN1, OUTPUT);

pinMode(IN2, OUTPUT);


Serial.begin(9600);

Serial.println("M1:,M2:"); //legend if you want to see it in serial plotter

analogWrite(EN, 255); //how much power is the L293D delivering

}


void loop() {

//phase 1

digitalWrite(IN1, HIGH);

digitalWrite(IN2, LOW);

Serial.print(analogRead(A0));

Serial.print(", ");

delay(speed);

//phase 2

digitalWrite(IN1, LOW);

digitalWrite(IN2, HIGH);

Serial.println(analogRead(A1));

delay(speed);


}



Testing

IMG_3359.png
IMG_3358.png

If everything is done, we now must test, if the L293D is working. We sett multimeter to AC Voltage mode and connect it to the outputs of L293D. If everything works, the multimeter should show Voltage around input voltage minus 2.

Im using power supply module which deliveres 5 V to the chip so as an output i have around 3.5 Volts.