TecnoMate logo
Sensors Used in IoT Projects: Complete Guide
Back to Guides
SensorsIoTArduino

Sensors Used in IoT Projects: Complete Guide

Feb 6, 2026
6 min read

Sensors Used in IoT Projects

Sensors are the eyes and ears of any IoT project. They convert physical quantities (temperature, distance, light, gas concentration) into electrical signals that a microcontroller can read. Choosing the right sensor—and understanding how it works—is critical for accurate, reliable IoT systems.

Sensor Overview

| Sensor | Measures | Output | Interface | Price | |--------|---------|--------|-----------|-------| | DHT11 | Temp, humidity | Digital | Single-wire | ₹60 | | DHT22 | Temp, humidity (higher accuracy) | Digital | Single-wire | ₹200 | | MQ-2 | LPG, smoke, methane | Analog | ADC | ₹100 | | MQ-135 | CO2, NH3, benzene | Analog | ADC | ₹120 | | HC-SR04 | Distance (2–400 cm) | Digital (pulse) | Trigger/Echo | ₹60 | | PIR (HC-SR501) | Motion | Digital (HIGH/LOW) | GPIO | ₹50 | | Soil moisture | Water content | Analog | ADC | ₹40 | | BMP280 | Pressure, altitude, temp | Digital | I2C/SPI | ₹150 | | LDR | Light intensity | Analog | Voltage divider | ₹10 |

How Each Sensor Works

DHT11 / DHT22 (Temperature & Humidity)

Uses a capacitive humidity element and a thermistor. Sends data as a 40-bit digital signal on a single wire. The DHT22 is more accurate (±0.5°C vs ±2°C) and has a wider range (-40 to 80°C vs 0 to 50°C). Use a 10kΩ pull-up resistor on the data line.

MQ-2 / MQ-135 (Gas Sensors)

Contain a tin dioxide (SnO2) semiconductor that changes resistance when exposed to target gases. Require a preheat time of 24–48 hours for accurate readings. Output an analog voltage proportional to gas concentration. Use the analog pin for precise readings or the digital pin for threshold-based alarms.

HC-SR04 (Ultrasonic Distance)

Sends a 40 kHz ultrasonic pulse from the Trigger pin. The Echo pin goes HIGH for a duration proportional to the distance. Calculate distance using: Distance = (echo time × 0.034) / 2 (in cm). Effective range: 2 cm to 400 cm. Accuracy: ±3 mm.

PIR (Passive Infrared Motion)

Detects changes in infrared radiation caused by moving warm bodies (humans, animals). The HC-SR501 module has adjustable sensitivity and delay time via onboard potentiometers. Outputs HIGH when motion is detected. Ideal for security and automatic lighting.

Soil Moisture Sensor

Two probes measure the resistance of soil—wet soil conducts better than dry soil. Output decreases as moisture increases. Prone to corrosion over time; consider capacitive soil moisture sensors for long-term outdoor use.

Wiring Tips

  • Always check the sensor's operating voltage (3.3V vs 5V). ESP32 is 3.3V—using a 5V sensor output directly can damage it.
  • Use pull-up resistors where required (DHT sensors, I2C bus).
  • Place gas sensors in well-ventilated areas and allow preheat time.
  • For analog sensors on ESP32, note that the ADC range is 0–3.3V (not 0–5V like Arduino).

All sensors output analog or digital signals read by Arduino/ESP32. Browse Sensor Projects.


Ready to start building?

Explore our collection of DIY kits and components. All project components mentioned in this guide are available in our store.

Browse All Projects