U4/Sensors
ESP32 Compatible Sensors
Wiring diagrams, pinouts, specs and working code for every sensor in the catalog - so you go from bare module to live readings, fast.
Need a board to run them? Browse ESP32 boards →BME280 23.4 C 45.2 %RH 1013 hPa LD2410 presence: yes 1.82 m VL53L0X distance: 142 mm MH-Z19 CO2: 618 ppm DS18B20 probe: 21.9 C HC-SR04 distance: 88 cm
Live readings - the fun part of every build
127
Sensors documented
9
Categories
12
Protocols
5
Code frameworks
Browse by category
9 categories
environment
30Temperature, humidity and pressure
Air Quality
6Gas and particulate monitoring
Human Presence
14PIR and mmWave radar
distance
12Ultrasonic and laser ToF
SIM
11Cellular connectivity
servo
5Motors and drivers
RTC
4Real-time clocks
KY-0xx module
4237-in-1 kit modules
Browse by protocol
12 protocols
The right sensor for the job
quick picks
| You want to... | Start with | Why | More options |
|---|---|---|---|
| Measure temperature & humidity | SHT40 · BME280 | Accurate I2C parts; the BME280 adds barometric pressure | 30 environment sensors → |
| Measure temperature where it's wet - outdoors, soil, liquids | DS18B20 | Sealed waterproof probe on a long lead - rain, ponds, soil, freezers | 30 environment sensors → |
| Monitor CO2 levels | MH-Z19 | True NDIR CO2 measurement, not a VOC estimate | 6 air quality sensors → |
| Detect a person sitting still | LD2410 | 24 GHz mmWave radar picks up micro-motion PIR misses | 14 presence sensors → |
| Measure distance on a budget | HC-SR04 | Ultrasonic, roughly 2-400 cm, needs just two GPIOs | 12 distance sensors → |
| Measure distance precisely | VL53L0X · VL53L1X | Laser time-of-flight, millimeter readings - L0X to ~2 m, L1X to ~4 m | 12 distance sensors → |
| Drive many servos at once | PCA9685 | 16 PWM channels over I2C, offloads timing from the ESP32 | 5 servo modules → |
| Read NFC / RFID tags | PN532 | Reads and writes 13.56 MHz tags over I2C, SPI or UART | 3 NFC / RFID modules → |
Popular sensors
See all 50 →







Buyer's guides
from the blog
Common questions
Do 5V sensor modules work with the ESP32?▾
The ESP32 runs 3.3V logic and its GPIOs are not 5V tolerant. Many modules work fine from a 3.3V supply; some want 5V power but still signal at safe levels; a few need a level shifter or voltage divider on the data lines. The wiring table on each sensor page shows the safe hookup for that exact module.
What are the default I2C pins on the ESP32?▾
GPIO21 (SDA) and GPIO22 (SCL) on the classic ESP32 dev boards these guides target. The wiring diagrams and code examples use those pins unless a page says otherwise, and most breakout boards bring their own pull-up resistors.
What are the default SPI pins on the ESP32?▾
The examples use the VSPI defaults: SCK on GPIO18, MISO on GPIO19, MOSI on GPIO23, with GPIO5 as the chip-select. Any free GPIO can serve as chip-select, which is how several SPI devices share one bus.
Which pins do UART sensors connect to?▾
The examples use UART2: sensor TX to GPIO16 (RX2) and sensor RX to GPIO17 (TX2). That leaves UART0 free for flashing and the serial monitor, and the ESP32 can remap its UARTs to most other GPIOs if those pins are taken.
Can the ESP32 read analog sensors?▾
Yes - use the ADC1 pins (GPIO32 to GPIO39) and convert with raw * 3.3 / 4095 at the default 12-bit resolution. The examples avoid ADC2 pins because they stop working while Wi-Fi is active.
Which code frameworks do the examples cover?▾
Every sensor page carries compile-tested examples for Arduino IDE, ESP-IDF, PlatformIO and MicroPython, and nearly all include ESPHome as well - a few modules simply have no ESPHome support. Each example names the libraries or components it needs.
How many I2C sensors can share one bus?▾
Dozens in practice, as long as every device has a distinct address - you will find each sensor's address in its wiring notes. When two modules share a fixed address, an I2C multiplexer such as the TCA9548A puts them on separate channels.
