Arduino Sensor Projects: Temperature, Distance, Gas and Light
Sensors are the Arduino's eyes, ears and nose. In these projects you'll learn to measure temperature and humidity, distance, light, motion, gas and flame. Each project explains step by step how to wire the sensor, read its values and choose threshold values.

Measuring Light Intensity with an LDR
Want to see how bright your room is as a number? The LDR, a small part that reacts to light, measures the light around it, and the Arduino writes the value to your computer screen every half second. C

Night Light with Ldr
A little night light that turns on by itself when it gets dark and goes off when morning comes. A light sensor measures how bright the room is, and the Arduino switches the LED on when it is dark enou

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

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

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

HC-SR04 Distance Measurement (Serial Display)
The HC-SR04 sensor works just like a bat finding its way in the dark: it sends out a sound you cannot hear, listens for the echo and measures how far away the object in front of it is. The Arduino wri

Parking Sensor with HC-SR04
A mini version of a car's parking sensor: the closer something gets, the faster the beeps. The distance sensor measures the object in front of it; if it is more than 20 centimetres away the green LED

Measuring Distance Using LCD Display
A tool that measures distance without a ruler: move your hand back and forth in front of the sensor and watch the number change. The HC-SR04 sends out a sound wave and listens for its echo, and the Ar

Using LCD Screen with I2C
Give your Arduino its own screen and make it write its first message. The two-line LCD screen hooks up with just a few wires; a greeting appears on the top line, then a second message on the bottom li

Height Measurement Project
A height meter that hangs from a door frame and tells you, in centimetres, how tall the person standing under it is. First you press the first button with nobody underneath, and the distance sensor me

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

Temperature Measurement with NTC and 2x16 Lcd Display
Measure the temperature around you with a sensor that looks like a tiny bead. This part, called an NTC, lets electricity through more easily as it warms up; the Arduino reads that change, turns it int

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

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

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

Temperature and Humidity with DHT11
How warm is your room, and is the air humid or dry? The DHT11 sensor measures temperature and humidity, and the Arduino writes the values on a two-line LCD screen, refreshing every couple of seconds.

Digital Voltmeter with LCD Display
Find out how much voltage a battery or power adapter gives with a meter you built yourself. A divider made of two resistors brings high voltage down to a level the board can read, and the Arduino calc

Reading Reflection (Proximity) with TCRT5000
With a small sensor that sends out invisible light and measures how much bounces back, you can detect the surface in front of it. The closer an object or a light-coloured surface gets, the more light

TCRT5000 Black and White Surface Detection
With the little sensor that acts as the eye of line-following robots, you can tell whether the floor is black or white. The TCRT5000 shines invisible light at the floor and checks how much of it bounc

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

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

Dot Matrix Clock, Calendar and Weather Station (MAX7219, DS1307)
A scrolling-text board for your desk or wall that shows the time, the date and the room's weather in turn. On the 8x32 LED display you first see the temperature in both Celsius and Fahrenheit, then th

ESP32 Night Light with LDR
Night light where the LED automatically turns on in the dark and off in the light. The D0 (digital out) pin of the LDR Sensor Module is used - the dark threshold is set with the small potentiometer on the module, the module itself generates the HIGH/LOW output. ESP32 just reads this signal with digitalRead(), the code is very simple.

Reading Light Intensity with the ESP32 LDR Module
Real-time monitoring of the LDR module's raw ADC value and relative light percentage calculated from dark and light reference values in the Serial Monitor. This percentage is not a lux measurement. Teaches the module’s calibration logic. It is ideal to complete this before Project 10, as it is used to determine the threshold value.

ESP32 HC-SR04 Ultrasonic Distance Sensor
The HC-SR04 ultrasonic sensor measures distance by timing how long its sound pulse takes to bounce off an object and return (time of flight). In this project the ESP32 sends a 10-microsecond pulse to the TRIG pin and reads the echo time from the ECHO pin with pulseIn(). The distance is shown in cm on a 16x2 I2C LCD. The HC-SR04 runs on 5V, so the ECHO pin needs a voltage divider, or the ESP32's 3.3V GPIO gets damaged.

ESP32 DHT22 Temperature and Humidity (with LCD Display)
This project measures ambient temperature and humidity using a DHT22 sensor and displays the data in real time on a 16x2 I2C LCD. Data is read from the sensor using the one-wire protocol via the Adafruit DHT library. This project serves as the foundation for IoT weather stations, smart home automation, or environmental monitoring systems in greenhouses. Communication with the DHT22 is established via the ESP32's GPIO 4 pin.

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.

ESP32 Prayer Rakat Counter (HC-SR04 + SSD1306 OLED + 2 Buttons)
Do you sometimes lose track of which rakat you are on during prayer? This project is a rakat counter that sits next to your prayer mat and counts your prostrations when you bring your hand close. The HC-SR04 ultrasonic distance sensor detects your hand, the SSD1306 OLED display shows the count, and two buttons let you choose 2, 3 or 4 rakats and reset. A 2.5-second debounce and a "hand-away" check make sure no prostration is counted twice.

ESP32 Parking Sensor (HC-SR04 + 5-LED Bar + Buzzer + OLED)
The ESP32 version of a car parking sensor! The HC-SR04 ultrasonic sensor measures the distance to the object in front. As it gets closer, a 5-LED bar fills up (green → yellow → red) and the buzzer beeps faster. Very close (under 10 cm), a continuous alarm sounds and all LEDs light up. The SSD1306 OLED display shows the live distance in cm in large text, plus a status message.

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

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.

Raspberry Pi Pico Parking Sensor (HC-SR04 + 3 LEDs + Buzzer)
Bring your car's reverse parking sensor to your desk! The Raspberry Pi Pico uses an HC-SR04 ultrasonic sensor to measure the distance to an obstacle about 16 times a second. As it gets closer, the green, yellow and red LEDs light up in turn and the buzzer beeps faster; under 10 cm the tone turns continuous and the red LED flashes. Ultrasonic ranging, PWM sound and non-blocking timing in one project.

Raspberry Pi Pico Mini Weather Station (DHT22 + OLED Chart)
How has your room's temperature changed over the last two minutes? The Raspberry Pi Pico reads temperature and humidity from a DHT22 every 2 seconds and shows the value in big digits on a 0.96 inch OLED, with a line chart of the last 60 readings below. An arrow shows the trend and the temperature and humidity pages swap every 4 seconds. The OLED driver is built into the code: one file, no libraries.

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.

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

Raspberry Pi Pico Tea Thermometer (DS18B20 + TM1637 + Buzzer)
Let the Pico tell you when your tea is ready to drink! We are building a thermometer with a Raspberry Pi Pico that measures the tea in your glass. A waterproof DS18B20 probe goes into the tea, and a TM1637 display shows the temperature and the time left until it is drinkable. At 65 degrees the buzzer plays a tune, and it warns you if the tea gets cold.

Raspberry Pi Pico Digital Spirit Level (MPU-6050 + OLED Display)
Shelf up, but is it straight? We are building a digital spirit level with a Raspberry Pi Pico. The MPU-6050 measures gravity, and the OLED shows a bubble in a bullseye plus the X / Y tilt. Stand the board on its edge and the display turns into a classic tube level. Below 0.5° the display lights LEVEL, and just like a real one, the bubble drifts to the higher side.

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.

ESP32 microSD Temperature and Humidity Logger (DHT22 + ILI9341 Graph)
Log the temperature of a room, greenhouse or fridge all day long! An ESP32 measures temperature and humidity with a DHT22 every 2 s and writes each reading to a CSV file on a microSD card. The ILI9341 color display shows live values, min and max, and a two-color live graph of the last 30 readings. Plug the card into your computer and open the file in Excel.

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

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 Battery Tester (Voltage Divider + OLED + 3 LEDs)
Which batteries in the drawer are still good? The moment you touch a battery to the two probes, the Raspberry Pi Pico shows the voltage, the charge percent and a filling battery icon on an OLED display, and a green, yellow or red LED gives the verdict. A button switches between AA, NiMH, Li-ion and 9 V. A voltage divider brings even 9 V down to a level the Pico can safely measure, and averaging 32 readings keeps the value steady.

Raspberry Pi Pico Fridge Door Left Open Alarm (LDR + TM1637 + Buzzer)
Who left the fridge door open? The Raspberry Pi Pico sees the inner lamp through an LDR and counts on a TM1637 display how many seconds the door has been open. At 20 seconds it gives a gentle double beep, at 40 seconds an insistent siren with a red LED; the button mutes the alarm for 60 seconds. The number of openings, the total and the longest open time are saved, so a power cut does not erase them.
Blog
- TÜBİTAK 2204 vs 4006: Which Program Should You Apply To?
- PMS5003 Dust Sensor Arduino: Measure PM1.0, PM2.5 and PM10
- Electrical Power Calculation: P = V × I, Watts, kWh and Examples
- Peltier Module with Arduino: TEC1-12706 Cooling and Heating
- Arduino Fan Speed Control: Temperature-Based PWM Fan Control
- MH-Z19 CO2 Sensor: Measure ppm with Arduino, ESP32 and Pico
- Frost Alarm with Arduino: DS18B20 for Greenhouse, Pipes and Car
- AHT10 Arduino Guide: AHT20 Temperature and Humidity Sensor
- MAX6675 Arduino Thermocouple Guide: K-Type up to 1000 °C
- CCS811 Arduino Guide: eCO2 and TVOC Air Quality Sensor Tutorial
- Arduino Sensor Filtering: Moving Average, Median, EMA and Kalman
- Water Flow Sensor Arduino: Measure Flow and Litres with YF-S201
- Arduino Voltmeter: Measure 0–25 V with an LCD and Calibration
- Arduino Distance Sensor Types: HC-SR04, IR, VL53L0X and LiDAR
- TDS Sensor Arduino: Measure ppm, Calibrate, Monitor Water Quality
- MQ135 Arduino Tutorial: Air Quality Sensor, Calibration and PPM
- What Is an ADC? Analog-to-Digital Conversion with Arduino
- Project-Based Learning with Arduino: A 4-Week Sample Unit
- What Does mAh Mean? Battery Capacity, Wh and Runtime Explained
- NTC Thermistor Arduino Guide: Wiring, Beta and Steinhart-Hart
- Arduino Temperature Sensor Types: 8 Sensors Compared
- Arduino Data to Excel: Data Streamer, PLX-DAQ, CSV and Python
- SMD Resistor Codes: How to Read 103, 4702, 01C and 4R7
- Arduino Science Experiments: Data Logging, Tables and Graphs
- Voltage Divider: Formula, Resistor Choice and Arduino Examples
- Water Level Sensor Arduino: Calibration, Overflow Alarm and Pump
- What Is an Op-Amp? Gain Formulas, LM358 and Arduino Circuits
- Arduino Smart Greenhouse Project: Sensors, Watering, Fan, Code
- 7805 Voltage Regulator: Pinout, Capacitors and Heat Calculation
- ACS712 Current Sensor: Measure DC and AC Current with Arduino
- Kirchhoff's Laws Explained: KCL and KVL with Solved Examples
- Smart Blind Stick with Arduino: Obstacle, Water and Fall Alerts
- Arduino Heart Rate Sensor: Pulse Sensor and KY-039 BPM Guide
- TP4056 Wiring Guide: 18650 Charger Module, Protection and ESP32
- Arduino SD Card Module: CSV Data Logger with RTC Timestamps
- BME280 Arduino Guide: Temperature, Humidity, Pressure & Altitude
- Arduino Radar Project: HC-SR04, SG90 Servo and Processing Guide
- How to Use a Multimeter: Voltage, Current, Resistance, Continuity
- NEO-6M GPS Module with Arduino: Wiring, NMEA and TinyGPSPlus
- LM35 Arduino Temperature Sensor: Wiring, Formula and Code
- What Is a Capacitor? Types, 104 Code and RC Time Constant
- Arduino Science Fair Projects: 25 Ideas from Grade 3 to 12
- HX711 Arduino: Load Cell Wiring, Calibration and Digital Scale
- Soil Moisture Sensor: Automatic Plant Watering with Arduino
- DS18B20 Temperature Sensor with Arduino, ESP32 and Pico
- DHT11 Temperature and Humidity Sensor: Arduino, ESP32 and Pico Guide
- HC-SR04 Distance Sensor: Ultrasonic Distance Measurement with Arduino
- Arduino Sensors Guide: The 12 Most Used Sensors
