1SHT21 Driver (Relative Humidity and Temperature Sensor) 2======================================================= 3 4Overview 5-------- 6 7This is the driver for the relative humidity and temperature sensor commonly 8found on the WeatherCape expansion board for the BeagleBone. 9 10Interface 11--------- 12 13This driver implements the character device interface. It supports reading 14through /dev/sht21b{1,3}s40. When read from, it returns a string containing 15a data label, a colon, and the sensor value. 16 17Example output of `cat /dev/sht21b3s40`: 18 19TEMPERATURE : 35.014 20HUMIDITY : 25.181 21 22Temperature is expressed in Celsius (a.k.a. centigrade). Valid values are 23-40.000 to 125.000. 24 25Humidity is expressed as a percentage. Valid values are 0.000 to 100.000. 26 27Limitations 28----------- 29 30Intense activity causes the chip to heat up, affecting the temperature reading. 31In order to prevent the chip from self-heating more than 0.1C, the sensor 32values will only be read once per second. Subsequent reads within the same 33second will return cached temperature and humidity values. 34 35The measurement resolution is configurable in the chip, but this driver just 36uses the default maximum resolutions (12-bit for Humidity, 14-bit for 37temperature). It could probably be implemented with an ioctl() or by passing 38an argument via the service command, but it doesn't seem too useful at this 39time. See the data sheet for the trade-off between faster conversion time and 40lower resolution. 41 42In testing, the temperature sensor reported a value several degrees higher 43than an indoor thermometer placed nearby. It doesn't appear to be a bug in the 44driver as the Linux driver reports similar temperature. Additionally, the 45BMP085 temperature sensor on the same cape reports a temperature about 2 46degrees lower than the SHT21. This could be due to heat produced by the 47BeagleBone heating the cape slightly or maybe just a bad chip on the test 48board. 49 50Testing the Code 51---------------- 52 53The driver should have been started by a script in /etc/rc.capes/ If not, 54this is how you start up an instance: 55 56cd /dev && MAKEDEV sht21b3s40 57/bin/service up /service/sht21 -label sht21.3.40 -dev /dev/sht21b3s40 \ 58 -args 'bus=3 address=0x40' 59 60Getting the sensor value: 61 62cat /dev/sht21b3s40 63 64Killing an instance: 65 66/bin/service down sht21.3.40 67 68