Setting up SHT11 Humidity and Temperature Sensor

9 posts
by mangels09 » Wed Mar 27, 2013 12:51 am

I recently received the sht11 breakout board from Adafruit (this one >> ). I would like to use the rpiSht1x python package (found here >> ) to interface with it.

The issue is that I really don't know how to connect the sensor to my Raspberry Pi. I have seen the datasheet (found here >> ... onDocs.pdf ). Unfortunately, I am still confused as to which pins I should use on the Pi.

I have been successful connecting other better-documented sensors (BMP085, DHT11, DS18B) to the Pi, but honestly that is the only experience with low-level peripherals that I have.

Thank you in advance for any help that you can provide.
Posts: 5
Joined: Fri Feb 17, 2012 5:03 am
by mangels09 » Wed Mar 27, 2013 3:41 am
So I did some fiddling around with the sensor tonight and it looks like I got it working after all. I should've looked at the example rpiSht1x code more thoroughly first. So, I'm sorry that I made a somewhat useless thread, but I'm glad I learned what I needed.

Overall, I'm pretty impressed with the sensor so far. Much better than the DHT sensors anway...

I'll stay subscribed to this thread so I can offer (limited) help to anyone else that runs into trouble.
Posts: 5
Joined: Fri Feb 17, 2012 5:03 am
by annirak » Wed Mar 27, 2013 1:00 pm
The SHT1x series is a truly excellent set of sensors. I've used the SHT15 for monitoring air temperature/humidity in an arctic remote sensing application. If you contact Sensirion, they will give you the equations to improve the accuracy beyond what the basic app-note gives you. One problem I did have was that I could never get the CRC to work correctly. Let me know if you figure that out!
Posts: 9
Joined: Tue Nov 08, 2011 5:06 pm
by Rupz007 » Thu Jun 26, 2014 6:51 am
Hi, I know this is an old post but I would be so grateful if you could enlighten me with the way you got the SHT11 sensor to work with the code? I seem to be getting an NACK on the readings? Do you happen to have a basic circuit to share? Thanks in advance! :)
Posts: 4
Joined: Thu Jun 26, 2014 6:48 am
by mangels09 » Sat Jun 28, 2014 5:20 pm
I wired the sensor up just as suggested on here => ... n-v1.0.pdf

Make sure to specify whatever pins you are using in your code. There is more information here => ... pberry-pi/

Let me know if you need more help. I don't have that sensor with me anymore so I can't test it, but I'll help you out as much as I can.
Posts: 5
Joined: Fri Feb 17, 2012 5:03 am
by Rupz007 » Thu Jul 03, 2014 9:05 am
Hi mangels09

Thanks for this, really helpful!

I shall give it a try and get back to you if I have any issues.

Posts: 4
Joined: Thu Jun 26, 2014 6:48 am
by Rupz007 » Thu Jul 03, 2014 2:28 pm
Great news!

Managed to get a reading and it was due to the code for the Rpi_SHTx1 having the DATA and CLK pins incorrectly mixed up!

Thanks again Mangels09! :)
Posts: 4
Joined: Thu Jun 26, 2014 6:48 am
by Rupz007 » Mon Jul 28, 2014 11:46 am
Hello again!

After successfully implementing the SHTx11 sensor with the raspberry Pi, my next challenge is to use multiple sensors to monitor different areas in the room. I know that it is possible to utilise the CLK pin multiple times and then allocating a data pin for each SHT11 sensor.

My issue is that for some reason I cannot perform this easily as the RPiShtx.h library really only caters for one.

I'm trying to set up multiple #defines for the various sensors within the RPiSHt1x.h library but wanted to know if there is an easier way to do this?

Any help or info would be greatly appreciated! :)

Posts: 4
Joined: Thu Jun 26, 2014 6:48 am
by ochikov » Sun Mar 05, 2017 3:34 pm
I know that the theme is pretty old, but can somebody help me with SHT10 sensor. I wire it up as follows:

Green wire - GND
Blue wire - P17
Red wire - 3.3V
Yellow wire - P04 Clock
I use a 10K pullup resistor from blue wire to red wire.

I have install the library

This is my code:

Code: Select all
from sht1x.Sht1x import Sht1x as SHT1x
dataPin = 11
clkPin = 7
sht1x = SHT1x(dataPin, clkPin, SHT1x.GPIO_BOARD)

temperature = sht1x.read_temperature_C()
humidity = sht1x.read_humidity()
dewPoint = sht1x.calculate_dew_point(temperature, humidity)
print("Temperature: {} Humidity: {} Dew Point: {}".format(temperature, humidity, dewPoint))

when i try to run it, i have the following errors:

Code: Select all
Traceback (most recent call last):
  File "", line 7, in <module>
    humidity = sht1x.read_humidity()
  File "build/bdist.linux-armv7l/egg/sht1x/", line 78, in read_humidity
  File "build/bdist.linux-armv7l/egg/sht1x/", line 82, in read_temperature_C_and_humidity
  File "build/bdist.linux-armv7l/egg/sht1x/", line 70, in read_temperature_C
  File "build/bdist.linux-armv7l/egg/sht1x/", line 157, in __waitForResult

I have read in another threat that have to change some line of codes in the python package, but I don't know how to do it.
This is the other thread: ... 7#p1124717

Thank you in advance!
Posts: 5
Joined: Wed Mar 01, 2017 9:11 pm