I will be using raspberry pi for connecting following sensors

  1. DHT-11 Digital Temperature & Humidity Sensor for temperature and humidity measurement
  3. Soil Hygrometer Humidity Detection Module Moisture Testing Sensor for soil moisture
  4. HC-SR04 Ultrasonic Distance Sensor for measuring distance
  5. Three LEDs

How will I know the amount resistance to be connected with each sensors to gpio? What happens if I connect resistor which is insufficient?

1 Answer 1


1) DHT-11: The manufacturer should recommend a resistance (pull-up to supply voltage on the data line). If you are supplying more than 3V3 you will need another resistor from the data line to ground to act as a voltage divider to cut the data line to 3V3. For a 5V supply the resistor to ground should be twice the other resistor.

2) PIR: I didn't think one was needed. What is the resistor for?

3) Soil sensor: I didn't think one was needed. What is the resistor for?

4) Sonar ranger: The data output line needs a voltage divider if you supply the device 5V (as you should if you want reliable results). The resistor to ground should be twice the value of the resistor to the data pin.

5) LEDs. A rule of thumb is a resistance of 200 ohms per volt of supply voltage. So for 3V3 try 660 ohms. If the LED is too dim try a lower resistance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.