Sensor Guide: Choose the Right Sensor for Your Project

A sensor is how a project notices the world: a touch, a wave, a heartbeat, a change in the light. Start with what you want your project to react to, and the list below points you to the right part. The table compares every sensor I stock, with specs from each listing and the maker's datasheet. Everything here runs at 3.3V, so it works with an ESP32.

Quick picks: what should it react to?

  • A touch: no sensor needed if your board has touch pins. Sew conductive fabric to a touch pin and read it in code (see the Microcontroller Guide for which boards have them). For more buttons, or a board without touch pins such as the ESP32-C3, add the MPR121 for 12 fabric pads, or the 4-key touch board if you want simple on/off outputs and no library.
  • A squeeze, press or bend: Velostat. Sandwich it between two pieces of conductive fabric and the resistance drops as you press. Pick the fabric in the Conductive Fabric Guide.
  • Someone coming close: the VL6180X for a hand hovering within 20 cm; the TOF200C for up to 2 m, with a lens cover that keeps lint out of a garment; the HC-SR04 when size doesn't matter and price does.
  • Movement: the KY-020 tilt switch for a simple "it moved" trigger; the BMI160 for steps, taps, spins and gestures.
  • Light or colour: the ALS-PT19 for brightness; the sewable TCS34725 (black) to pick up colours; the APDS9960 for swipe gestures; the UV sensor for sunlight.
  • Warmth, weather or height: the SHT40 is the most accurate and plugs in with no soldering; the AHT20 + BMP280 adds air pressure and altitude.
  • A heartbeat: the MAX30102. Lovely for pulse-reactive LEDs and biofeedback art; it is not a medical device.
  • Sound: the MAX4466 microphone, for LEDs that dance to music.
  • A card, tag or phone: the RC522 RFID board reads cards and key tags; the ST25DV NFC tag lets a phone tap your garment and open a link your board can change.

Compare every sensor

On a phone, swipe sideways to see every column.

Sensor Senses Range and accuracy Connection Power Plug-in (STEMMA QT / Qwiic) Best for Price
MPR121 12-key touch boardMPR121 12-key touch board Touch on 12 pads Works through thin fabric I2C, 0x5A (0x5B–0x5D selectable) 3.3V – Fabric keypads and touch sleeves, on any board $8.95
4-key capacitive touch (CJMCU-0401)4-key capacitive touch (CJMCU-0401) Touch on 4 pads Works through glass, plastic and fabric 4 digital outputs, one per key 2.0–5.5V – Touch buttons with no library, on any board $9.75
Velostat 10 x 20 cmVelostat 10 × 20 cm Pressure, squeeze and bend Resistance drops as you press Analog (as a voltage divider) Any – Soft pressure pads, insoles and squeeze toys $4.95
VL6180X ToF (TOF050C)VL6180X ToF (TOF050C) Distance and ambient light 0–50 cm, most accurate under 20 cm I2C, 0x29 3–5V – A hand hovering over a sleeve or bag flap $12.95
VL53L0X ToF (TOF200C)VL53L0X ToF (TOF200C) Distance About 3–200 cm, 25° view I2C, 0x29 3–5V – Garments: lens cover keeps lint out, has sew holes $11.95
VL53L0X ToF (GY-VL53L0XV2)VL53L0X ToF (GY-VL53L0XV2) Distance Up to about 2 m I2C, 0x29 2.6–5.5V – The smallest distance sensor, 25 × 12.5 mm $9.95
HC-SR04 ultrasonic (3.3-5V)HC-SR04 ultrasonic (3.3–5V) Distance About 2–400 cm Digital, Trig and Echo pins 3.3–5V – Robots, installations and first lessons $5.25
KY-020 tilt switchKY-020 tilt switch Tilt or shake On or off Digital 3.3–5V – The simplest motion trigger $3.95
BMI160 6-axis IMUBMI160 6-axis IMU Movement, rotation, steps, taps ±2–16 g, ±125–2000°/s I2C 0x68/0x69, or SPI 3–5V – Gestures, step counting and dance costumes $9.95
ALS-PT19 light sensorALS-PT19 light sensor Brightness, like the human eye Higher voltage = brighter Analog 2.5–5.5V – A first sensor: no library needed $6.45
TCS34725 colour, black (sewable)TCS34725 colour, black (sewable) Colour (RGB + clear) IR-blocking filter, onboard LED I2C, 0x29 3.3V / 5V – Colour-picking gloves, sewn in with its loops $9.95
TCS34725 colour, purpleTCS34725 colour, purple Colour (RGB + clear) IR-blocking filter, onboard LED I2C, 0x29 3.3V / 5V – Colour sensing on a breadboard $8.95
Adafruit APDS9960Adafruit APDS9960 Swipe gestures, proximity, colour, light Proximity up to a few cm I2C 3.3V / 5V Yes Wave-to-control, with no soldering $11.95
UV sensor (S12SD)UV sensor (S12SD) Ultraviolet light 240–370 nm (UVA and UVB) Analog 2.5–5V – Sun-safety wearables $6.99
SHT40 temperature and humiditySHT40 temperature and humidity Temperature, humidity ±0.2 °C, ±1.8% RH I2C, 0x44 3–5V Yes, 2 ports The most accurate; on-body warmth $8.95
Adafruit AHT20Adafruit AHT20 Temperature, humidity ±0.3 °C, ±2% RH typical I2C, 0x38 3.3V / 5V Yes Plug-in room and garment climate $10.99
AHT20 + BMP280AHT20 + BMP280 Temperature, humidity, air pressure, altitude ±0.3 °C, ±2% RH, ±1 hPa I2C, 0x38 and 0x77 3.3V – Hiking and weather wear that logs height $7.95
MAX30102 heart and pulseMAX30102 heart and pulse Heart rate and blood oxygen (SpO2) Red and IR light on a finger, earlobe or wrist I2C 1.8–5V – Pulse-reactive LEDs and biofeedback art $4.95
MAX30102 heart and pulse (MH-ET LIVE)MAX30102 heart and pulse (MH-ET LIVE) Heart rate and blood oxygen (SpO2) Red and IR light, glass cover I2C 1.8–5V – Pulse projects, alternative board $5.95
MAX4466 microphoneMAX4466 microphone Sound level and audio 20 Hz–20 kHz, gain 25–125× Analog 2.4–5V – Sound-reactive LEDs $4.95
RFID RC522 board and tagsRFID RC522 board and tags RFID cards and tags 13.56 MHz, card and key tag included SPI 3.3V – Tap-to-trigger games and access $7.55
Mini RFID board and tagsMini RFID board and tags RFID cards and tags 13.56 MHz, 25 × 37 mm SPI 3.3V – RFID that hides inside a bag or garment $9.75
Adafruit ST25DV NFC tagAdafruit ST25DV NFC tag A tag phones can read, rewritten by your board ISO 15693, 13.56 MHz I2C 3.3V / 5V Yes Garments that show a phone a changing link $9.99

Analog, digital, I2C or SPI?

  • Analog sensors give a voltage that rises and falls. Read them with analogRead(); no library needed. Good first sensors for a class.
  • Digital sensors are on or off, like a switch, or send timed pulses (the HC-SR04).
  • I2C sensors share two wires (SDA and SCL), so one board can talk to many sensors. Each sensor has an address, shown in the table.
  • SPI uses four wires and is faster. Here it's only the RFID boards, and the BMI160 if you choose it.

Tips I wish someone had told me

  • Watch for clashing I2C addresses. The VL53L0X, the VL6180X and the TCS34725 all use address 0x29, so two of them can't share the same wires as they are. The ToF boards have an XSHUT pin that lets you switch one off while you give the other a new address in code.
  • On a classic ESP32, use ADC1 pins for analog sensors (GPIO 32–39). The ADC2 pins stop reading once Wi-Fi is on.
  • Need lots of analog sensors? The CD4051 multiplexer turns one analog pin into eight, which is handy for a grid of Velostat pressure pads.
  • No soldering? Choose a board with a STEMMA QT / Qwiic port and the sensors marked "Yes" in the table, then join them with a STEMMA QT cable.
  • Sensors in clothes: put sensors on snaps or a removable pocket so the garment can be washed, and pick boards with a lens cover or sew loops where lint and movement are a problem.
  • Want to try lots at once? The Sense-a-tional Experimenter Pack has 15 sensors and outputs to play with.

Questions people ask

Which sensors work with an ESP32?

All of them. Every sensor on this page runs at 3.3V, including the newer 3.3–5V version of the HC-SR04.

What's the best sensor for wearables?

Start with touch, because conductive fabric is the sensor. After that, motion (BMI160), light (ALS-PT19) and distance (VL6180X or TOF200C) are small, low-power and easy to hide in a seam or strap.

Ultrasonic or time-of-flight for distance?

Ultrasonic (HC-SR04) is cheap and good for robots and installations, but it's bulky. Time-of-flight sensors are tiny, silent and barely affected by colour or texture, so they suit garments and bags.

Can I measure heart rate accurately?

The MAX30102 gives good readings for art, games and biofeedback projects when it sits still against the skin. It isn't a medical device, so don't rely on it for health decisions.

Do I need to solder?

Not for the sensors with a STEMMA QT / Qwiic plug. Most of the others come with headers that you solder on, or you can solder wires straight to the pads.

Where can I buy sensors in Canada?

Right here: every order is packed by hand in Nova Scotia and ships across Canada and to the US. See shipping rates, or browse all sensors.