Common Sensor Pinout
These connections are copied from our published sensor projects. They cover the boards and modules used in our own lessons rather than a general component catalogue.
- 9 documented sensor facts
- DHT11, HC-SR04, I2C OLED and PIR
- Real pin numbers from our projects
- Distance formula included
Sensor connection table
Each row lists the terminals and the pin assignments that appear in our circuit guides.
| Sensor or module | Terminals / pins | Documented connection |
|---|---|---|
| DHT11 | Power, data, ground | Power leg to 5 V, ground leg to common ground, data leg to a digital pin |
| DHT11 pin order in our guide | Pin 0 power, pin 1 data, pin 2 ground | Data leg connects to Arduino pin 2 in the example |
| DHT11 / DHT22 | Single digital data line | Read digitally with a library; no extra resistor on the data line |
| HC-SR04 | Trigger, echo | Trigger pin set OUTPUT, echo pin set INPUT |
| HC-SR04 trigger pulse | 10 microseconds HIGH | Sent from the board, then the echo pulse is timed |
| HC-SR04 example pins | Trig = 7, Echo = 8 | Used in the distance sketch in our workshop |
| Sound speed used | 343 m/s, 0.0343 cm per microsecond | Distance = pulse time x 0.0343 / 2 |
| I2C OLED (SSD1306) | VCC, GND, SDA, SCL | On Uno: SDA = A4, SCL = A5; GND to common ground |
| PIR motion sensor | Output pin, sensitivity and delay screws | Output goes HIGH when motion is detected |
How to use this reference
Join the grounds first. Every sensor project in our library repeats the same rule: the sensor ground and the controller GND must share one reference.
For the DHT11, use a single digital pin for data. Our guide notes that the sensor has a response time, so querying it too often gives empty or delayed data.
For the HC-SR04, keep the trigger pulse at the documented 10 microseconds and divide the timed echo by two because the sound travels out and back.
For an I2C display, connect the two shared lines to A4 and A5 on an Uno and keep the module supply within the voltage the module accepts. Never feed 5 V to a 3.3 V module.
If a reading never arrives, our troubleshooting lists check the data pin, the supply and the common ground before changing the sketch.
Related DersTeders pages
DHT11 temperature and humidityThe full DHT11 project with wiring steps.HC-SR04 distance guideBuild the ultrasonic distance circuit from our guide.Sensor projects hubMore sensor builds with breadboard layouts.Keep the reference close. Create a free account to save your place, open the simulators and follow the full electronics guides.
Free panelFrequently asked questions
How many legs does the DHT11 have?
Three: power, data and ground. Our guide lists pin 0 as power, pin 1 as data and pin 2 as ground.
How long is the HC-SR04 trigger pulse?
Ten microseconds HIGH. The board then measures how long the echo pin stays HIGH.
How is distance calculated?
The pulse time is multiplied by 0.0343 cm per microsecond and divided by two, because the sound travels to the object and back.
Which pins carry I2C on an Uno?
SDA is A4 and SCL is A5. The two lines are shared by all devices on the bus.
Interactive circuit guide
Run the simulation, follow the build steps one by one and try it in our real app.
Stopped
Step-by-step build