
How to Choose the Right Sensors for Robotics Builds
Choose the robotics sensor by the job: distance, line tracking, motion, or gas. The HC-SR04 measures 2 to 450 cm for $4.01. The TCRT5000 tracks a line at 1 to 25 mm for $2.29. The PIR sensor sees motion up to 7 m away for $4.99, and the MQ-2 detects gas from 300 to 10,000 ppm for $5.81.
Quick facts
| Fact | Value |
|---|---|
| HC-SR04 distance | 2 to 450 cm, 0.3 cm precision, $4.01 |
| TCRT5000 line | 1 to 25 mm adjustable, digital output, $2.29 |
| IR obstacle | 2 to 30 cm adjustable, 35 degree angle, $6.20 |
| DHT22 temperature | 0 to 100% RH, -40 to 80C, $4.99 |
| BMP280 pressure | 300 to 1100 hPa, plus or minus 1 hPa, $6.77 |
| MQ-2 gas | 300 to 10,000 ppm, 5V heater, $5.81 |
Which sensor measures distance on a robot?
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 tracks a line?
The TCRT5000 tracks a line at 1 to 25 mm with a digital output.
It uses an LM393 comparator on 3.3 to 5V. A single sensor costs $2.29 for a line-following robot.
Mount it 1 to 25 mm above the line and tune the threshold. A sensor too high misses the line, and one too low scrapes it.
Which sensor stops the robot at an obstacle?
The IR sensor stops the robot 2 to 30 cm from an object.
It uses a 35 degree angle and an LM393 comparator on 3.3 to 5V. The 5-pack costs $6.20, and the 10-pack costs $8.85.
Mount it on the front of the robot and read its digital output. A high output means the path is clear.
Which sensor reads temperature and pressure?
The DHT22 reads 0 to 100% relative humidity and -40 to 80C for $4.99.
It runs on 3.3V to 5.5V with a single-bus output. Read it once per 2 sec, since the sensor needs time between reads.
The BMP280 reads 300 to 1100 hPa with plus or minus 1 hPa accuracy. It uses I2C or SPI on 3.3V or 5V, and its 5-pack costs $6.77.
Which sensor detects motion or gas?
The PIR sensor sees motion up to 7 m away, and the MQ-2 detects gas from 300 to 10,000 ppm.
The PIR sensor runs on 5V to 20V and holds its output for 0.3 to 18 sec. It costs $4.99.
The MQ-2 senses LPG, methane, propane, butane, alcohol, hydrogen, and smoke. It costs $5.81 with a 5V heater.
How the options compare
| Sensor | Measures | Range | Voltage | Price |
|---|---|---|---|---|
| HC-SR04 | Distance | 2 to 450 cm | 5V | From $4.01 |
| TCRT5000 | Line tracking | 1 to 25 mm | 3.3 to 5V | $2.29 |
| IR obstacle | Obstacle | 2 to 30 cm | 3.3 to 5V | $6.20, 5-pack |
| 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 |
How do you pick the right robotics sensor in five steps?
- Write down the job: distance, line tracking, 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 output type: digital, single-bus, I2C, or SPI.
- Test one sensor at a time before you wire the whole robot.
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.
TCRT5000 Infrared Reflective Line Tracking Sensor Module ($2.29)
TCRT5000 sensor at $2.29. It tracks a line at 1 to 25 mm with a digital output on 3.3 to 5V.
IR Infrared Obstacle Avoidance Sensor Module, 5-Pack / 10-Pack ($6.20)
IR obstacle sensor at $6.20 for a 5-pack. It detects 2 to 30 cm at a 35 degree angle on 3.3 to 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.
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
Which sensor measures distance on a robot?
The HC-SR04 at $4.01 listed. It measures 2 to 450 cm with 0.3 cm precision on 5V.
Which sensor tracks a line for a robot car?
The TCRT5000 at $2.29. It tracks a line at 1 to 25 mm with a digital output.
Which sensor stops a robot at a wall?
The IR obstacle sensor at $6.20 for a 5-pack. It detects 2 to 30 cm at a 35 degree angle.
Which sensor detects gas on a robot?
The MQ-2 at $5.81. It detects smoke and gas from 300 to 10,000 ppm with a 5V heater.
Sources
- HC-SR04 ultrasonic sensor datasheet
- Vishay TCRT5000 datasheet
- Adafruit DHT temperature and humidity sensor guide
Last updated: November 10, 2026.
