Chapter 7 — The Sensor Dictionary: DHT, MLX, and What to Buy First
There are hundreds of sensor types. These are the ones that appear repeatedly in real IoT projects — cheap, well-documented, and reliably supported by MicroPython and Arduino libraries.
Temperature and Humidity
DHT22 (also called AM2302): the workhorse. Measures temperature (-40 to +80°C) and relative humidity (0–100%). Single-wire protocol. One sensor, three pins (VCC, GND, DATA). Accuracy: ±0.5°C temperature, ±2–5% humidity. Update interval: minimum 2 seconds.
DHT11: cheaper, less accurate (±2°C, ±5% humidity), narrower range (0–50°C). Use it for learning and non-critical monitoring. Use the DHT22 for anything you care about.
Both sensors are susceptible to condensation. Don’t use them in environments where humidity regularly hits 100% — the readings will drift and eventually the sensor will fail.
Infrared (Non-Contact) Temperature
MLX90614: measures surface temperature remotely, without contact. Useful for measuring the temperature of leaves (plants), water surfaces, radiators, or human skin. I2C interface. Range: -70 to +380°C. Accuracy: ±0.5°C in the 0–50°C range.
For plant monitoring, the MLX90614 complements the DHT22: the DHT22 measures air temperature and humidity, the MLX90614 measures leaf surface temperature. The difference between the two is an input to VPD (Vapour Pressure Deficit) calculations — covered in Chapter 11.


Soil Moisture
Capacitive soil moisture sensors (generic, ~€2 each) measure the dielectric constant of soil, which correlates with moisture content. They don’t corrode like resistive sensors. They need calibration: take a reading in bone-dry soil (0% moisture baseline) and in fully saturated soil (100% baseline). Everything in between is interpolated.
CO2 and Air Quality
MH-Z19 (CO2, UART or PWM): measures actual CO2 concentration in ppm. Accurate, self-calibrating, ~€20. Useful for indoor air quality monitoring.
SGP30 (TVOC and eCO2, I2C): measures volatile organic compounds and estimated CO2. Less accurate than the MH-Z19 for CO2, but adds TVOC measurement. Cheaper (~€8).
The Bill of Materials for a Starting Kit
If you’re building your first IoT setup and want to cover the most common projects:
| Sensor | Qty | Price (approx.) | Use |
|---|---|---|---|
| DHT22 | 3 | €5 total | Temperature + humidity, multiple rooms |
| MLX90614 | 1 | €8 | Non-contact surface temperature |
| Capacitive moisture | 3 | €6 total | Soil monitoring |
| Tapo P110 | 2 | €30 total | Power monitoring + smart switching |
| ESP32 (38-pin) | 2 | €10 total | Sensor nodes |
| Pico W | 2 | €12 total | Sensor nodes |
| 5W solar panel | 1 | €8 | Power for outdoor node |
| TP4056 module | 2 | €3 total | Battery charging |
| 18650 battery | 2 | €6 total | Energy storage |
Total: ~€88. Enough hardware for 5–6 meaningful projects.
Takeaway: DHT22 for air. MLX90614 for surfaces. Capacitive sensors for soil. Add a solar panel and TP4056 for any outdoor node.