Application Note Application Note for Sensirion SHTC1 Xplained Pro Extension Board Getting Started with the SHTC1 Extension Board and Demo Code Summary Many of todays smart phones and tablets feature Sensirion provides a sensor wing board which is processors to allow low power always-on sensor data compatible with Atmels Xplained Pro platform. This board processing. Sensirion is partnering with leading sensor includes the SHTC1 humidity and temperature sensor hub manufacturer Atmel in their sensor hub initiative, a which is built for the consumer and mobile market, with its 3 collaboration to bring together sensor manufacturers and tiny 2x2x0.8mm footprint and 1.8V supply voltage. companies developing fusion algorithms and create an Sensirions sensor board can be combined with any of the expandable, unified platform to prototype new sensor already available extension boards providing touch subsystems for smart phones or wearable devices in a controls or display capabilities to quickly build powerful simple, plug-and-play fashion. systems and start developing right away. Required Hardware and Wiring To run the demo code, the Atmel SAMD20 Xplained Pro Board and the Sensirion SHTC1 Xplained Extension Board are needed. The SHTC1 extension board has to be connected to SERCOM extension position 2 (EXT2) as shown in Figure 1. BUTTON0 LED0 EXT2 SHTC1 Sensor Figure 1: STHC1 Xplained Extension Board connected to Atmel SAMD20 Xplained Pro Board www.sensirion.com Version 1 October 2014 D1 1/3 Application Note for Sensirion SHTC1 Xplained Pro Extension Board 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 CONTRIBUTORSAS I 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. www.sensirion.com Version 1.2 October 2014 D1 2/3