Hello , i want to get measurements from this Humidity and Temperature Sensor - DHT20 - SEN-18364 - SparkFun Electronics? , it works with my arduino , but i want to know if i can share the data pin and connect it to my raspberry pi , in order to read the measurements from there too.... Is that possible ? Does anyone tried it ?
hi!
u could use 2 devices that communicate with that DHT22,
if u can make sure, that they dont try that at the same time...
that 1-wire protocol doesnt tolerate communication collisions...
u could try to do it like ethernet does it:
- carrier sense: a unit, that wants to talk, looks at the line for some time in order to c if communication is going on right now...
- collision detect: a talking unit reads the line during a write request in order to c if someone "overwrites" its communication...
have fun...
invader7:
Hello , i want to get measurements from this Humidity and Temperature Sensor - DHT20 - SEN-18364 - SparkFun Electronics? , it works with my arduino , but i want to know if i can share the data pin and connect it to my raspberry pi , in order to read the measurements from there too.... Is that possible ? Does anyone tried it ?
In principle, yes. However, there are the following considerations:
-
The Rasperry Pi uses 3.3V signal levels. Most Arduinos use 5V signal levels. So you will have to either use a 3.3V Arduino, or be very careful not to let the Arduino drive more than 3.3V on to that line. Or use a buffer chip or diode and 2 pins - see point 3 below.
-
Both the Arduino and the Pi need to drive the device using an open-collector output. I know how to do this on the Arduino, but not on the Pi.
-
If either the Arduino or the Pi is powered down, the other will not be able to read from the device. This can be solved, but you would need to use 2 I/O pins per device, an open-collector buffer chip and a couple of diodes.
Let arduino "read" the sensor and then inform raspberry Dr. Monk's DIY Electronics Blog: Raspberry Pi and Arduino
I think its the best/safe way for me...
Thanks !
Yes, if the Arduino will always be powered up when you want the Pi to read the sensor, that's a better way.