Arduino: build a line-following robot
A 2WD robot that follows a black electrical-tape line using three IR reflectance sensors. Bang-bang control done honestly, PID optional.
Tag
43 tutorials
A 2WD robot that follows a black electrical-tape line using three IR reflectance sensors. Bang-bang control done honestly, PID optional.
Build a traffic light with a pedestrian crossing button using a proper state machine. The project that teaches event timing without delay().
Build the Simon memory game with 4 buttons, 4 LEDs, and a buzzer. State machines, tone(), and the game loop that scales to any difficulty.
A real outdoor-style light: PIR triggers, an LDR confirms it is dark, a relay drives a 12V lamp. The AND logic that stops false triggers.
A 2WD robot that chases a flashlight beam using two LDR eyes and bang-bang steering. Phototaxis for twelve dollars of parts.
Read a 4x4 keypad with 8 Arduino pins instead of 16 by scanning rows and columns. The matrix-scan trick behind every keyboard ever made.
Drive an 8x8 LED matrix with a MAX7219 and Arduino. Build frame-based animations: a smiley, a wave, and a scrolling pixel text. One chip, three wires.
Give your Arduino a real clock with the DS3231 RTC module. Set the time, read it back, and fire alarms that survive power loss, drift, and reboot.
Drive an Arduino over Bluetooth from an Android app you build yourself with MIT App Inventor, no Java, one HC-06 module, two-way control.
Build a desk clock that never drifts: a DS3231 RTC keeps time, a 0.96 inch SSD1306 OLED shows it big. Two I2C devices on the same two wires, plus a button to set it.
Two Arduinos talking over 2.4 GHz with nRF24L01 modules, no WiFi, no phone, one capacitor and a library. Sensor links that run for months.
Roll a die with a button press: a 7-segment display shows 1 to 6 with a tumble animation. Direct-drive wiring, a segment map, and honest randomness on the Uno.
Put an Arduino on your LAN with a W5500 Ethernet module and serve sensor pages from any browser. The wired path when Wi-Fi drops, roams, or is not allowed.
Read latitude, longitude, and the exact UTC time from a $12 NEO-6M GPS module over serial. Wiring, the TinyGPS++ library, and why the fix takes 5 minutes outside.
Turn a $8 load cell into a working digital scale with the HX711 amp and an Arduino Uno. Wiring, the calibration step everyone skips, and 1 g resolution.
Wire a 3-pin IR receiver to an Arduino and decode any TV or AC remote with the IRremote library. NEC, Sony, RC5, and the switch statement that turns buttons into actions.
A 2WD Arduino robot that drives forward and dodges what is in front of it, using an HC-SR04 on a servo and an L298N driver. The full build, wiring to behavior.
Wire a K-type thermocouple and a MAX6675 to an Arduino and read oven, kiln, and solder-pot temperatures up to 1024 C. Includes the polarity trap.
Measure total dissolved solids with the Gravity TDS module on an Arduino: clean wiring, temperature compensation, calibration, and what TDS cannot tell you.
Voice control on Arduino without the cloud: the DF2301Q offline voice module drives lights and sounds, and a DFPlayer Mini gives the project a voice back.
Build an MQ-2 gas and smoke alarm on an Arduino: wiring, warm-up, calibration, buzzer code, and the honest limits of a DIY detector.
The PID line-follower: three TCRT5000 analog sensors feed one weighted error signal, and the robot steers in proportion to how far off the line it is.
Detect motion through walls and plastic with the RCWL-0516 microwave radar module. Doppler sensing that ignores temperature, sunlight, and thin drywall.
Log sensor readings to an SD card with real timestamps from a DS3231 RTC. CSV files your spreadsheet opens directly, and a clock that survives power cuts.
Sniff, decode, and replay 433 MHz RF remotes (wireless doorbells, plug sockets) with a superheterodyne receiver and RCSwitch. One Arduino, two boards.
Wire a TM1637 4-digit 7-segment display to an Arduino and print numbers, a clock, and a scrolling counter. Two pins, one library, no soldering.
Install the arduino-pico core, upload a blink sketch, and learn when the Pico deserves C++ instead of MicroPython: interrupts, timing precision, and memory headroom.
Save a calibration value or a small setting to EEPROM so it survives a power cycle. The 1 KB on the Uno is enough for hundreds of values if you use it carefully.
Wire a rotary encoder to two interrupt pins and track position, direction, and speed. The pattern that lets a motor know where it is.
Wire an L298N module to an Arduino and control a DC motor forward, reverse, and at variable speed with PWM. The H-bridge pattern that runs most hobby robots.
Wire a button to an interrupt pin and react to it instantly. The pattern that makes pin-change detection feel like magic, and the rules you cannot break.
Wire an HC-SR04 to an Arduino and read distance in centimeters. The 40 kHz chirp, the trigger pulse, the echo timing, and the math that turns a microsecond count into a number you can use.
Add a watchdog timer to your Arduino sketch so the chip resets itself when it hangs. The pattern that keeps field-deployed projects from being bricked by a stuck sensor.
Set up the Arduino IDE for ESP32 the way that does not break six months from now. Boards manager URLs, USB drivers, and the port detection traps.
Wire a small stepper motor to an Arduino using the ULN2003 driver board. Precise position control without the expensive hardware.
Drive a relay module from an Arduino to switch mains-powered devices. The most common home automation building block, with all the safety stuff included.
Add a 16x2 character LCD to your Arduino using the I2C backpack. Show text, custom characters, and read sensor values on a screen.
Wire a DS18B20 temperature sensor to an Arduino using the OneWire protocol. Multiple sensors on one pin, accurate to 0.5C.
I2C is the two-wire protocol that connects most Arduino sensors. This tutorial covers the wiring, the address scan, and the most common gotchas.
Drive a hobby servo (SG90, MG996R) from an Arduino. The shortest path from Arduino to 'something moved.'
Wire a 10k potentiometer to an Arduino analog pin and read its position with analogRead. The second project after blink.
Wire a DHT22 to an ESP32, install the library, and stream readings over Serial every 2 seconds. The shortest useful ESP32 project.
The minimum Arduino sketch. Blink the onboard LED on pin 13. If you have never programmed an Arduino, start here.