Smart Home Projects: Alarms, Locks, Watering and Automatic Lighting

You can make your home smart with your own hands. In these projects you'll build motion alarms, card-operated locks, gas and fire alerts, automatic plant watering and lights that turn on in the dark. Always follow the safety warnings in projects that work with mains voltage.

Lighting 220V Bulb with Push Button
#19Advanced
Premium

Lighting 220V Bulb with Push Button

As long as you hold the button, a real 220-volt bulb stays lit, and it goes out the moment you let go. The Arduino's tiny signal cannot light the bulb directly, so a relay, an electrically controlled

4.4(30)
38
Lighting 220V Bulb with Button (On-Off)
#20Advanced
Premium

Lighting 220V Bulb with Button (On-Off)

Want to switch a real household bulb on and off with a tiny button? Each time you press the button, the Arduino flips a relay and the bulb lights up; press again and it goes off. The relay is a go-bet

4.5(33)
44
Lighting 220V Bulb with Remote Control
#21Advanced
Premium

Lighting 220V Bulb with Remote Control

Switch a real light bulb in your home on and off with a TV remote, without getting up from the sofa. The Arduino reads the invisible light signal from the remote; the power button clicks the relay and

4.4(22)
30
Laser Warning System
#22Intermediate
Premium

Laser Warning System

You set up an invisible beam fence, just like in the movies. A laser shines onto a light sensor on the other side; the moment someone walks through and breaks the beam, the LED lights up and the buzze

4.8(64)
83
Laser Security System
#23Advanced
Premium

Laser Security System

Just like the laser heist scenes in films: a laser beam shines on a light sensor, and the moment someone steps in and breaks the beam, the red LED lights up and the buzzer starts sounding. The alarm d

4.8(60)
77
Motion Detector with Motion Sensor
#24Beginner
Premium

Motion Detector with Motion Sensor

A simple guard that tells you when someone walks into the room. The motion sensor picks up the warmth given off by the human body, and the Arduino keeps the LED on as long as there is movement and tur

4.6(47)
67
Doorbell and Light with Motion Sensor
#25Intermediate
Premium

Doorbell and Light with Motion Sensor

When someone comes up to your door, you know before they even ring. As soon as the motion sensor spots someone, the LED lights up and the buzzer plays a three-note chime from high to low; when the tun

4.7(54)
72
Reading a Reed Switch
#37Beginner

Reading a Reed Switch

Ever wondered about the magnetic switch inside door and window alarms? When a magnet comes near the reed relay module, the tiny switch inside it closes; the Arduino reads it once a second and prints 0

4.4(21)
28
Reed Switch Door Sensor
#38Beginner
Premium

Reed Switch Door Sensor

Tell whether your door is open or closed just by looking at a light. You attach a small magnet to the door and a magnet-sensing switch to the frame; when the door is closed they sit side by side and t

4.7(34)
44
Using a Flame Sensor
#50Intermediate
Premium

Using a Flame Sensor

A little guard that spots fire before you do, in the kitchen or the workshop. The flame sensor picks up the invisible light that fire gives off; while all is well the green LED is on, and when it sees

4.6(33)
44
Using a Gas Sensor
#51Beginner
Premium

Using a Gas Sensor

A little guard that notices a gas leak in the kitchen before you do. The gas sensor keeps sniffing the air; while everything is fine the green LED stays on, and when the gas in the air passes a certai

4.6(37)
50
Flame and Gas Sensor Alarm
#52Advanced
Premium

Flame and Gas Sensor Alarm

A little guard that warns you right away when gas leaks or a flame appears somewhere. The gas sensor watches the air for gas and the flame sensor watches for the light of a fire; while everything is f

4.8(52)
67
RFID Value Reading
#53Beginner
Premium

RFID Value Reading

Your building key fob or access card hides a secret ID number, and this project reads it. Hold the card near the RFID reader and the Arduino writes the card's number to your computer screen. The first

4.7(47)
61
RFID Authentication
#54Intermediate
Premium

RFID Authentication

Just like the card entry at an apartment door: you hold your card near the RFID reader, and the Arduino compares its number with the one it has saved. The right card lights the green LED for three sec

4.8(64)
83
3x4 Keypad Operation
#61Beginner

3x4 Keypad Operation

The Arduino instantly knows which key you press on a 12-key keypad that looks like a phone dial pad, and writes it on your computer screen. The digits plus the star and hash keys sit in a grid of rows

4.5(24)
31
4x4 Keypad Operation
#63Beginner
Premium

4x4 Keypad Operation

On the 4x4 keypad, which looks a lot like a phone's buttons, the Arduino instantly knows which key you pressed and writes it to your computer screen. Besides the digits, it also recognises the letters

4.5(27)
35
Password Lock with 4x4 Keypad and LCD
#64Advanced
Premium

Password Lock with 4x4 Keypad and LCD

A small electronic door lock that keeps out anyone who doesn't know the code. You press the hash key and type the code on the keypad; if it is right, the screen says access granted, the green LED ligh

4.8(59)
75
Smart Stair and Corridor Lighting
#82Intermediate
Premium

Smart Stair and Corridor Lighting

Step onto the stairs or into the hallway and the lights come on one step at a time in the direction you are walking. There is a distance sensor at each end; whichever one you pass, the eight LEDs ligh

5.0(35)
51
Smart Irrigation Station
#83Advanced
Premium

Smart Irrigation Station

A gardener that waters your plants on its own, so they don't dry out while you're on vacation. A soil moisture sensor measures how wet the soil is; when it gets dry, the Arduino runs the water pump fo

5.0(42)
57
Smart Electronic Safe
#92Advanced
Premium

Smart Electronic Safe

A small safe for your valuables that opens with a code. You type your four-digit code on the keypad; if it is right, the servo motor opens the lock, the green light comes on and the screen shows the s

4.7(42)
63
Automatic Lighting with the ESP32 PIR Motion Sensor
#121Intermediate
Premium

Automatic Lighting with the ESP32 PIR Motion Sensor

In this project an HC-SR501 PIR motion sensor detects someone entering the room and turns on an LED automatically. millis() tracks how long the LED stays on: each HIGH reading refreshes the last-motion time, and the LED turns off at least 10 seconds after the last HIGH. The code also waits 50 ms with delay(50) in every loop, so the loop is not fully non-blocking. Great for stairs, hallways, bathrooms or closet lighting.

4.4(24)
38
ESP32 MQ-2 Gas/Smoke Detector Alarm
#122Intermediate

ESP32 MQ-2 Gas/Smoke Detector Alarm

In this project, combustible gas (LPG, methane, propane) and smoke detection is performed using an MQ-2 gas sensor module, and a siren-like alarm is played through a passive buzzer upon detection. The sensor's digital threshold output (DO) is connected to GPIO 4 on the ESP32; when gas or smoke exceeds the threshold, DO goes LOW and the alarm is triggered. Sensitivity is adjusted via the module's potentiometer. The passive buzzer is driven using tone() to produce a two-frequency siren effect.

4.7(28)
43
ESP32 RFID RC522 Card Reader (with LCD)
#123Intermediate

ESP32 RFID RC522 Card Reader (with LCD)

In this project, we will connect the MFRC522-based RC522 RFID module to the ESP32 via SPI and read the card/tag UID. This forms the basis for applications such as door locks, membership systems, and access control. We will display the read UID on an LCD screen; this version does not compare it with an authorized card list. WARNING: The RC522 operates only at 3.3V; supplying 5V will burn out the module!

4.8(21)
41
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
ESP32 Smart Lighting (PIR + LDR + Relay + OLED)
#141Advanced
Premium

ESP32 Smart Lighting (PIR + LDR + Relay + OLED)

With an ESP32, a PIR motion sensor, an LDR light sensor and a relay module, we turn your hallway, bathroom or pantry into smart lighting. If the room is already bright, the light stays off even when there is motion, so it never wastes energy during the day. The light stays on for 30 seconds, and the time extends automatically while motion continues.

4.3(6)
11
ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)
#145Advanced
Premium

ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)

A smart security alarm: when the PIR sensor detects motion, it sounds the buzzer, lights the LED and sends the owner an instant Telegram notification. A 30-second cooldown limits how often the alarm repeats; it does not filter out the PIR sensor's false detections. Use it at home, in a garage, a storeroom or a study.

9
ESP32 Pomodoro Timer (NeoPixel Ring + Button + Buzzer)
#167Beginner
Premium

ESP32 Pomodoro Timer (NeoPixel Ring + Button + Buzzer)

A glowing desk timer that keeps you off your phone while you study! The 24-LED NeoPixel ring shows the time left like a clock face: work is red, short breaks are green and the long break after every four sessions is blue. In the last 5 seconds the ring flashes and the passive buzzer ticks, then a rainbow celebrates the finished phase. One button starts, pauses and resets, all on an ESP32 without a single delay().

Raspberry Pi Pico LED Campfire (8x8 NeoPixel Matrix + Potentiometer + Buzzer)
#169Intermediate

Raspberry Pi Pico LED Campfire (8x8 NeoPixel Matrix + Potentiometer + Buzzer)

A campfire that doesn't burn or warm anything, but still crackles! The Raspberry Pi Pico draws a realistic flame on an 8x8 NeoPixel matrix, recalculated every frame: sparks appear at the base, heat cools as it rises and glows from red to white. A potentiometer sets the flame height, a button switches between Fire, Gas, Magic and Amethyst themes, and a buzzer adds the crackle of burning wood. Procedural animation, ADC, PWM and MicroPython in one project.

1
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.

ESP32 Earthquake Shake Alarm (MPU-6050 + OLED Display + Buzzer)
#180Intermediate
Premium

ESP32 Earthquake Shake Alarm (MPU-6050 + OLED Display + Buzzer)

When your desk shakes, this screen notices first! The ESP32 measures vibration with an MPU-6050 accelerometer and draws a live trace that scrolls like a seismograph on a 0.96-inch OLED display. When the shaking passes the threshold, a passive buzzer sounds a siren and the red LED flashes; one button silences and resets it. It is an educational shake meter, not an official earthquake warning.

ESP32 Prayer Time Clock (Wi-Fi + OLED Display + Buzzer)
#182Intermediate
Premium

ESP32 Prayer Time Clock (Wi-Fi + OLED Display + Buzzer)

How long until Maghrib? The ESP32 gets the time from the internet, pulls your city's prayer times using the Diyanet method and shows the next prayer with a big countdown on a 0.96 inch OLED. When the time comes, a passive buzzer plays a short, gentle chime. Press the button to list all of today's times, or hold it to try the alert right away in demo mode.

1
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.

Arduino Kitchen Scale (HX711 + Load Cell + I2C LCD)
#186Intermediate
Premium

Arduino Kitchen Scale (HX711 + Load Cell + I2C LCD)

Put the bowl on, press the button, zero! A real kitchen scale with an HX711 amplifier and a 5 kg load cell: the I2C LCD shows the weight in grams or ounces, with a fill bar on the second row. One button does two jobs: a short press tares, a long press switches between g and oz. At 5 kg an overload warning appears. Calibration, a moving average and short/long presses in one project.

Arduino Smart Thermostat (DHT22 + Relay + I2C LCD)
#187Intermediate
Premium

Arduino Smart Thermostat (DHT22 + Relay + I2C LCD)

Room at 19 degrees, target 21: the relay clicks on! The DHT22 measures the temperature, and when it drops below the target the relay turns the heater on. Thanks to hysteresis, the relay does not keep clicking around the target. Two buttons set the target in 0.5 °C steps, and it is kept in EEPROM; the I2C LCD shows temperature, humidity and heater state. The basics of real home automation in one project.

5.0(1)
1
Raspberry Pi Pico IR Remote Control for an LED and a Relay (IR Receiver + Relay + LED)
#206Intermediate
Premium

Raspberry Pi Pico IR Remote Control for an LED and a Relay (IR Receiver + Relay + LED)

Turn the light on with a remote! We are building a remote-controlled LED and socket with a Raspberry Pi Pico, an IR receiver and a relay. 1 toggles the relay, 2 the LED; + and − change the LED brightness in 5 steps, PLAY starts a breathing mode and 3 runs the relay on a timer. NEC codes are decoded without a library, from pulse times measured with an interrupt.

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.

Raspberry Pi Pico Alarm Desk Clock (DS1307 + TM1637 + Buzzer)
#211Intermediate
Premium

Raspberry Pi Pico Alarm Desk Clock (DS1307 + TM1637 + Buzzer)

A desk clock that keeps time even through a power cut! The Raspberry Pi Pico reads the time from a battery-backed DS1307 real-time clock, and a TM1637 display shows hours:minutes with a blinking colon. When the alarm time comes, the buzzer plays double beeps and the display pulses; one button snoozes it for 5 minutes. The alarm lives in the DS1307's battery-backed memory, and the display dims itself at night.

ESP32 Smart Lamp with Rotary Encoder Menu (KY-040 + OLED + NeoPixel Ring)
#214Intermediate
Premium

ESP32 Smart Lamp with Rotary Encoder Menu (KY-040 + OLED + NeoPixel Ring)

One knob, five settings! Turn the KY-040 rotary encoder to scroll the menu on the 0.96 inch OLED, press it to edit the color, brightness, effect, sleep timer or warm-cool white. The 24-LED NeoPixel ring shows every change instantly. Settings live in the ESP32 flash, so after a power cut the lamp comes back exactly as you left it. Interrupt-based encoder reading and a menu UI in one project.

Raspberry Pi Pico W Phone-Controlled RGB Lamp (NeoPixel Ring + OLED + Button)
#216Intermediate
Premium

Raspberry Pi Pico W Phone-Controlled RGB Lamp (NeoPixel Ring + OLED + Button)

Pick a color on your phone and the lamp on your desk switches to it instantly! The Raspberry Pi Pico W joins Wi-Fi and listens for commands on a public MQTT broker, so any MQTT app on your phone can change the color, brightness and effect of a 24-LED NeoPixel ring. The OLED shows the connection and the last command. A local button works even without internet, and the last setting survives a power cut.

Raspberry Pi Pico W Door Alarm with Phone Notifications (HC-SR04 + OLED + Buzzer)
#217Intermediate
Premium

Raspberry Pi Pico W Door Alarm with Phone Notifications (HC-SR04 + OLED + Buzzer)

A home alarm that sounds a siren and pings your phone when the door opens! The Raspberry Pi Pico W joins your home Wi-Fi, and an HC-SR04 facing the door notices the change in distance as it opens. You arm it with a button; when the door opens, a 5-second entry delay starts, and if nobody disarms it the buzzer wails, the red LED flashes and an urgent notification goes out. The OLED shows the state, countdown, clock and send result.

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 Water Tank Level Gauge and Automatic Pump (HC-SR04 + OLED + Relay)
#220Intermediate
Premium

Raspberry Pi Pico Water Tank Level Gauge and Automatic Pump (HC-SR04 + OLED + Relay)

A smart gauge that measures the water level without ever touching the water! An HC-SR04 measures the distance from the tank lid to the water, and the Raspberry Pi Pico turns it into percent and liters. At 20% the relay starts the pump and stops it at 95%; if no water comes or the tank overflows, the buzzer sounds an alarm. The OLED shows a rippling tank drawing, the flow rate and the time left to fill.

Arduino Automatic School Bell (DS1307 + I2C LCD + Relay)
#221Intermediate
Premium

Arduino Automatic School Bell (DS1307 + I2C LCD + Relay)

Now the Arduino rings the school bell! A DS1307 keeps the time, and the lesson, break, lunch and home-time bells ring on their own from a schedule table. A relay drives the real bell, a buzzer plays a different tune for each bell type and an I2C LCD counts down to the next bell. It also has exam and holiday modes, a manual bell, clock setting with two buttons and the Turkish National Anthem for the Monday and Friday ceremonies.

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.

Arduino IR Remote Ambient Light (24-LED NeoPixel Ring + Remote)
#227Beginner
Premium

Arduino IR Remote Ambient Light (24-LED NeoPixel Ring + Remote)

Just like the remote of a home LED strip, except you code the light! With an infrared remote you change the colour, brightness and effect of a 24-LED WS2812B ring. Number keys pick 10 colours, next/prev step through 8 effects such as breath, rainbow, comet and candle, and C sets a sleep timer. The last setting is kept in EEPROM, and the buzzer answers every key with a short beep.

ESP32 Ambient TV Backlight (ILI9341 TFT + WS2812B LED Strip)
#229Intermediate
Premium

ESP32 Ambient TV Backlight (ILI9341 TFT + WS2812B LED Strip)

A TV backlight that spills the colors of the screen edges onto the wall! A 2.8 inch ILI9341 display plays the TV with six scenes; the ESP32 averages the color of each edge zone and sends it to a 34-LED WS2812B strip along the left, top and right. Exponential smoothing and gamma correction keep the fades soft, a potentiometer sets the brightness and a button switches between demo, warm white, colors from the computer and off.

Blog

Other topics