Go Down

Topic: SHT15 Humidity/Temperature Tutorial (Read 22319 times) previous topic - next topic


I wrote a tutorial with some code of how to interface the SHT15 Humidity/Temperature sensor with my Arduino board.  I used this small project as a way to evaluate my new Arduino board.  Hopefully someone will find this tutorial helpful someday.  http://www.glacialwanderer.com/hobbyrobotics/?p=5

The Arduino board is awesome!  I don't think I've every used a microcontroller that was as easy to setup and start coding a useful driver/app as the Arduino has been.  The software and hardware are top rate, and the price is shockingly low.  Seriously I've been interfacing microcontrollers as a hobby for years and I can't believe how awesome and cheap these boards and software are.  It's a much better platform than multiple products I paid $100s for.  I truly appreciate everything this community has put together.  You guys rock!  I plan to post some articles/tutorials as I do some real projects with Arduino.  This is my way of trying to make Arduino even better.


Nice. Have you seen the other code how-to's around for the same sensor? I realize using someone else's code may not be as educational as doing it yourself - that's what I did. It does look like your code is more elegant & less sloppy than the code I wrote.

Regardless of the source, I think we should have a library for using this line of sensirion sensors. Also, it would be good to have a guide for the different kinds of sensors. I see you used sparkfun's breakout board for the SHT15. I used a parallax 28018 which is essentially the same thing. The SHT7x series are these sensors but with leads (not SMT), and I have found they are typically less expensive than the breakout boards.

One thing I noticed which your code does not appear to support, is the ability to turn on/off the sensor's internal heater. There are high-humidity applications which can make use of the heater to evaporate condensation build-up.

If a library is made it should probably support all the features of the SHT sensors. Maybe a second version could have CRC, but I've found CRC is not required and may be an unnecessary use of sketch space.


I did notice that others have written similar code and evidently you're one of those others  ;D.  In fact after I wrote my code I found that that Sensiron has some C code for this sensor that could nearly work.  

It would be nice if there was some central repository for interfacing different sensors, but maintaining that sort of database would require a knowledgeable and dedicated individual.  Also people would need to find it.  Maybe just using google is better.  

I completely agree that my code for sht15 doesn't do everything, but it does the most important stuff.  Later if I or someone else needs the heater, crc, lower power checking, less precision, resetting, or anything else sht15 supports it should be easy to add now that basic functionality is there.  I tend to keep it as simple as I can while fulfilling my needs.  In this case I plan to use this sensor for a robotic greenhouse project and all I need is temperature and humidity readings.


Apr 06, 2008, 02:30 pm Last Edit: Apr 06, 2008, 02:32 pm by tkbyd Reason: 1
It would be nice if there was some central repository





take you to a whole bunch of good stuff. Not EXACTLY the database of code for specific sensors the poster suggested, I know.

And here's a useful trick:

Put the following search into Google....

site:http://www.arduino.cc/ sht15

... and you'll get 6 references to the sht15 (humidity sensor), as you would expect... but only references found on the Arduino webpages, so you have some indication of their applicability to Arduino work.


Glacial_Wanderer, have you seen http://framistats.com ? It sounds a lot like what you're trying to accomplish, and it appears to be written for arduino  ;)


Yerg2k, you're on top of things.   :o  I did some searching before I started thinking too much about this project and didn't find anything that was very close to what I planned.  This framistats is closer than anything I found, but there are enough differences that I do think they're fairly different projects.  First my plan is to target a miniature greenhouse.  The device I'm planning to build is 2x2x1.5 feet.  Because of this I don't need to worry about networking multiple Arduinos ones together like they do, but I do plan to network it to a PC so I can log environmental stats.  While the controlled lighting, watering, and temperature systems would be a great device for just growing plants, my ultimate goal is to use this controlled environment to assist my time lapse photography hobby so I'll probably be adding some features to help with that.

The main difference besides scale is that I plan to release full code and hardware descriptions for my project where as it seems framistats is going to try and sell theirs (this of course doesn't exclude them from publishing all the software and hardware, but is sometimes ends up this way).  Even if they are going to publish full details on something it never hurts to have a few solutions to the same problem.  Competition is good even when it's just our hobby.

Thanks for pointing this site out, I'll keep an eye on it.



It's interesting to here what people are using these sensors for because it gives the rest of us great ideas.

Great writeup!


Glacial_Wanderer, to the best of my knowledge the framistats is a single arduino interfaced to a PC, and is meant for smallish environments. Also, I have seen in the past an open-source framistat which was stand-alone (no pc). Open-source everything was probably considered, but one needs to make a living somehow no? Still, I'd be willing to bet the framistats project is held back due to lack of money getting certifications (CE, UL), which would be necessary to sell the device as a consumer appliance and be protected from lawsuits should the device malfunction. A way to get around this, of course, is having people build their own.

One other thing I've thought of to tackle the problem mentioned above, is by using already-certified devices to switch the power. Such as, X10, which arduino has a how-to for, regarding controlling x10 devices using an arduino.

The biggest challenge is writing the PC software, especialy if one wants the arduino-controller to run independently of the PC. This is important as computers tend to fail.


I think framistats is spying on us.  I just checked and they are talking about X10  :D

On a more serious note, I didn't mean to imply that not open sourcing projects is bad.  I just said I would be open sourcing my work.  Mainly so that others can learn or derive entertainment from my hobby.  I can afford it because this is just a fun for me.  I completely understand some people want to make money on this and I wish them the best in their efforts.  My real job is with a large computer hardware designer and the last thing I want them to do is open source their software and hardware because then they couldn't afford my salary!


Actually I'm the person behind the framistats effort. I posted about the X10 awhile back, maybe 2 months ago when I actually took some action. The idea has been tossed around and even worked on somewhat in 2003 (see: X10 appliance timer, although this version interfaced directly to a wireless keyfob).

I've been toying with the idea of using X10 as I saw arduino has a page about it. I picked up two PL513 power-line interfaces at a cost of about $5 each. These devices have 4 wires and allow a microcontroller to put X10 commands on the power line. My main concern with this option is reliability, which can be affected by line noise and/or faulty house wiring, among other things.

As for the making money part, the lack of certifications as well as, no money for patents, keeps me from mass production. Well, also I'm pretty lazy and unmotivated lately, and neck-deep in medical problems. Still, there is a certain niche market which I've been targeting (albeit half-asses). It is actually the hobby which prompted me to make these devices. I'd love to produce such a thing but I hold myself back for being scared of the technicalities. This is partly why I've leaned towards open-source, and perhaps just selling my PC software. Plus I like to contribute to the open-source world, really.

Every once in awhile I'll see someone's project trying to accomplish the same task, and I have even collaborated with people trying to do this and make a commercial product from it. But more times than not, the whole thing either turns out to be more than they can handle, or they lose interest in it (as is the case with me, often).

In five years of tinkering with environmental monitoring and control, I have only seen one product tailored to the hobbyist, within the budget of a hobbyist. That is growtronix, however I tend not to like it because a) the high price, b) the fact that if the computer loses power or the software crashes, nothing works. And c) they're competition, naturally. I hear that growtronix is a one-man operation, and it works like this: You pay them, then they order the parts and build it, and send you your system when they're done in about 3-6 weeks.

The one innovative feature of theirs is the use of telephone cable as interconnects (RJ11). Their various sensors use some standard in automation (CAM?) so that could have its benefits over something completely proprietary; the interconnects allow expandability. But OTOH, using X10 in a device like this would offer up to 255 different devices to be switched.

Anyways, I wanted to put all that out there for anyone who stumbles upon this thread and would like more information. If you would like I can dig up more notes and links to other's similar projects for your reference - in five year's time I've amassed quite a collection and have considered environment automation from almost every angle conceivable  :D


That's interesting.  I had no idea that all this existed.  As for what I'm doing it's not going to be nearly as robust or durable as these commercial products you're talking about.  I just want something cheap and simple that gets the job done and that other DIY-ers can implement/expand if they want.  I have my fun making the prototypes not doing the polish.  It seems like there must be a market for a more robust system like yours.  I hope you succeed.

If it's not too much trouble, I'd love to see a list of related products that you've found over the years.  Growtronix while not a technological wonder was very interesting to me because it was a shipping product.  It actually seemed pretty cheap to me for what you get.  I mean it's obviously low volume and usually that means much higher cost.



I've been enjoying the program listed in the Glacial_Wanderer's homepage so much after some hard times figuring out myself.

Well, this time, I'd like to know wheter anyone could share experiences regarding multiple connections of SHT15 sensors, in some sequential mode not necessarily in simultaneous mode, using the Arduino Diecimila.
I remember some post suggested not to use 0(zero) and 1 port for data/sck for troublesome acquisition.



I'm having trouble getting consistently accurate readings off an SHT71 sensor using this code.  The first reading I get is fine, but if I wait 30-40 seconds and grab another reading, I find the temperature has shot up 10C / 18F.  Any idea why that happens?  Could this code be turning on the internal heater in the SHT7x models?

Any help would be greatly appreciated.


I'm seeing a similar problem where the initial temperature read from the SHT71 is correct but after waiting about 30 seconds the temperature reading has climbed by around 18 degrees Fahrenheit even though the sensor is in a stable environment where the temperature hasn't changed at all.

I've seen commentary that :

a) Decoupling capacitor might help (yet there seems to be one on the module).
b) a pull-down resistor on the clock line might help.
c) Soldering directly to the leads of the SHT71 (with short 22AWG link wires in my case) may cause problems.

I'm about to try the first two items - had you found any solution to your problem ?


I haven't come up with anything yet, but I've found the heating can be pretty constant after the initial warm up period.  My quick fix was to add some calibration code to subtract the N degrees I knew it had warmed up.

Go Up