Application Note for Sensirion SHTC1 Xplained Pro Extension Board
www.sensirion.com Version 1.2 – October 2014 – D1 2/3
Functionality of Demo Code
The provided demo code implements communication with the SHTC1 sensor over the I2C bus. Values are read in a loop and
used for detection of breathing on the sensor (so called Air-Touch).
On reset/start, a reference humidity value is calculated. During operation, humidity values are read in a loop and the difference
between current value and reference value is calculated. If the difference exceeds a given threshold, LED0 is turned on.
BUTTON0 can be used to re-initialize the reference value.
In addition, humidity values and calculated dew point values are sent to host PC over USART. When the example from Atmel
studio is running, the output can be read with any serial port terminal program (e.g., hyper-terminal or Tera term) from EDBG
Virtual COM Port.
Code Structure
The code is structured as follows:
SHTC1 driver (shtc1.c and shtc1.h)- Implements I2C driver for SHTC1 sensor
Main file (main.c) – Contains an entry point of an example. The code in this file calls initialization routines and
subsequently starts the main loop, where values from the SHTC1 sensor are read and air-touch is detected
Helpers (demo_tools.c and demo_tools.h) Contains implementation of helper functions, e.g., printing messages
back to the terminal (for debugging purposes) and initialization of I2C board support.
References
More information on the SHTC1 can be found at www.sensirion.com/SHTC1.
License
Copyright (c) 2014, SENSIRION AG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.