ZIO QWIIC Temperature & Humidity Sensor (SHT31) on the Raspberry Pi
12th December 2019![ZIO QWIIC Temperature & Humidity Sensor (SHT31) on the Raspberry Pi ZIO QWIIC Temperature & Humidity Sensor (SHT31) on the Raspberry Pi](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-22.png?resize=601%2C401&ssl=1)
The ZIO QWIIC Temperature & Humidity Sensor utilises the SHT31 sensor from Sensirion. The SHT31 has an accuracy of +/-0.3 degrees centigrade and +/-2% relative humidity. The board contains two QWIIC connectors to easily add it to the ZIO QWIIC ecosystem or can be connected to directly over I2C via the breakout pins.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/1-750x750.jpg?resize=467%2C467)
Here’s how we setup the ZIO QWIIC Temperature & Humidity Sensor on the Raspberry Pi.
Step 1 Setup the Raspberry Pi
Check out this super quick video on how to setup the Raspberry Pi.
Step 2 Connect
Connect the Zio development board with SHT31 Temperature & Humidity Sensor to the Raspberry Pi via the ZIO QWIIC HAT.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-22.png?resize=601%2C401)
Step 3 enable the I2C bus
Either from the Raspberry Pi’s desktop or via SSH, Open the terminal and type in:
sudo raspi-config and press enter.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-2.png?resize=602%2C288)
Using your keyboards arrow keys, select ‘5 Interfacing Options’ and press enter.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-3.png?resize=602%2C288)
Scroll down to ‘P5 I2C’ and press enter.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-4.png?resize=602%2C288)
Then select ‘<Yes>’ and press enter to enable the I2C interface for the ZIO QWIIC ecosystem.
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-5.png?resize=602%2C288)
Select ‘<Ok>’ and ‘<Finish>’ to return to the terminal.
Step 4 Download python script
Whilst still in the terminal type:
sudo git clone https://github.com/machineshopuk/SHT31
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-6.png?resize=602%2C288)
Step 5 Run the script
This will generate a folder called SHT31, enter it by typing:
cd SHT31
Then run the script by typing:
python SHT31.py
![](https://i0.wp.com/themachineshop.uk/wp-content/uploads/2019/12/image-7.png?resize=602%2C288)
The script will output temperature and humidity values to the terminal.