Herlambang_Rizky
Posts: 25
Joined: Thu Dec 28, 2017 11:07 am

Connecting Multiple Sensor

Thu Feb 01, 2018 12:56 pm

im using dht11 and yl-69 soil moisture sensor.

Soil Moisture - https://www.aliexpress.com/item/Soil-mo ... 33290.html

DHT11 - https://www.adafruit.com/product/386

and 1 channel relay for wtaerpump

my main goals is, connect them together. and as i know my soil moisture sensor and dht11 both have DO so i only use digital output only . but for relay i haven't read any docs yet. so, my question how can i connect all of them? let we just say dht11 and soil moisture ?

i have read many soure that Raspi3 have 3 interfaces. 1-wire , SPI and I2C. and I2C have longest range sensor support maybe i will use this one instead of 1-wire and SPI. can you guys give me some visualization about connecting them ? may be do i need something like I2C expansion board depend on my requirement ?

fyi i already done connecting dht11 and soil moisture to raspberry pi 3 but its only separated. in this case , dht11 use pin 17 and Soil Moisture use pin 21. any suggestion and link for the source will be appreciated. thank you guys :D

edited : i was read basic flask web server. my plan is visualize data using webserver or maybe thingspeak API. but webserver is good enough for me. depend on the first reply of my post, i can connect all the sensors with only 1 file .(py) and display it as a webserver like i used to learn make webserver file with .py extension on this page : http://mattrichardson.com/Raspberry-Pi-Flask/ , am i correct ?
Last edited by Herlambang_Rizky on Thu Feb 01, 2018 1:20 pm, edited 1 time in total.

Massi
Posts: 1679
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Connecting Multiple Sensor

Thu Feb 01, 2018 1:00 pm

Herlambang_Rizky wrote:
Thu Feb 01, 2018 12:56 pm
my main goals is, connect them together. and as i know my soil moisture sensor and dht11 both have DO so i only use digital output only . but for relay i haven't read any docs yet. so, my question how can i connect all of them? let we just say dht11 and soil moisture ?
dht11 doen't use any of those interfaces
the D0 output of yl69 doesn't use any of those interfaces
a common relay board doesn't use any of those interfaces

So

Connect every sensor/device to a different spare GPIO and then code, code and code

Herlambang_Rizky
Posts: 25
Joined: Thu Dec 28, 2017 11:07 am

Re: Connecting Multiple Sensor

Thu Feb 01, 2018 1:16 pm

Massi wrote:
Thu Feb 01, 2018 1:00 pm
Herlambang_Rizky wrote:
Thu Feb 01, 2018 12:56 pm
my main goals is, connect them together. and as i know my soil moisture sensor and dht11 both have DO so i only use digital output only . but for relay i haven't read any docs yet. so, my question how can i connect all of them? let we just say dht11 and soil moisture ?
dht11 doen't use any of those interfaces
the D0 output of yl69 doesn't use any of those interfaces
a common relay board doesn't use any of those interfaces

So

Connect every sensor/device to a different spare GPIO and then code, code and code
so do you mean, i can use only 1 file (.py) for covering those sensors ? yes those sensors use different voltage, but how about relay ? 12v is the requirement for relay to be work. do i need separate powersupply for it ? thank you for your reply tbh

Massi
Posts: 1679
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Connecting Multiple Sensor

Thu Feb 01, 2018 1:53 pm

Herlambang_Rizky wrote:
Thu Feb 01, 2018 1:16 pm
so do you mean, i can use only 1 file (.py) for covering those sensors ?
why not?
yes those sensors use different voltage, but how about relay ? 12v is the requirement for relay to be work. do i need separate powersupply for it ? thank you for your reply tbh
Pi has 3,3 and 5V power supply. I let you understand if you can power a 12V device with that.
And Pi only reads 3,3V signals. take care of this if you don't want to see your pi dying

PhatFil
Posts: 391
Joined: Thu Apr 13, 2017 3:55 pm

Re: Connecting Multiple Sensor

Thu Feb 01, 2018 4:34 pm

http://www.instructables.com/id/Soil-Mo ... pberry-Pi/

https://github.com/adafruit/Adafruit_Python_DHT

you can probably google the relay board yourself using keywords "raspberry pi relay board setup python" or something similar ;)

Herlambang_Rizky
Posts: 25
Joined: Thu Dec 28, 2017 11:07 am

Re: Connecting Multiple Sensor

Thu Feb 01, 2018 7:30 pm

Massi wrote:
Thu Feb 01, 2018 1:53 pm


Pi has 3,3 and 5V power supply. I let you understand if you can power a 12V device with that.
And Pi only reads 3,3V signals. take care of this if you don't want to see your pi dying
so, i'll give you my opinion. let we just say. i have my own power source 12v for the relay (out of Pi). will it work if i only 2 GPIO pins for the data instead using the 5v GPIO pin + 2 GPIO pins for the data ?

i got my 2 channel relay that work for 5v . but many people said relay only work for 12 v. it have description on selling page on the web dont you ? thats thing i have fear about, misuse the powersource :oops: will make the pi drop dead or may be the relay like my sensor dht11 dead drop cause the misuse voltage . thank you for your suggestion anywy ;)

Return to “Beginners”

Who is online

Users browsing this forum: Andyroo and 19 guests