Common Sensor Pinout Reference
Quick pinout reference for common Arduino, ESP32 and Raspberry Pi sensors — DHT11/DHT22, HC-SR04, PIR, DS18B20, BME280, MPU6050, OLED, RC522, MQ gas, soil moisture and more.
⚠️ Wiring safety: Sensor modules do not all use the same pin order. Always check the label on the board. A 5V sensor output may damage 3.3V GPIO pins on ESP32 and Raspberry Pi.
🧭 Common sensor module pinout pattern
Common Sensor Pinout Reference Most beginner modules follow VCC · Signal · GND, but voltage and logic level must be checked 3-Pin ModuleVCCOUTGND 4-Pin ModuleVCCSCLSDAGND SPI ModuleVCC · SCK · MOSIMISO · CS · GNDExample: RC522 RFID Quick wiring ruleConnect GND first, match logic voltage, then connect signal pins to the correct interface.5V sensor output can damage 3.3V GPIO pins — use a level shifter or divider when needed. POWERDIGITALI2CSPIGND
📌 Quick sensor cards
1DHT11 / DHT22Digital · 3.3–5V
2HC-SR04Digital pulse · 5V
3PIR Motion SensorDigital · 5V typical
4DS18B201-Wire · 3.0–5.5V
5BME280 / BMP280I2C/SPI · 3.3V module dependent
6MPU6050I2C · 3.3–5V module
70.96 OLED I2CI2C · 3.3–5V module
8RC522 RFIDSPI · 3.3V only
9MQ Gas Sensor ModuleAnalog + digital · 5V typical
10Soil Moisture ModuleAnalog + digital · 3.3–5V
11IR Obstacle SensorDigital · 3.3–5V
12LDR Light Sensor ModuleAnalog + digital · 3.3–5V
Search Sensor / Pin
Filter Interface
Quick filters:I2CSPIDigitalAnalogAll
Sensor / ModuleUseInterfaceCommon PinsVoltageWiring Note
DHT11 / DHT22Temp + humidityDigitalVCC · DATA · NC · GND3.3–5VUse 4.7k–10k pull-up on DATA if bare sensor.
HC-SR04Ultrasonic distanceDigital pulseVCC · TRIG · ECHO · GND5VEcho is 5V; level shift for ESP32/Raspberry Pi.
PIR Motion SensorMotion detectionDigitalVCC · OUT · GND5V typicalOUT goes high when motion is detected.
DS18B20Waterproof temperature1-WireVDD · DQ · GND3.0–5.5VUse 4.7k pull-up from DQ to VDD.
BME280 / BMP280Pressure/humidityI2C/SPIVCC · SCL/SCK · SDA/SDI · GND3.3V module dependentMost breakout boards support I2C; check VIN regulator.
MPU6050Gyro + accelerometerI2CVCC · SCL · SDA · GND3.3–5V moduleAD0 changes I2C address 0x68/0x69.
0.96 OLED I2COLED displayI2CVCC · SCL · SDA · GND3.3–5V moduleCommon addresses are 0x3C and 0x3D.
RC522 RFIDRFID readerSPI3.3V · SCK/MOSI/MISO · SDA/SS · GND3.3V onlyDo not power RC522 from 5V logic pins.
MQ Gas Sensor ModuleGas / smokeAnalog + digitalVCC · AO · DO · GND5V typicalHeater draws high current; allow warm-up time.
Soil Moisture ModuleSoil moistureAnalog + digitalVCC · AO · DO · GND3.3–5VCapacitive type is better than resistive probe for long use.
IR Obstacle SensorObject detectionDigitalVCC · OUT · GND3.3–5VPotentiometer adjusts detection threshold.
LDR Light Sensor ModuleLight levelAnalog + digitalVCC · AO · DO · GND3.3–5VAO gives analog light level, DO gives threshold output.
Rain Sensor ModuleRain / water detectAnalog + digitalVCC · AO · DO · GND3.3–5VAvoid permanent DC on exposed plate for corrosion-sensitive use.
Load Cell + HX711Weight sensorDigital serialVCC · DT · SCK · GND2.6–5.5VConnect load cell wires to HX711 E+/E-/A+/A- first.
Hall Sensor ModuleMagnetic fieldDigital/analogVCC · OUT/AO · GND3.3–5VUsed for RPM, magnets, position and speed detection.
NTC Thermistor ModuleTemperatureAnalogVCC · AO · DO · GND3.3–5VCheck thermistor beta and pull-up/down value for accuracy.

📋 Common Sensor Groups

🌡️ Temperature / Humidity
DHT11/DHT22VCC DATA GND
DS18B20VDD DQ GND
NTC moduleVCC AO GND
📏 Distance / Motion
HC-SR04VCC TRIG ECHO GND
PIRVCC OUT GND
IR obstacleVCC OUT GND
🔁 I2C Sensors
BME280VCC SCL SDA GND
MPU6050VCC SCL SDA GND
OLED I2CVCC SCL SDA GND

📚 Wiring Notes

VCC is not always 5V Some modules accept 3.3–5V because they include a regulator. Some bare ICs are 3.3V only.
Logic level matters A sensor powered from 5V may output 5V logic. Use a level shifter for ESP32 and Raspberry Pi inputs.
I2C modules share SDA/SCL Multiple I2C sensors can share the same two lines if their addresses are different.
Analog output needs ADC Raspberry Pi has no built-in analog input. Use an external ADC module for analog sensors.

Common Sensor Pinout Reference

This sensor pinout reference helps makers quickly wire popular modules to Arduino, ESP32, Raspberry Pi and other microcontroller boards. It covers common power, ground, signal, I2C, SPI, analog and digital pin patterns.

❓ Frequently Asked Questions

Power compatibility and signal compatibility are different. If the signal output is 5V, use a level shifter or voltage divider before connecting to 3.3V GPIO pins.
The common bare 4-pin order is VCC, DATA, NC, GND when looking at the front grill. Many 3-pin modules expose only VCC, DATA and GND.
HC-SR04 commonly uses VCC, TRIG, ECHO and GND. Echo is usually 5V, so shift it down for ESP32 or Raspberry Pi.
I2C modules usually use VCC, SCL, SDA and GND. On Arduino Uno, SDA is A4 and SCL is A5. On many ESP32 boards, common defaults are GPIO21 SDA and GPIO22 SCL.
No. Raspberry Pi GPIO pins are digital only. Use an ADC module such as MCP3008, ADS1115 or an Arduino/ESP32 as an ADC interface.
AO is analog output and changes gradually with sensor value. DO is digital threshold output controlled by the module comparator and potentiometer.