Sensors
Arduino sensors — temperature, humidity, distance, motion, light, gas, pressure, heart rate and touch. Most are ready-made KY-series modules: 3 pins, connect with jumper wires, library available in the Arduino IDE.
Sensors — buying guide
A sensor provides your microcontroller with information about the environment: it measures temperature, distance, motion, light or gas. Most modules in this category are ready-made boards: they connect to Arduino or ESP32 with three or four wires and usually have an Arduino IDE library. The right choice depends on what you want to measure and what accuracy you need.
Which one to choose?
- Temperature and humidity: for a simple room project, the DHT11 module is enough (0–50 °C). For a wider range and better accuracy, choose DHT22 (−40…80 °C). If you only need temperature, KY-001 (DS18B20) measures −55…125 °C and works over a single wire.
- Distance: HC-SR04 measures between 2–400 cm. For humid and outdoor conditions, the waterproof probe of JSN-SR04T is more suitable.
- Motion: HC-SR501 PIR detects human motion, often used for lights and alarms.
- Line and obstacle: for a line-following robot use KY-033 TCRT5000; for an obstacle-avoiding robot use an infrared obstacle sensor.
- Light: the LDR module (LM393) is a simple way to turn on a relay or LED in the dark.
- Air and gas: MQ-135 monitors air quality and needs warm-up time before use. GY-BMP280 measures atmospheric pressure and altitude.
- Plants and rain: a soil moisture sensor is for automatic watering; the rain sensor (HL-83) detects raindrops.
- Pulse: GY-MAX30102 reads pulse and oxygen level from a fingertip.
These are not medical devices; they are for learning and hobby projects.
Compatibility
- Voltage: Arduino UNO and Nano run at 5 V, while ESP32 and Raspberry Pi pins are 3.3 V. Do not connect a 5 V output, such as the Echo pin of an HC-SR04, directly to a 3.3 V pin: you need a voltage divider in between.
- Analog sensors: require an analog pin. Arduino and ESP32 have them; Raspberry Pi does not, so you need a separate ADC module there.
- Digital sensors: can connect to any digital pin. BMP280 and MAX30102 use I2C, so they connect with just two signal wires (SDA, SCL).
Typical projects
- Room station that shows temperature and humidity on a display.
- Automatic watering system that turns on a pump when the soil is dry.
- Line-following or obstacle-avoiding robot.
- System that turns on a light or sends a Telegram notification when it detects motion.
Related categories
Which sensor is easier for a beginner?
You can start with DHT11 and HC-SR04: both are inexpensive modules, easy to connect, and have plenty of example projects.
What is the difference between analog and digital sensors?
An analog sensor outputs a varying voltage that represents the value; a digital sensor sends either a ready-made number or a simple "on/off" signal. Some modules provide both types of output.




















