I would like to know is it possible to connect for example: thermometer and pressure sensor to one GPIO?
1 Answer
The answer is: it depends.
If you are dealing with 1-wire bus sensors, which are digital and can understand individual addressing, it is perfectly possible.
Just stack up to 10 of them in the 1-wire GPIO pin (check adafruit's tutorial on how to connect one and repeat for up to 10 in the same pin). This works, I have a configuration with 2 DS18B20 working perfectly.
The i2c protocol is also addressed, and should support connecting more than one device likewise. I haven't personally tested the implementation used on the Pi to be sure.
Other sensors/protocols might not understand addressing and just might not work.
-
1I2C certainly works on the Pi. It needs two gpios, for data and clock (and a ground connection). You can connect as many devices as can be uniquely addressed (112 for the Pi's 7 bit addressing). I've only had four connected at once.– joanMay 2, 2014 at 0:37