PDA

View Full Version : Sensirion humidity sensor



Charles Linquis
- 11th January 2008, 23:10
Is anyone willing to share the code to talk to a Sensirion SHTxx humidity/temp sensor?

Darrel Taylor
- 11th January 2008, 23:34
Not sure if you mean other than what's here?

http://www.picbasic.co.uk/forum/search.php?do=process&query="sht11"

hth,

Charles Linquis
- 11th January 2008, 23:43
Darrel,

Should have done a search first!

Thanks!

CocaColaKid
- 12th January 2008, 14:10
Charles,

If your interested I have working code that will give you a 100th of a percent in RH and a 100th of a percent in temperature for the full range of the sensor in Celsius, Fahrenheit and Kelvin. I also have code for checking the CRC thanks to Tom Estes. NavMicroSystems works fine but doesn't appear to handle negative temperatures though. If you're interested let me know and I'll post it when I get back to the office.

Charles Linquis
- 12th January 2008, 16:56
I'm interested. I have enough to do withought debugging even more code. Anything you could send would be greatly appreciated. If you want to send off-forum, I'll send you a private post with info.

ohararp
- 14th January 2008, 04:37
Charles, you have perked my interest with you claims. I am definitely interested in hearing about your approach.

Charles Linquis
- 14th January 2008, 05:22
I have made many claims, but not about the Sensirion! I think you are requesting the code that CocaColaKid is talking about.

CocaColaKid
- 14th January 2008, 13:32
The code was too long to post so I just attached it in a TXT file instead. I also included the data information that corresponds to the data output from the sensor. I used this information to verify my code math was correct. Hope this helps you guys out. If you have any questions please feel free to ask.

cheser
- 12th February 2008, 23:01
Thank you CocaColaKid. Your code works fine. But it takes 3 seconds to refresh data. Is there a way to reduce this time to a second? (with pic16f628a)

CocaColaKid
- 13th February 2008, 13:26
3 seconds sounds like an awful long time. I seem to read my sensor and once a second or so as I recall. There are only minimal pauses in the code and those add about 48 ms total. If it's taking longer than that I have no idea why.

tonyfelloni
- 1st October 2008, 17:55
Thanks for posting this code, Im just playing around with it now trying to get it to work. Can you tell me what chip this code will run on as is? Ive tried compiling it with MicroCode but it is giving me errors, most likely because i may need to change the way the fuse config is written.

Tony

skimask
- 1st October 2008, 18:00
Can you tell me what chip this code will run on as is?
Says in the file it's for a 16F88.
What's the problem with the fuses?

tonyfelloni
- 1st October 2008, 20:34
Hi

I think ive got most of the fuses converted so MCS can read them. The onlyone thats not working for me is the fuse for the Oscillator switchover. I have the following

@ DEVICE IESO_OFF

The code compiles fine with this but when i check the fuse settings in the programmer software I see that it is not setting this one. Do I have the define correct or is this just a glitch? It is showingas enabled with above code.

Cheers

Tony

skimask
- 1st October 2008, 20:43
@ DEVICE2 IESO_OFF

cheser
- 2nd October 2008, 23:25
Thank you CocaColaKid. Your code works fine. But it takes 3 seconds to refresh data. Is there a way to reduce this time to a second? (with pic16f628a)

I changed the "sleep 1" with "pause 1" in the code. It is realy fast now. ("sleep 1" is 1 second, "pause 1" is 1 ms.)

tonyfelloni
- 3rd October 2008, 00:11
Thanks Skimask for that, workin fine now.

Cheser cheers for you reply also. I was looking at the SHT11 data sheet the other day and if I remember it mentioned limiting the amount of queries sent to it over a second to reduce the self heating effect of the associated current.

Also in the code it says that PORTB.6 is the DS18B20 data line. This is a different type of temp sensor altogether and im a bit baffled as to why its there and I have no idea what the temp slider on PORTB.7 is used for. The rest i think i can figure out. Im going to set it all up in the next week and see how it goes.

Oh and a tip for anyone who is interested, the SHT11 Sensirion sensor is currently on sale on ebay.co.uk for £4 a pop and £.90 Postage. Compared to almost £20 with farnell.

Best Regards

Tony

CocaColaKid
- 7th October 2008, 15:48
The temp slider and the DS18B20 are components that I also use with this particular project. This is just the reading part for the SHT71, I just never took the other unused declarations out of code that's all.