Author | Eur van Andel, eur@fiwihex.nl Copyright (c) 2008 |
Adapted-by | |
Compiler | =2.4h |
The Sensirion SHT1x/SHT7x is a single chip relative humidity and temperature multi sensor module comprising a calibrated digital output. It comes in 5 flavors, with different accuracy and package style: sensor hum acc temp acc package SHT10 4.5 0.5 SMD (LCC) SHT11 3.0 0.4 SMD (LCC) SHT15 2.0 0.3 SMD (LCC) SHT71 3.0 0.4 4-pin single-in-line SHT75 1.8 0.3 4-pin single-in-line all consist of the same silicon: the less accurate models are sold cheaper. My experience is mixed: I've seen some consistent +2C offset in temperature, but good humidty measurements. The 4-pin package breaks when you touch it. The SMD package has naked tracks underneath: you can't route under it! If exposed to >95% RH for 10 minutes, these sensors will go beserk and need <60% RH for an hour to recover. You might try heating them. protocol is close to I2C, but not the same. Remember to pull up DATA. 0b0000_0011 starts temperature measurement 0b0000_0101 starts humidity measurement device returns three bytes: MSB, LSB and CRC higher functions don't do a CRC check
http://www.sensirion.com/en/01_humidity_sensors/00_humidity_sensors.htm
No dependency found
read_raw_hum_sht(byte out MSB, byte out LSB, byte out CRC)
read_hum_word_sht(word out hum)
sht_get_data(byte out x)
sht_start()
sht_put_ack()
sht_conn_reset()
sht_wait_ack()
sht_reset()
sht_put_data(byte in x)
read_hum_sht(byte out hum)
read_raw_temp_sht(byte out MSB, byte out LSB, byte out CRC)
read_raw_hum_sht(byte out MSB, byte out LSB, byte out CRC)
read raw 12-bit humidity from SHT default value of resolution bit is 12 bit RH SHT takes 55 ms for measurement @ 12 bits we will wait 70 ms SHT may only be switched on for 10% of the time because of self-heating so this measurement can only happen every 500ms
read_hum_word_sht(word out hum)
read humidity from SHT, result in word precision 0.01%RH SHT may only be switched on for 10% of the time because of self-heating so this measurement can only happen every 500ms
sht_get_data(byte out x)
receive one byte from the SHT
sht_start()
send start
sht_put_ack()
send ACK
sht_conn_reset()
reset SHT interface, must be followed with sht_start and command
sht_wait_ack()
pretend to wait for ACK
sht_reset()
reset SHT
sht_put_data(byte in x)
send one byte to the SHT
read_hum_sht(byte out hum)
read humidity from SHT, result in byte precision 1%RH SHT may only be switched on for 10% of the time because of self-heating so this measurement can only happen every 500ms
read_raw_temp_sht(byte out MSB, byte out LSB, byte out CRC)
read raw 14-bit temperature from SHT default value of resolution bit is 14 bit temperature SHT takes 210 ms for measurement @ 14 bits we will wait 300 ms SHT may only be switched on for 10% of the time because of self-heating so this measurement can only happen every two seconds!
sample | 16f876a_sht.jal |