Robot and Motor Projects: Servos, DC Motors and Motion

Making something move is the most exciting way to connect electronics to the real world. In these projects you'll learn to position servo motors by angle, control them with a joystick and build moving mechanisms. Motors draw a lot of current, so they often need a separate power supply; the projects show you how.

Using a Servo Motor
#35Beginner
Premium

Using a Servo Motor

The arm of a small servo motor turns to three positions in turn: all the way to the start, right to the middle and all the way to the end, waiting two seconds at each stop. The Arduino tells the motor

4.7(48)
67
Servo Motor Operation with Potentiometer
#36Beginner
Premium

Servo Motor Operation with Potentiometer

As you turn the potentiometer knob, the servo motor's arm turns right along with it: one end of the knob means zero degrees, the other end means half a turn. The Arduino keeps reading the knob's posit

4.6(37)
53
Servo Control with Joystick
#60Intermediate
Premium

Servo Control with Joystick

Steer two motors with a joystick, just like turning a security camera. Push the stick left or right and the bottom servo motor slowly turns, push it up or down and the top servo tilts up and down; let

4.7(42)
58
Using a Stepper Motor
#67Intermediate
Premium

Using a Stepper Motor

A motor that turns step by step, exactly as far as you want, like the hand of a clock. Through a driver board, the Arduino turns a small stepper motor one full turn in one direction, waits a second, t

4.5(31)
42
360-Degree Servo from a Stepper Motor
#68Intermediate
Premium

360-Degree Servo from a Stepper Motor

Teach an ordinary stepper motor to go to any angle you want, all the way around the circle. The Arduino works out how many steps each angle takes; the motor moves to 0, 90, 45, 180, 135 and 360 degree

4.5(22)
33
Bluetooth Controlled Car with L298N
#80Advanced
Premium

Bluetooth Controlled Car with L298N

Turn your phone into a remote and drive your own robot car. The Arduino receives commands from a remote-control app on your phone through a Bluetooth module and spins the wheels with a motor driver; t

5.0(38)
65
Obstacle Avoidance Robot
#81Advanced
Premium

Obstacle Avoidance Robot

How about building a smart vehicle that finds its own way? The Obstacle Avoidance Robot constantly scans its surroundings thanks to the ultrasonic sensor in front of it. When it encounters an obstacle

5.0(38)
49
Servo Circle Choreography - Animated Patterns with 32 Servos
#102Advanced
Premium

Servo Circle Choreography - Animated Patterns with 32 Servos

A visual animation project driven by 32 servo motors arranged in a circle on an Arduino Mega. The servos are managed in a single array, connected to the Mega's pins 22–53, and perform four motion sequences: a chaotic jitter at random angles, a synchronized sweep, a wave travelling around the circle and a compass needle swinging left and right.

4.5(40)
62
ESP32 Servo Motor (Potentiometer Control)
#118Intermediate
Premium

ESP32 Servo Motor (Potentiometer Control)

In this project, we control an SG90 servo motor using a potentiometer. We adjust the servo angle by mapping the analog value read from the potentiometer to the 0–180-degree range. The ESP32Servo library generates servo signals on suitable output-capable GPIO pins of the ESP32; this project uses GPIO 18. This is a fundamental control method for robotic arms, camera gimbals, and automatic door mechanisms.

4.3(29)
42
ESP32 RFID Door Lock (RC522 + Servo + OLED + Buzzer + LED)
#137Advanced
Premium

ESP32 RFID Door Lock (RC522 + Servo + OLED + Buzzer + LED)

We build a smart door lock with an ESP32, an RC522 RFID module, an SG90 servo, an SSD1306 OLED display, an active buzzer and 2 LEDs. When a card is scanned, its UID is checked against the authorized cards defined in the code; if it matches, the servo unlocks (green LED + 2 short beeps) and locks again after 5 seconds. An unknown card lights the red LED, gives 3 quick beeps and shows its UID on the OLED.

4.8(9)
15
Arduino Mini Radar (Servo + HC-SR04 + OLED Display)
#162Intermediate
Premium

Arduino Mini Radar (Servo + HC-SR04 + OLED Display)

A movie-style radar from a distance sensor and a servo! The SG90 servo sweeps the HC-SR04 from 0 to 180 degrees while the 0.96 inch OLED draws a rotating sweep line and shows detected objects as dots. When something enters the range, the passive buzzer pings, and the pitch rises as the object gets closer. Servo control, ultrasonic measurement, trigonometry-based drawing and tone() sound in one project.

1
Arduino Tilt-Controlled Digital Sand (MPU-6050 + 8x8 NeoPixel Matrix)
#163Intermediate
Premium

Arduino Tilt-Controlled Digital Sand (MPU-6050 + 8x8 NeoPixel Matrix)

LED sand that flows whichever way you tilt the circuit! The MPU-6050 accelerometer measures the tilt, and 24 grains on the 8x8 NeoPixel matrix fall toward gravity and pile up at the edges like real sand. A theme button switches between sand, water, lava and rainbow colors. Library-free I2C reading, turning tilt into a gravity direction and a simple falling-sand algorithm in one project.

Arduino Ultrasonic Theremin (HC-SR04 + NeoPixel Ring + Buzzer)
#165Intermediate
Premium

Arduino Ultrasonic Theremin (HC-SR04 + NeoPixel Ring + Buzzer)

A musical instrument you play without touching it, just by moving your hand in the air! As your hand gets closer to the HC-SR04, the passive buzzer plays higher notes and the 24-LED NeoPixel ring shows each note with color and fill level. A button switches between two modes: in SCALE mode every distance snaps to a note of a pentatonic scale, and in GLIDE mode the sound slides smoothly like an old sci-fi movie. Your hand writes the melody, not the code.

Raspberry Pi Pico Parking Barrier (SG90 Servo + 2 LEDs + Button + Buzzer)
#172Beginner
Premium

Raspberry Pi Pico Parking Barrier (SG90 Servo + 2 LEDs + Button + Buzzer)

A small model of the boom barrier at a car park entrance! Press the button and the Raspberry Pi Pico raises the arm smoothly with an SG90 servo as the green LED comes on. It stays open for 3 seconds, then lowers slowly with a flashing red LED and warning beeps from the buzzer. Press again while it is lowering and the arm rises at once for safety. Servo control, a state machine and non-blocking timing in one project.

Raspberry Pi Pico Keypad Lock (4x4 Keypad + I2C LCD + Servo)
#175Intermediate
Premium

Raspberry Pi Pico Keypad Lock (4x4 Keypad + I2C LCD + Servo)

A 4-digit code opens the door, and three wrong tries mean a 30 second wait! The Raspberry Pi Pico checks the PIN typed on a 4x4 keypad: if it's right, an SG90 servo unlocks and relocks by itself after 5 seconds. An I2C LCD shows the stars, the tries left and the countdown, and a buzzer beeps on every key. The default PIN is 1234; change it with the A key and the new one is saved to pin.txt.

Arduino Tilt Marble Maze (MPU-6050 + MAX7219 8x8 LED Matrix)
#179Intermediate
Premium

Arduino Tilt Marble Maze (MPU-6050 + MAX7219 8x8 LED Matrix)

No screen, no joystick: tilt the circuit and an LED marble rolls through a maze! The MPU-6050 accelerometer measures the tilt, and the marble on the MAX7219 8x8 LED matrix rolls that way without passing through walls. Reach the goal and a passive buzzer plays a tune as the next maze opens; finish all 3 for a smiley. Library-free sensor reading, tilt-to-speed control and mazes written as text in one project.

Raspberry Pi Pico Sun Tracking Panel (2 LDRs + SG90 Servo)
#183Intermediate
Premium

Raspberry Pi Pico Sun Tracking Panel (2 LDRs + SG90 Servo)

A panel that finds the sun on its own! The Raspberry Pi Pico measures light with 2 LDRs on either side of the panel, and an SG90 servo turns it toward the brighter side. A big difference turns it fast, a small one slowly, and it eases to a stop once both sides match. At night the panel swings back east to wait for sunrise. A ready-made experiment for science fairs and school projects.

Arduino Touchless Trash Can (HC-SR04 + SG90 Servo + LED)
#184Beginner
Premium

Arduino Touchless Trash Can (HC-SR04 + SG90 Servo + LED)

Wave your hand and the lid opens by itself! When the HC-SR04 ultrasonic sensor sees your hand closer than 15 cm, an SG90 servo lifts the lid in half a second and an LED lights up. Once the hand is gone, the lid waits 3 s and closes slowly. If the sensor detects a hand while the lid is closing, it reopens; contact is still possible because of measurement delays or an undetected hand. A school project favourite that is genuinely useful at home.

Raspberry Pi Pico Shake Dice (MPU-6050 + OLED Display + Buzzer)
#195Intermediate
Premium

Raspberry Pi Pico Shake Dice (MPU-6050 + OLED Display + Buzzer)

Lost your dice? No problem: shake the circuit and the die rolls on a 0.96 inch OLED! An MPU-6050 accelerometer senses the shake, the die wobbles and spins, and once you stop it slows down and lands on a face. The MODE button switches between one die and two; roll a double and the screen flashes while the buzzer plays a celebration tune. The Raspberry Pi Pico reads the sensor straight over I2C, no library needed.

Raspberry Pi Pico PIR Motion Alarm (PIR Sensor + Buzzer + LED)
#207Beginner
Premium

Raspberry Pi Pico PIR Motion Alarm (PIR Sensor + Buzzer + LED)

Walk in once and you get a warning, walk in again and the siren goes off! We are building a two-stage motion alarm with a Raspberry Pi Pico and a PIR motion sensor. It arms itself after a countdown. The first motion plays a ding-dong warning on the buzzer; a second motion within 15 seconds sounds the siren and strobes the LED. Afterwards it re-arms on its own and logs every event with a timestamp.

Arduino Tilt Arrow (MPU-6050 + MAX7219 8x8 LED Matrix)
#208Intermediate
Premium

Arduino Tilt Arrow (MPU-6050 + MAX7219 8x8 LED Matrix)

Tilt the circuit and the arrow turns to follow! We are building a tilt arrow that points downhill with an Arduino, an MPU-6050 accelerometer and a MAX7219 8x8 LED matrix. The arrow turns in 8 directions, grows as the tilt increases and blinks when it gets very steep. When the circuit is level, a pulsing level sign appears, and the angle and direction are printed to the serial monitor too.

Arduino Hourglass (2x MAX7219 8x8 LED Matrix + MPU-6050)
#209Intermediate
Premium

Arduino Hourglass (2x MAX7219 8x8 LED Matrix + MPU-6050)

The sand is not real, but flip it and it runs back! We are building a digital hourglass with an Arduino, two MAX7219 8x8 LED matrices and an MPU-6050. Grains in the upper bulb drop one by one through a narrow neck and pile up below. Flip it and the sand flows back, lay it flat and it pauses; when time is up, the lower bulb blinks.

Arduino Product Turntable (NEMA 17 Stepper Motor + A4988 + LCD)
#215Intermediate
Premium

Arduino Product Turntable (NEMA 17 Stepper Motor + A4988 + LCD)

Build your own turntable for product photos and 360-degree videos! A NEMA 17 stepper is driven by an A4988 from just two signals and speeds up and slows down smoothly, so the product never wobbles. There are three modes: continuous spin with the speed on a pot, photo 360 that splits a turn into 12, 24 or 36 stops with a beep at each one, and a showcase-style ±90° swing. The I2C LCD shows speed, angle and shot count.

Arduino Penalty Shootout Game (Servo Goalkeeper + TM1637 Display)
#218Beginner
Premium

Arduino Penalty Shootout Game (Servo Goalkeeper + TM1637 Display)

A 5-shot penalty shootout on your desk! After a 3-2-1 beep and a whistle you shoot with the left, middle or right button, and the SG90 servo keeper dives to a corner at the same moment. The keeper learns: keep shooting at the same corner and it starts diving there more often. The score is on the TM1637 display, the ball's corner on the LEDs, and the goal tune comes from a passive buzzer. Randomness, weighted odds and servo control in one game.

ESP32 Egg Incubator Controller (DHT22 + Relay + Servo + OLED)
#219Intermediate
Premium

ESP32 Egg Incubator Controller (DHT22 + Relay + Servo + OLED)

Hand the hen's job to an ESP32! The DHT22 measures temperature and humidity, a relay switches the heater with hysteresis, an SG90 servo gently tilts the egg tray every 3 hours, and the 0.96 inch OLED shows the day counter, a temperature graph and alarms. Chicken, quail and duck profiles are built in, and turning stops by itself for the last 3 days. If the sensor fails, the heater switches off for safety.

Raspberry Pi Pico Record-and-Replay Robot Arm (3 Servos + Joystick)
#222Intermediate
Premium

Raspberry Pi Pico Record-and-Replay Robot Arm (3 Servos + Joystick)

Show it a move once and the robot arm repeats it on its own! The Raspberry Pi Pico drives the base, shoulder and gripper with three SG90 servos; a joystick steers the arm and a click opens or closes the gripper. Press RECORD and the motion is saved every 100 ms; press PLAY and the arm follows the same path once or on a loop, at x1, x2 or x0.5 speed. The "teach and repeat" method of factory robots, right on your desk.

Arduino Smart Car Park (2x HC-SR04 + Servo Barrier + I2C LCD)
#224Intermediate
Premium

Arduino Smart Car Park (2x HC-SR04 + Servo Barrier + I2C LCD)

The barrier rises when a car arrives and stays down when the car park is full! An HC-SR04 at the entry and one at the exit detect cars, an SG90 servo lifts the barrier arm smoothly and an I2C LCD shows the free spaces and a fill bar. When it is full, the red LED lights, and a barrier that sees a car under it while lowering goes back up. The counter is kept in EEPROM; perfect for a smart city school project.

Raspberry Pi Pico Automatic Pet Feeder (SG90 Servo + TM1637 + Buzzer)
#225Beginner
Premium

Raspberry Pi Pico Automatic Pet Feeder (SG90 Servo + TM1637 + Buzzer)

Going on holiday? Your fish, cat or bird won't go hungry! The Raspberry Pi Pico counts down to the next meal on a TM1637 display; when time is up, the buzzer plays a short tune and the SG90 servo opens and closes the hopper lid once per portion. Pick an interval of 4, 6, 8, 12 or 24 hours, and a double-feed guard stops accidental overfeeding. Settings are saved, so after a power cut the countdown carries on.

ESP32 Smart Curtain (NEMA 17 + A4988 + LDR + OLED)
#226Intermediate
Premium

ESP32 Smart Curtain (NEMA 17 + A4988 + LDR + OLED)

The curtain opens by itself when the sun comes up and closes after dark! An LDR measures the light, an A4988 driver turns a NEMA 17 stepper with a soft start and stop, and the 0.96 inch OLED shows a window drawing, how open the curtain is and a sun or moon. Two buttons open and close it by hand, and holding one stops it halfway. The position is saved to flash, so after a power cut the curtain knows where it is.

Raspberry Pi Pico Cowboy Duel (2 SG90 Servos + TM1637 + Buzzer)
#230Intermediate
Premium

Raspberry Pi Pico Cowboy Duel (2 SG90 Servos + TM1637 + Buzzer)

A two-player reflex duel: a western whistle plays, the yellow LED lights up at a random moment and the first to press wins! The Raspberry Pi Pico knocks the loser's cardboard cowboy down with an SG90 servo and makes the winner's wave; a TM1637 display shows the reaction time in milliseconds. Press before the LED and you shoot your own cowboy. First to 3 points is champion, and the fastest reaction is saved as the record.

Arduino 3-Floor Elevator (NEMA 17 Stepper Motor + A4988 + Servo Door + TM1637)
#236Intermediate
Premium

Arduino 3-Floor Elevator (NEMA 17 Stepper Motor + A4988 + Servo Door + TM1637)

Build a model elevator that steals the show at the science fair! A NEMA 17 stepper driven by an A4988 lifts and lowers the cabin smoothly; at each floor it plays a "ding-dong", an SG90 servo opens the door and closes it after three warning beeps. Calls are served like in a real elevator: floors ahead first, then the way back, and the cabin stops for calls on the way. The TM1637 display shows the direction arrow, floor and door state.

ESP32 Weather Needle (Servo + WS2812B LED Ring + OLED)
#237Intermediate
Premium

ESP32 Weather Needle (Servo + WS2812B LED Ring + OLED)

A gauge that shows the weather with a needle and light instead of text! Over Wi-Fi the ESP32 fetches the current weather of six cities in one request; an SG90 servo needle points at sunny, partly cloudy, cloudy, rain or snow-storm on a card. A 24-LED ring shows the temperature as color and the weather as animation, and a 0.96 inch OLED shows city, temperature and wind. A button changes the city; hold it for a demo.

Arduino Light Saber (MPU-6050 + WS2812B LED Strip + Buzzer)
#239Intermediate
Premium

Arduino Light Saber (MPU-6050 + WS2812B LED Strip + Buzzer)

Press the button and the light shoots from the hilt to the tip with a "vzzz"! A 30-LED WS2812B strip is the blade, an MPU-6050 measures how fast the sword turns and when it hits something, and a passive buzzer plays the hum. Swing it and the hum rises while the blade glows brighter; hit something and it flashes white with a crackle. A long press cycles through six colours, and your pick is remembered after power-off.

ESP32 Drumming Robot (2 Servos + OLED + Buzzer)
#240Intermediate
Premium

ESP32 Drumming Robot (2 Servos + OLED + Buzzer)

A little robot that plays the drums on your desk! Two SG90 servo arms become drumsticks and hit a box or a cup, while a passive buzzer adds the bass hits and a click on each bar. There are 6 rhythms, including rock, disco, march, halay, çiftetelli and 9/8; a potentiometer sets the tempo from 60 to 180 BPM and tapping the TAP button in time teaches the robot your speed. A 0.96 inch OLED shows a 16-step grid with a moving cursor.

Raspberry Pi Pico Timelapse Camera Slider (NEMA 17 + A4988 + KY-040 + OLED)
#241Intermediate
Premium

Raspberry Pi Pico Timelapse Camera Slider (NEMA 17 + A4988 + KY-040 + OLED)

Build your own slider for cinematic sliding shots! The Raspberry Pi Pico turns a NEMA 17 stepper very slowly and smoothly through an A4988 driver, and the carriage carries a phone or camera along a rail. With a KY-040 encoder you pick the mode, distance, time, direction and frame count from a menu. In VIDEO mode the carriage eases in and out; in TIMELAPSE mode it stops at every frame and waits for the shake to settle. The OLED shows progress and time left.

Arduino IR Remote Pan-Tilt Head (2 Servos + I2C LCD + Remote)
#243Intermediate
Premium

Arduino IR Remote Pan-Tilt Head (2 Servos + I2C LCD + Remote)

A two-axis head you steer with a TV remote! The lower SG90 servo pans the head left and right, the upper one tilts it up and down, and every press of an arrow key on the infrared remote moves it one step. MENU + 1-3 stores up to three poses, a number key glides the head back to one, and PLAY patrols between them. An I2C LCD shows the angles, and the poses stay in EEPROM.

Arduino Cheating Robot Hand: Rock Paper Scissors (5 Servos + 3 Buttons + LCD)
#300Intermediate
Premium

Arduino Cheating Robot Hand: Rock Paper Scissors (5 Servos + 3 Buttons + LCD)

Five servos bend five fingers, so the robot hand makes rock, paper or scissors while you play with three buttons. An I2C LCD counts "3, 2, 1, SHOOT!", shows both picks and the score, and a buzzer beeps on every beat. In normal mode the hand picks at random and plays fair. Hold two buttons together and a secret cheat mode turns on: the hand sees your press and makes the winning shape at the same moment. At the end of the match it even confesses.

Arduino Biting Crocodile: Which Tooth? (8 Buttons + Servo Jaw + Buzzer)
#308Beginner
Premium

Arduino Biting Crocodile: Which Tooth? (8 Buttons + Servo Jaw + Buzzer)

A party game in the style of the classic biting-crocodile toy: eight buttons are the crocodile's teeth and an SG90 servo is its upper jaw. Each round one tooth is secretly cursed. You take turns pressing teeth; a safe tooth clicks and the jaw twitches a little. Whoever presses the cursed tooth gets bitten: the jaw snaps shut, the red eye lights up and the buzzer growls. As fewer teeth are left, the green eye blinks faster and faster.

Pico W IoT Motion Counter (PIR)
#377Beginner
IoT

Pico W IoT Motion Counter (PIR)

Count how many times someone walks through a door or hallway, and see the moment of motion live on your phone. This project is the step-by-step guide to the Motion detector IoT template in the app, built with a Raspberry Pi Pico W and a PIR motion sensor using just 3 wires. Go to Workshop › Devices › Add a device; Ohmi prepares the code with your own device key. The code on this page is an example: the key and Wi-Fi details are placeholders.

ESP32 IoT Curtain Opener (SG90 Servo)
#378Intermediate
IoT

ESP32 IoT Curtain Opener (SG90 Servo)

Tap + or − on your phone and the servo turns to that angle at the same moment: open and close a model curtain, a blind's tilt rod or a small lid from wherever you are. This project is the step-by-step guide to the Servo curtain IoT template in the app, built with an ESP32 and an SG90 servo using just 3 wires. Go to Workshop › Devices › Add a device; Ohmi prepares the code with your own device key. The code on this page is an example: the key and Wi-Fi details are placeholders.

3
ESP32-CAM Camera That Takes Photos When It Sees Motion (PIR + microSD)
#380Intermediate
Premium

ESP32-CAM Camera That Takes Photos When It Sees Motion (PIR + microSD)

A battery-powered motion camera for a bird box or the front door. When the HC-SR501 PIR sees motion, the ESP32-CAM wakes from deep sleep, takes three photos and saves them in order on the board's own microSD slot as foto_0001.jpg, foto_0002.jpg. The photo number lives in EEPROM, so the order survives a battery change. When the motion is over the board goes back to sleep; no Wi-Fi or app needed.

ESP32-CAM Telegram Security Camera
#381Advanced
Premium

ESP32-CAM Telegram Security Camera

When your door opens or something moves in the room, the ESP32-CAM takes a photo and your Telegram bot sends it to your phone. A reed switch and magnet guard the door, a PIR HC-SR501 watches the room. Type /photo to the bot for a photo on demand; /flash on, /alarm off and /status run the camera from anywhere. The bot only listens to your own chat id. You get the token from @BotFather; the steps are in the FAQ.

ESP32 Bluetooth Car (L298N)
#391Beginner
Bluetooth

ESP32 Bluetooth Car (L298N)

Drive a two-wheel car over Bluetooth with the joystick on your phone; no internet needed, works on iPhone and Android. This project is the step-by-step guide to the Car remote Bluetooth template in the app, built with an ESP32, an L298N and two motors. Go to Workshop › Devices › Add a device › Bluetooth, pick Car remote and upload the code from Get the code. The Set up as a Bluetooth panel button on this page opens the wizard with this template.

ESP32 Bluetooth Servo Lock
#395Beginner
Bluetooth

ESP32 Bluetooth Servo Lock

Control an SG90 servo as a small latch from your phone over Bluetooth: lock, open or set the angle, no internet or Wi-Fi needed. This project is the step-by-step guide to the Servo lock Bluetooth template in the app, built with an ESP32, one servo and 3 wires. Go to Workshop › Devices › Add a device › Bluetooth, pick Servo lock and upload the code with Get the code. The Set up as a Bluetooth panel button on this page opens the wizard with this template too.

Blog

Other topics