Here is how I made a simple circuit to control a DC Motor using Arduino. You can use this circuit with simple and short code to automate a DC motor from Arduino.
H-Bridge Integrated Circuit
The motor coil uses a relatively high current that Arduino cannot directly supply. That’s why we use this HBridge Integrated Circuit L293D.
This IC Integrated Circuit can drive two DC Motors in two directions for each motor.
Note:
This tutorial can be applied to the Arduino motor shield using the same code and configuration.

Connection
The IC has two identical elements to control two motors. We connect it using this simple circuit to power it, enable each element from Arduino and then wait for the action input signal from Arduino.
You can use this input signal to power the motor On or Off. And if you apply this signal on the other input from the same IC channel you get the motor to move in the opposite direction.

Code
As for the code we use a simple code you can get even from the Arduino LED Blink example. This example makes one Arduino PIN High and thus it drives the motor in one direction.

For driving the motor in the opposite direction, we have copied the Blink example one more time on another PIN to drive it in the opposite direction.
Here is the Tinkercad simulation that shows us how the circuit and code are running.
Recent Posts
- The “Secretary of War” and the Beast: Why the Doomsday Plane Just Landed at LAX
On January 8, 2026, the Boeing E-4B Nightwatch, known as America’s “Doomsday Plane,” made a rare appearance at Los Angeles International Airport. It transported Secretary of War Pete Hegseth during his “Arsenal of Freedom” tour, aimed at reviving the defense industrial base, sparking debate over its high operational costs amidst its significant Cold War legacy. - Build a Pinguino Egypt: A PIC-Based Arduino Clone (Complete Guide + Resources)
I wanted to build my own Arduino. Here’s a project where you can build Arduino Compatible with your favorite Microchip PIC Microcontroller. - Why I Built This App: Stepping Away From Screens to Come Back to Ourselves
Lately, I’ve been spending time reading posts on Reddit. Not the funny ones or the viral threads—but the honest ones. People talking about how isolated they feel. How unproductive. How days blur together behind screens. How they feel connected to everyone and no one at the same time. What struck me wasn’t laziness or lack… Read more: Why I Built This App: Stepping Away From Screens to Come Back to Ourselves - US ‘Doomsday Plane’ Spotted Today: What It Is, Why It Matters, and What We Know So Far
The U.S. Air Force E-4B “Doomsday Plane” was sighted landing at LAX, attracting public attention due to its rare visibility. Designed as a National Airborne Operations Center, it ensures military command during crises. However, today’s appearance likely reflects routine operations rather than an emergency, emphasizing its role in military preparedness. - Why Arduino Ultrasonic Sensor Gives Random Values ? (And 3 ideas to Fix It)If your Arduino ultrasonic sensor gives random, unstable, or jumping distance values, you are not alone. This is one of the most common Arduino beginner problems, both in real hardware and even in Tinkercad simulation. In this article, we’ll explain: What “Random Values” Really Means When people say random values, they usually mean: These symptoms… Read more: Why Arduino Ultrasonic Sensor Gives Random Values ? (And 3 ideas to Fix It)
- The Advantages and Disadvantages of Quantum AIrtificial Intelligence (AI) has already changed the way we live, work, and solve problems. But when you combine AI with quantum computing, a new frontier opens — one that could transform industries at a speed and scale we’ve never imagined. This powerful combination is called Quantum AI. Like any disruptive technology, Quantum AI carries both… Read more: The Advantages and Disadvantages of Quantum AI
- How to Save Money with AI: A Practical Guide
Artificial Intelligence (AI) is transforming not only industries but also personal finance. Beyond hype, AI tools can directly help you save money, cut waste, and make smarter everyday decisions. Here are seven practical ways to use AI for financial savings: 1. Smarter Shopping AI-powered apps and extensions automatically find coupons, discounts, and cheaper alternatives online.… Read more: How to Save Money with AI: A Practical Guide - My Experience at the First Alexandria Quantum Hackathon
Today, I had the incredible opportunity to attend the first Alexandria Quantum Hackathon — a landmark event in Egypt and the wider region dedicated to quantum computing education and innovation. The event was hosted at the iconic Bibliotheca Alexandrina, making it even more inspiring to witness the future of computing being discussed in such a historic place… Read more: My Experience at the First Alexandria Quantum Hackathon
