Application Note Application Note for Sensirion SHTC1 Xplained Pro Extension Board Getting Started with the SHTC1 Extension Board and Demo Code Summary Many of today's smart phones and tablets feature processors to allow low power always-on sensor data processing. Sensirion is partnering with leading sensor hub manufacturer Atmel in their sensor hub initiative, a collaboration to bring together sensor manufacturers and companies developing fusion algorithms and create an expandable, unified platform to prototype new sensor subsystems for smart phones or wearable devices in a simple, plug-and-play fashion. Sensirion provides a sensor wing board which is compatible with Atmel's Xplained Pro platform. This board includes the SHTC1 humidity and temperature sensor which is built for the consumer and mobile market, with its tiny 2x2x0.8mm3 footprint and 1.8V supply voltage. Sensirion's sensor board can be combined with any of the already available extension boards providing touch controls or display capabilities to quickly build powerful 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 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. www.sensirion.com Version 1.2 - October 2014 - D1 2/3 Application Note for Sensirion SHTC1 Xplained Pro Extension Board Headquarter and Sales Offices SENSIRION AG Laubisruetistr. 50 CH-8712 Staefa ZH Switzerland Phone: + 41 (0)44 306 40 00 Fax: + 41 (0)44 306 40 30 info@sensirion.com www.sensirion.com SENSIRION Korea Co. Ltd. #1414, Anyang Construction Tower B/D, 1112-1, Bisan-dong, Anyang-city, Gyeonggi-Province, South Korea Phone: +82-31-440-9925~27 Fax: +82-31-440-9927 info@sensirion.co.kr www.sensirion.co.kr SENSIRION Inc Westlake Pl. Ctr. I, suite 204 2801 Townsgate Road Westlake Village, CA 91361 USA Phone: +1 805-409 4900 Fax: +1 805-435 0467 michael.karst@sensirion.com www.sensirion.com SENSIRION China Co. Ltd. Room 2411, Main Tower Jin Zhong Huan Business Building, Postal Code 518048 Futian District, Shenzhen, PR China Phone: +86 755 8252 1501 Fax: +86 755 8252 1580 info@sensirion.com.cn/ www.sensirion.com.cn SENSIRION Japan Sensirion Japan Co. Ltd. Shinagawa Station Bldg. 7F 4-23-5 Takanawa Minato-ku, Tokyo, Japan Phone: +81 3-3444-4940 Fax: +81 3-3444-4939 info@sensirion.co.jp www.sensirion.co.jp Find your local representative at: http://www.sensirion.com/reps Revision History Date Author Version Changes 07.08.2014 SDE/TPO 1 First Version 23.09.2014 CCO 1.1 Layout changes 09.10.2014 CCO/JWI 1.2 Released 24.10.2014 CCO 1.3 Minor changes www.sensirion.com Version 1.2 - October 2014 - D1 3/3 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Sensirion: 1-101204-01