ACH SHT1x Click RPi Demo

Version 1.0.0 Released 2014-08-24


Overview

After the success of my previous MikroElektronika GPS Click, and Thumbstick Click board blog posts, I thought I'd write up a tutorial on reading temperature and humidity with a MikroE SHT1x Click board and a Raspberry Pi. This blog post includes a python script that reads the SHT1x Click board data using I2C and displays the temperature, humidity, and dew point results from the sensor.

Raspberry PI Interfacing Notes

Raspberry Pi and SHT1x Click Board

The SHT1X Click board is connected to a Raspberry Pi using the MikroE Pi Click Shield. This shield connects to the Raspberry PI GPIO header pins and lets you attach MikroBus format Click boards.

If you don't have a Pi Click Shield or a SHT1x Click board, you can get one from the MikroElektronika Webstore, or from Digikey, or Farnell.

Pi Click Shield

The SHT1x Click board uses an I2C based Sensiron SHT11 module for reading the temperature and humidity. The temperature sensor measures a range of -40°C to +100°C in half degree increments. The board is powered on 3.3 Volts from the GPIO header on the Raspberry PI.

For more details on the sensor, take a look at the included SHT1x PDF datasheet.

SHT1x Click

The SHT1X board connects to the Raspberry Pi using the following connections:

Download the Library

You can download the latest release of the ACH-SHT1x-Click-RPi-Demo.zip example from the Libstock site:

http://www.libstock.com/projects/view/1084/ach-sht1x-click-rpi-demo

Admin Privileges Required

Scripts that use the GPIO and I2C hardware interfaces need to be run with sudo since GPIO reading requires admin privileges on Linux.

That means you need to run the sht1x_click.py demo python script using:

sudo python sht1x_click.py

Driver Setup and Installation

Step 1. Download the Library

cd ~/
wget https://pypi.python.org/packages/source/r/rpiSht1x/rpiSht1x-1.2.tar.gz

Step 2. Expand the file in the Raspbian File Manager using the right click "Expand Here" contextual menu item.

Step 3. Install the rpiSht1x library using:

cd rpiSht1x-1.2
sudo python setup.py install

Step 4. To verify the library is installed correctly check if the SHT1x module is listed in the python interactive help section:

python
>>> help('sht1x')

To quit the python interactive session type:

>>> exit()

Step 5. Now, let's run the sht1x_click.py script from the terminal:

sudo python sht1x_click.py

If the script runs correctly you will be presented with the following output in the terminal:

sht1x_click.py Script

You can quit the python script by pressing the Control+D hotkey.


SHT1x Click Board Demo Ported by Andrew Hazelden

Email: andrew@andrewhazelden.com
Blog: http://www.andrewhazelden.com
Twitter: https://www.twitter.com/andrewhazelden

Based upon the code and library from the pypi.python.org website:
https://pypi.python.org/pypi/rpiSht1x/1.2

rpiSht1x Created by Luca Nobili (lunobili):
https://bitbucket.org/lunobili/rpisht1x