Hi,
I have purchased 5 temp and humid pro sensors, and connect to GrovePI+(firmware 1.2.7) with Pi B+.
I tried example code with 1 dht pro sensor, I got correct temp and humid values. But 2 or more sensors were connected to, I got strange situations.
I connected sensors to D2,D3,D4,D7,D8, then I made python code based on example like
[ temp,hum ] = grovepi.dht(2,1)
print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
time.sleep(1)
[ temp,hum ] = grovepi.dht(3,1)
print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
time.sleep(1)
[ temp,hum ] = grovepi.dht(4,1)
print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
time.sleep(1)
.
.
.
I couldn’t get values or same value from different sensors. Sometimes I got right values, sometime I got “nan” from same port sensor.
Then, I tried to read values whether sensors were connected to or not. I found that there was a difference between the port number on the code and the port number on the board.
D2 = port 3
D3 = port 4
D4 = port 5
D5 = port 6
D6 = port 7
D7 = port 8
D8 = port 1
So, I have some questions
Q1) Can I connect mutiple DHT Pro sensors to 1 GrovePI+?
Q2) How can I fix the port no difference?
Q3) How can I get the values more stable?
I’m not python guy and I’m not good English speaker. So I will explain in more detail if necessary.
I would appreciate it if you could help.
Taichi