Any code/libs developed that work with the SHTxx temp/humidity sensors

Before I start writing some code, just wanted to see if any already exists for the imp.

i finished writing something, can’t test as imp seems to have gone to sleep and will not wake up. will try tomorrow. msg me if you want it. will post if i remember and it works.

I would also be interested, I’m using the SHT15 breakout from Sparkfun and would like to get date out via the imp on an April. Right now I have an Arduino setup but it’s bulky and draws too much.

SHT15 will work just fine with the imp. Just beware, you need to bitbang because it’s not actually I2C (just nearly like it). Fooled me the first time I used one!

SHT2x series are much easier as they’re actually I2C compatible :slight_smile:

Are you willing to share sample code to get temp/humidity readings out?

Not really, as I don’t have an SHT15 any more (this was a project a couple of years ago) so no way of testing any code I’d port over… SHT2x would be less of a problem as we have that code on an imp.

I posted the code here for future reference:

Nice, thanks!

Afraid i’ve had no luck using your library. It compiles fine but all i get is s_getHumidity:writing data error s_getTemperature:writing data error temp=-40 hum=0.1

Did you encounter any timing issues? i’m using a SHT15.

SHT15 is not I2C. It just looks sorta a bit like I2C, but not enough to actually be compatible. I was bitten by this a few years back…

However, you can just bit-bang the interface to the SHT15 and it’ll work fine.

The trouble i’m having is with the bit-banging. Thereza’s code and various other examples i’ve implemented all appear to follow the SHT15 manaul, for the order and pulse rates required to communicate with the SHT15. So despite the appearance, and the assumption that it worked for the originators, i’m unable to get a successfull ack’s response.

So i was hoping that someone had code that they new worked for the SHT15.

You’ re right, SHT15 is “physically compatible” with I2C, as it uses dual, open-collector lines, but is not I2C protocol compatible, unlike SHT2x. If you are having troubles with your implementation, you can find a full documentation as well as communication protocol

I have the data sheet. Timings and sample code plus my own. Trouble is i simply can’t get a successful ACK back after the start transmission and command signal. I believe its possible, but perhaps not with the Sparkfun board, i’m just not sure. Other people have it working. I also can’t believe its this hard, or that the timings between messages (bit highlow on the data and sck lines) has to be so accurate.

It also works fine on the Arduino with really basic code and timings in comparison to the sparkfun board and the electric imp.

Unless i someone has 100% working code with an sht15 and sparkfun (in both cases) board, i’m not going to be able to work out what i’m doing wrong.

Unfortunately it looks like i’ll have to buy an arduino chip and interface that between the sht15 and imp.

If you look at @thereza’s post above, he has sample bitbang code for the SHT71, which is, I believe, the same “not quite I2C” interface that the SHT15 uses. Give that a try.

The timings are not critical on this interface, because it’s bit-banged and has a clock line.