
How to Choose the Right Sensor for Arduino Projects
Choose the sensor by the job: distance, temperature, motion, or gas. The HC-SR04 measures 2 to 450 cm for $4.01, and the DHT22 reads temperature and humidity for $4.99. The PIR sensor sees motion up to 7 m away. Match the voltage too, since most sensor modules in this guide run on 3.3V to 5V.
Quick facts
| Fact | Value |
|---|---|
| HC-SR04 distance | 2 to 450 cm, 0.3 cm precision, $4.01 |
| DHT22 temperature | 0 to 100% RH, -40 to 80C, $4.99 |
| BMP280 pressure | 300 to 1100 hPa, plus or minus 1 hPa, $6.77 |
| PIR motion | Up to 7 m, under 120 degree cone, $4.99 |
| MQ-2 gas | 300 to 10,000 ppm, 5V heater, $5.81 |
| IR obstacle | 2 to 30 cm adjustable, 35 degree angle, $6.20 |
| TCRT5000 line | 1 to 25 mm adjustable, digital output, $2.29 |
Which sensor measures distance?
The HC-SR04 measures 2 to 450 cm with 0.3 cm precision.
It runs on 5V and suits robot cars, parking aids, and water tanks. The module costs from $4.01, with a module-only option at $4.49.
It sends a sound pulse and times its echo. Wire its trigger and echo pins to 2 digital pins on the board.
Which sensor reads temperature and humidity?
The DHT22 reads 0 to 100% relative humidity and -40 to 80C.
It runs on 3.3V to 5.5V with a single-bus output. That range suits indoor and outdoor bench tests.
The sensor costs $4.99 and works with Arduino and ESP32 boards. Read it once per 2 sec, since the sensor needs time between reads.
Which sensor reads air pressure?
The BMP280 reads 300 to 1100 hPa with plus or minus 1 hPa accuracy.
It uses I2C or SPI and runs on 3.3V or 5V. That suits altitude and weather logging on Arduino and ESP32 boards.
The 5-pack costs $6.77 for the 3.3V version. A 10-pack costs $8.88 for 3.3V and $15.62 for 5V.
Which sensor detects motion?
The PIR sensor sees motion up to 7 m away inside a cone under 120 degrees.
It runs on 5V to 20V and holds its output for 0.3 to 18 sec. That suits cameras, alarms, and lights.
The sensor costs $4.99. Wire its output to a GPIO pin and act on a rising edge.
Which sensor detects smoke and gas?
The MQ-2 detects smoke and gas from 300 to 10,000 ppm.
It senses LPG, methane, propane, butane, alcohol, hydrogen, and smoke. A 5V heater warms the sensing element.
The module costs $5.81 and suits alarms and air checks. Give the heater time to warm up before you trust a reading.
Which sensor tracks a line or an obstacle?
The TCRT5000 tracks a line at 1 to 25 mm, and the IR sensor stops a car at 2 to 30 cm.
The TCRT5000 uses an LM393 comparator with a digital output on 3.3 to 5V. A single sensor costs $2.29 for a line-following robot.
The IR sensor uses a 35 degree angle and an LM393 comparator. Its 5-pack costs $6.20, and its 10-pack costs $8.85.
How the options compare
| Sensor | Measures | Range | Voltage | Price |
|---|---|---|---|---|
| HC-SR04 | Distance | 2 to 450 cm | 5V | From $4.01 |
| DHT22 | Temperature and humidity | 0 to 100% RH, -40 to 80C | 3.3 to 5.5V | $4.99 |
| BMP280 | Pressure and temperature | 300 to 1100 hPa | 3.3V or 5V | $6.77, 5-pack |
| HC-SR501 PIR | Motion | Up to 7 m | 5 to 20V | $4.99 |
| MQ-2 | Smoke and gas | 300 to 10,000 ppm | 5V heater | $5.81 |
| IR obstacle | Obstacle | 2 to 30 cm | 3.3 to 5V | $6.20, 5-pack |
| TCRT5000 | Line tracking | 1 to 25 mm | 3.3 to 5V | $2.29 |
How do you pick the right sensor in five steps?
- Write down the job: distance, temperature, motion, or gas.
- Match the range to the job, such as 2 to 450 cm for distance.
- Check the voltage against your board pins.
- Check the interface: digital, single-bus, I2C, or SPI.
- Buy a spare when the sensor costs under $8, since a spare saves a project.
Parts that fit this guide
In-stock parts ship from the New York, USA warehouse in 1-2 business days. Prices below are the live store prices we verified on November 10, 2026.
HC-SR04 Ultrasonic Ranging Sensor Module for Arduino, 2-450cm, with Mounting Bracket Options ($4.01)
HC-SR04 sensor at $4.01 listed, with a module-only option at $4.49. It measures 2 to 450 cm with 0.3 cm precision on 5V.
DHT22 / AM2302 Digital Temperature & Humidity Sensor Module ($4.99)
DHT22 sensor at $4.99. It reads 0 to 100% relative humidity and -40 to 80C on 3.3V to 5.5V.
BMP280 Barometric Pressure & Temperature Sensor Module, 5-Pack / 10-Pack, 3.3V & 5V ($6.77)
BMP280 sensor at $6.77 for a 5-pack. It reads 300 to 1100 hPa with plus or minus 1 hPa accuracy on I2C or SPI.
HC-SR501 PIR Motion Sensor Module ($4.99)
PIR sensor at $4.99. It sees motion up to 7 m away, with a 0.3 to 18 sec delay.
MQ-2 Smoke & Combustible Gas Sensor Module ($5.81)
MQ-2 sensor at $5.81. It detects smoke and gas from 300 to 10,000 ppm with a 5V heater.
Shop the full range: Robot Sensors at Quality RC Parts. See also: Related guide.
Frequently asked questions
What is the cheapest sensor in this guide?
The HC-SR04 ultrasonic sensor, listed from $4.01. It measures 2 to 450 cm with 0.3 cm precision.
Which sensor reads temperature and humidity?
The DHT22 at $4.99. It reads 0 to 100% relative humidity and -40 to 80C.
Which sensor detects motion for a camera?
The HC-SR501 PIR sensor at $4.99. It sees motion up to 7 m away.
Do these sensors work with an ESP32 board?
Yes. Most run on 3.3V to 5V, which suits ESP32 boards, and the DHT22 also works with Arduino boards.
Sources
- HC-SR04 ultrasonic sensor datasheet
- Adafruit DHT temperature and humidity sensor guide
- Adafruit BMP280 sensor guide
Last updated: November 10, 2026.
