Skip to content

SHT21 SHT25

Antonio Lignan edited this page Jan 28, 2016 · 5 revisions

SHT21/SHT25 Temperature and Humidity sensor

Available at Zolertia store

SHT21 digital temperature and humidity sensor

Technical details

  • Digital temperature and relative humidity sensor, controlled over I2C.
  • Supply voltage range: 2.1 to 3.6 V
  • Energy consumption: 3.2µW (at 8 bit, 1 measurement / s)
  • RH operating range: 0 - 100% RH
  • Temperature operating range: -40 to +125°C (-40 to +257°F)
  • RH response time: 8 sec (tau63%)

Available documentation (manufacturer)

Libraries and examples

Both Sensirion's SHT21 and SHT25 sensors are driver compatible and share the same library.

The Contiki sensor library can be found at platform/zoul/dev/sht25.c, check out the most updated version in Contiki repository.

To test the SHT25 sensor follow the next steps

  1. Grab Contiki and prepare the development setup (skip if you already have it)

  2. Connect the SHT25 sensor to the RE-Mote using the 5-pin cable as shown in the photo above. This is a 5-pin connector with 2.54 mm pitch spacing, if you are to connect using a different cable than the one provided, check out the RE-Mote pin-out and the connector information.

  3. Compile the test example and program the RE-Mote:

cd examples/zolertia/zoul
make test-sht25.upload && make login

You should see on your screen something similar to this:

(...)
  CC        ../../../cpu/cc2538/./startup-gcc.c
  CC        test-sht25.c
  LD        test-sht25.elf
arm-none-eabi-objcopy -O binary --gap-fill 0xff test-sht25.elf test-sht25.bin
python ../../../tools/cc2538-bsl/cc2538-bsl.py -e -w -v -a 0x00202000 test-sht25.bin
Opening port /dev/ttyUSB0, baud 500000
Reading data from test-sht25.bin
Firmware file: Raw Binary
Connecting to target...
CC2538 PG2.0: 512KB Flash, 32KB SRAM, CCFG at 0x0027FFD4
Primary IEEE Address: 06:15:AB:25:00:12:4B:00
Erasing 524288 bytes starting at address 0x00200000
    Erase done
Writing 516096 bytes starting at address 0x00202000
Write 8 bytes at 0x0027FFF8F00
    Write done                                
Verifying by comparing CRC32 calculations.
    Verified (match: 0xd86dcaa2)
rm obj_zoul/startup-gcc.o test-sht25.co
using saved target 'zoul'
../../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0
connecting to /dev/ttyUSB0 (115200) [OK]

Contiki-3.x-2102-g9f1376d
Zolertia RE-Mote platform
Rime configured with address ab:25
 Net: Rime
 MAC: CSMA
 RDC: nullrdc
Temperature 24.57 ºC, Humidity 47.22 RH
Temperature 24.57 ºC, Humidity 47.19 RH
Temperature 24.57 ºC, Humidity 47.15 RH
Temperature 24.56 ºC, Humidity 47.12 RH

If the above doesn't work, or if you see the following message:

Contiki-3.x-2102-g9f1376d
Zolertia RE-Mote platform
Rime configured with address ab:25
 Net: Rime
 MAC: CSMA
 RDC: nullrdc
Voltage is lower than recommended for the sensor operation

Check the wiring and connections, also check if the voltage is over 2.5V (sensor threshold), but as you are powering the RE-Mote over USB, this error is likely due to a bad connection. Try also enabling the DEBUG flag in platforms/zoul/dev/sht25.c by changing the current value to #define DEBUG 1, this will print more information on screen useful for debugging.

Clone this wiki locally