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
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:
- Arduino Uno (or compatible)
- L293D H-Bridge motor driver
- Breadboard and jumper wires
- Small DC power source (5–9V battery)
- Multimeter for measuring output
- DC motor
- PC with Arduino ID
- 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
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
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.