I would like to use raspberry pi for measurement of Temperature,Humidity,Motion, soil moisture & distance. I would like to add three led indicators. I'll be using 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 as indicators

Is it possible to connect all the sensors at a time ? can i use a single python script to access all these sensors at a time? And what are the precautions to be taken?

p.s:My apologies if i asked anything wrong I'm new here

1 Answer 1


The only questionable item is the soil moisture detector. It may have an analogue output which is not readable directly by the Pi. All the Pi's gpios are digital.

DHT11 one gpio.
HC-SR501 one gpio.
Soil Hygrometer unknown, do you have a model in mind?
HC-SR04 ranger two gpios.
Three LEDs so three gpios.

Yes, you can connect them all at the same time and one Python script would work.

  • what about vcc pin of the sensors ? can i connect them in parallel ? Commented Jan 1, 2015 at 11:57
  • link this soil moisture sensor (this type) Commented Jan 1, 2015 at 12:00
  • The moisture sensor digital output is either on or off. It just reports if a threshold level has been reached (as set by the pot). If you want more detail you'll need to add an ADC to your set up. I'd look to be powering everything off 5V if that is possible. You'll need to check the output levels from the sensors. If a sensor returns a voltage greater than 3V3 you'll need to include a pair of resistors as a voltage divider.
    – joan
    Commented Jan 1, 2015 at 12:17

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.