Sensors look simple: plus, minus, signal. But there are four things that regularly go wrong, and none of them have anything to do with the sensor itself.
Choose what you need to measure first
Do not start with the connector or protocol. Start with the application and define:
- the quantity to measure and a suitable sensing principle;
- the required range, accuracy, resolution and response time;
- the environment: temperature, humidity, dust, vibration, light and interference;
- mechanical mounting, field of view, measuring distance or contact with the medium;
- output or bus, supply voltage, logic levels and any calibration requirements.
A CO2 sensor, distance sensor and Hall sensor may all appear under sensors, but they measure different quantities and impose different requirements on placement, supply and readout. Check these points in the exact part's datasheet before choosing the connector, cable and interface.
View the sensor collection and filter by the measurement and specifications required by the application.
Voltage: 3.3 V or 5 V — and the signal?
A sensor can use a different supply voltage from the logic level at its output. A sensor powered from 5 V therefore does not automatically output a 5 V signal. Check each pin in the datasheet: supply voltage, output type, maximum levels, pinout and any separate interface supply such as VDDIO.
Only connect a signal directly when sensor and microcontroller are electrically compatible. A correctly calculated divider can sometimes suit a slow, one-way signal. For I2C, other bidirectional signals or an unknown output type, select an appropriate level shifter or interface solution from both datasheets.
Analogue, digital or bus
An analogue sensor outputs a voltage proportional to what it measures. An LDR or NTC gives a variable voltage; you read it on an analogue pin and convert it back to the measured value. Simple, but sensitive to noise on long wiring.
A digital sensor outputs high or low — a threshold is either exceeded or not. That is robust and easy to read, but you lose all nuance.
A bus sensor communicates through a protocol. I2C and SPI are the most common. I2C uses two lines (SDA and SCL) that multiple sensors can share. I2C uses pull-ups to the correct logic rail, but their value is not universal. Check supply voltage, bus speed, total capacitance, device count and pull-ups already fitted to modules.

Cable length and noise
Long cables and analogue sensors are a poor combination. Every metre of cable can pick up noise. A soil moisture sensor on two metres of wire can therefore give unstable readings — that does not necessarily mean the sensor is defective.
I2C and SPI are intended for short interconnects; reliable length depends on speed, wiring, topology, capacitive load, noise and the specific devices. Use an interface designed for longer cables when distance is required.
Start small, build up
Test each sensor individually first: short cables, a known power supply and a simple example program. Does it work stably and give expected values? Only then add more sensors.
Two sensors on the same I2C bus with the same address are a common source of errors. Check the I2C address of every device in the datasheet before assembling the bus.
Before you connect
- What must the sensor measure and within which range?
- Which supply and logic levels apply to each pin?
- Is the output analogue, push-pull, open-drain or a bus?
- Are pinout, protocol, address and speed correct?
- First test one sensor with short wiring and a known supply.
Common mistake
The connector fits, so it works. It does not. Check voltage, pinout and signal level before connecting. A wrongly connected sensor can damage itself, damage your microcontroller, or simply do nothing — and then you have no idea which of the three it is.
Browse the sensor collection, then filter by measured quantity, output, range and supply voltage. Always check the current datasheet before ordering.