SENSIRION SHT31 Smart Gadget User Guide

June 13, 2024
SENSIRION

SENSIRION SHT31 Smart Gadget User Guide

SENSIRION SHT31 Smart Gadget User Guide

  • SHT31 humidity and temperature sensor
  • LCD display for humidity, temperature and dew point in °C and °F
  • Bluetooth Low Energy (BLE) connectivity to iOS and Android smartphones
  • iOS and Android apps available
  • Data logging capabilities
  • Complete hardware, firmware and software design resources available

Introduction

The SHT31 Smart Gadget is a reference design circuit board which demonstrates the outstanding performance and ease of use of Sensirion’s humidity and temperature sensors. It not only shows humidity and temperature values on the display, but it can also communicate wirelessly with a Bluetooth Smart capable device like a smartphone. For developers, full design resources of the SHT31 Smart Gadget are available on GitHub.

Development Kit Contents

SENSIRION SHT31 Smart Gadget - Development Kit
Contents

  • Smart Gadget main PCB equipped with SHT31 sensor, LCD display, push button and BLE module, including battery, supports and quick-start guide

  • Apps for iOS and Android devices for
    download in respective app stores

  • Complete design resources available on GitHub:
    – Hardware design (PCB layout, BOM)
    – Firmware code
    – Bluetooth profile definition
    – Source code for iOS and Android apps

Quick Start Guide

SENSIRION SHT31 Smart Gadget - Overview

1. Getting Started

  • Remove battery foil
  • Break apart supports and slide main board into slots

2. Standalone Operation

  • RH&T values are shown on the LCD display
  • Switch between RH and dew point by pressing the button

3. Enable Bluetooth

  • Press switch button for >1 sec.
  • Smart Gadget ready to pair with a Bluetooth device

4. Operation with Smart Gadget App

  • Download iOS or Android Smart Gadget app from your app store
  • Start the app and connect Smart Gadget with your smartphone through the app

Further information: www.sensirion.com/gadget

Standard Operation

2.1 Assembly Instructions
Take the two supports and break them apart. Slide the circuit board into the slots in the supports, with one support on each side of the LC display. Remove battery insulation foil. Optionally, the temperature can be displayed in °F by pressing the switch button while inserting the battery.

SENSIRION SHT31 Smart Gadget - Assembly Instructions

2.2 Operation in Standalone Mode
This is the default operating mode. The measured values are shown on the LC display. The upper line optionally shows relative humidity or dew point temperature while the lower line shows temperature. To switch between relative humidity and dew point display, briefly press the switch button.
For displaying temperature values in °F, press the switch button while inserting the battery.

2.3 Operation in Bluetooth Mode
To enable (and disable) Bluetooth Smart mode, press the switch button for more than 1 second. When enabled, the Bluetooth symbol in the display starts blinking. The device ID is shown on the display for a short time and the SHT31 Smart Gadget is visible for master devices (“advertising mode”). In this time period, a master device running a compatible app or software can establish a connection to the SHT31 Smart Gadget. An effective connection to a master device is indicated by a constantly displayed Bluetooth symbol. If the connection to a master device is lost, the Bluetooth symbol will start blinking. Once the SmartGadget is within reach again the connection is established automatically. The battery life is improved when the Bluetooth mode is disabled.

2.4 Connecting to a Bluetooth Device
To connect the Smart Gadget to a smartphone, the Smart Gadget app has to be installed on the smartphone and
Bluetooth has to be enabled on the smartphone. To connect to a Smart Gadget, the corresponding Smart Gadget has to be selected in the “Settings” tab in the app.
Smartphone apps can be downloaded from the corresponding app stores: iOS (Apple iTunes Store): https://itunes.apple.com/US/app/id787249829?mt=8
Android (Google Play Store): https://play.google.com/store/apps/details?id=com.sensirion.smartgadget&hl=de
Please note that in order to work with the Smart Gadget, a smartphone or tablet needs to be Bluetooth 4.0 compatible.

2.5 Using the Smart Gadget as a Data Logger
The Smart Gadget stores the measurement values in the built-in memory. The measurement interval can be defined through the app (“Settings”). The Smart Gadget will log measurement values even if the Bluetooth connection is terminated. The stored values can be downloaded and displayed on the smartphone via the app.

2.6 System Requirements
In order for a mobile device to work with the Smart Gadget it needs to be Bluetooth 4.0 (also known as Bluetooth Low Energy, BLE or Bluetooth Smart). This is the case for the majority of Android devices starting from approximately generation 2013 and newer, Apple iPhones generation 4S and newer, and Apple iPad generation 3 and newer.

© Copyright Sensirion AG, Switzerland

The Smart Gadget apps run with Android 4.3 or later and iOS 8 or later, respectively

2.7 Important Security Advices

  • Keep out of reach of children and pets (contains swallowable parts)
  • If any part is swallowed, contact a physician immediately
  • Battery type: CR2032
  • Dispose of the battery properly (special waste)
  • Smart Gadget operating temperature range: -10 to 60 °C
  • The Smart Gadget is intended for indoor use
  • The Smart Gadget is sensitive to electrostatic discharge (ESD) – please take precautions

Extended Information for Developers

The SHT31 Smart Gadget is designed to be a reference design and development kit that helps developers to kick-start their own projects with an SHT3x sensor, Bluetooth module and corresponding apps.
The design resources are published on Sensirion’s GitHub page https://github.com/Sensirion. They include:

3.1 Hardware

3.1.1 Block Diagram

SENSIRION SHT31 Smart Gadget - Block Diagram

3.1.2 Bill of Materials

SENSIRION SHT31 Smart Gadget - Bill of Materials

SENSIRION SHT31 Smart Gadget - Bill of Materials 2

3.1.3 PCB Layout

SENSIRION SHT31 Smart Gadget - PCB Layout

PCB layout data including schematic, Gerber files, assembly files and bill of materials is available on GitHub:
https://github.com/Sensirion/SmartGadget-Hardware

3.2 Firmware for BLE Module

The firmware for the BLE module can be found on GitHub:
https://github.com/Sensirion/SmartGadget- Firmware/tree/master/BLE_Module_nRF51822

3.2.1 Debugging
3.2.1.1 Required Tools

  • IDE: Keil uVision 4 or 5
  • Debugger for Cortex M0 Devices (j-Link, j-Link Lite, ULINK2, …)

3.2.1.2 Preparation
Connect your debugger to the Smart Gadget debug interface ST1.

SENSIRION SHT31 Smart Gadget - Preparation

The RX/TX Pins are not used by the Debugger but can be optionally used by your own application as a serial debug interface for print messages. Connect the signals according to your debugger pin-out. Standard pin- outs for ARM Debuggers are:

SENSIRION SHT31 Smart Gadget - The RX TX Pins are not used by the
Debugger

The 3V Pin of ST1 goes to VCC on the Debugger.

3.2.1.3 Steps to Flash/Debug BLE Module Firmware

  1. Download or clone the Smart Gadget Firmware from https://github.com/Sensirion/SmartGadget-Firmware.
    The folder contains the firmware for the nRF51822 Bluetooth Low Energy Chip (Folder BLE_Module_nRF51822) which runs the application and the firmware for the LCD Driver (Folder LCD_Driver_MC9S08LL8). The scope lies on the nRF51822 thus the application and not on the LCD driver that basically just drives the LCD Pins.

  2. Open the project file SmartHumigadget.uvproj located in the BLE_Module_nRF51822 Folder The project is made for the Keil uVision 4 but can also be opened/converted with Keil uVision 5. If the programming algorithm under target options->Utilities->Settings is missing, download and install the Nordic SDK and follow the instructions here: https://devzone.nordicsemi.com/question/2243/how-to-add-flash-programming-algorithm/

SENSIRION SHT31 Smart Gadget - Open the project file SmartHumigadget.uvproj
located in the BLE_Module_nRF51822 Folder

  1. Compile the project

The free 32kB licence of Keil uVision is sufficient for compilation, the project currently uses around 30kB.
SENSIRION SHT31 Smart Gadget - The free 32kB licence of Keil uVision is
sufficient for compilation, the project currently uses around
30kB

  1. Download to target and optionally start debugging
    SENSIRION SHT31 Smart Gadget - Download to target and optionally start
debugging

3.2.2 BLE Profile Description

There are five services available:

  • The Device Information Service contains information about the device, manufacturer, versions etc.
  • The Battery Service contains a Battery Level Characteristic (Level in %).
  • The Logger Service can optionally be used to retrieve historical sensor data.
  • And finally there are two services, one for the humidity and one for the temperature, where the measured sensor data can be read or retrieved with notifications represented as Float32T.

There is no official profile defined by Bluetooth SIG for Temperature/Humidity sensors and the profile described here is proprietary. Besides transmitting the live values, the device always logs the sensor values and if needed, historical data can be retrieved over Bluetooth Low Energy.

Device Behavior:

  • BLE Advertising: If the button is pressed long enough (>1s) the BLE Advertising is turned on. After disconnection, the device enters again the advertising mode. The advertise packages are sent every two seconds. To turn off BLE Advertising, the button has to be pressed again for more than 1s.
  • Connection parameters: After a connection is established, the device remains for a minute within the initial connection speed (depending on the used device). If the logger download is not started at this point, the device requests a slower connection interval (1 second) to save energy. If logged data is requested, the device requests a faster connection interval again.
  • Logger: The logger is always running. The physical values are logged separately, whereas the available memory is shared among them. If you change the logging interval, the memory gets cleared. To retrieve the data, follow this procedure:
    o Subscribe for notification of the Value-Characteristics of the desired services (e.g. Humidity- and/or Temperature-Characteristics)
    o Write your (host) current timestamp (64bit, milliseconds) into the SyncTimeMs characteristic.
    o Write or leave zero the OldestTimestampMs Characteristics. If left zero, all logged data is retrieved. If set to a time between now (=SyncTimeMs) and zero, all available data between these points in time is retrieved.
    o The host can retrieve the NewestTimestampMs, which contains the timestamp of the latest logged value calculated back from the SyncTimeMs timestamp. This characteristic gets updated only after the SyncTimeMs was written. The host can modify this value as well to retrieve only a certain block of data in the past. After modification the value is adjusted to the timestamp of the previous available measurement.
    o Write a non-zero value to StartLoggerDownload. The subscribed Value- Characteristics start notifying the logged values in the following notification format:
    i. first four bytes: sequence number starting from 0 and increasing
    ii. next n*four bytes: logged float32 values where n can be between one and four
    Every service’s LoggedValues Characteristic has its own increasing sequence number. They can be distinguished by their unique handle number and the corresponding UUID.

Following is a simplified visualization of the device’s profile:

SENSIRION SHT31 Smart Gadget - Following is a simplified visualization of
the device’s profile

https://github.com/Sensirion/SmartGadget- Firmware/blob/master/Simple_BLE_Profile_Description.pdf

3.3 Firmware for LCD Driver
The firmware for the LCD driver can be found on GitHub:
https://github.com/Sensirion/SmartGadget- Firmware/tree/master/LCD_Driver_MC9S08LL8

3.4 Software

3.4.1 iOS SmartGadget App

The software code for the Smart Gadget iOS app can be found on GitHub:
https://github.com/Sensirion/SmartGadget-iOS

3.4.2 Android SmartGadget App

The software code for the Smart Gadget Android app can be found on GitHub:
https://github.com/Sensirion/SmartGadget-Android

Revision History

SENSIRION SHT31 Smart Gadget - Revision History

Copyright© 2015 by Sensirion
CMOSens® is a trademark of Sensirion
All rights reserved

Headquarters and Subsidiaries

Sensirion AG
Laubisruetistr. 50
CH-8712 Staefa ZH
Switzerland

Phone: +41 44 306 40 00
Fax:
+41 44 306 40 30
[email protected]
www.sensirion.com

Sensirion AG (Germany)
Phone: +41 44 927 11 66
[email protected]
www.sensirion.com

Sensirion Inc., USA
Phone: +1 805 409 4900
[email protected]
www.sensirion.com

Sensirion Japan Co. Ltd.
Phone: +81 3 3444 4940
[email protected]
www.sensirion.co.jp

Sensirion Korea Co. Ltd.
Phone: +82 31 345 0031 3
[email protected]
www.sensirion.co.kr

Sensirion China Co. Ltd.
Phone: +86 755 8252 1501
[email protected]
www.sensirion.com.cn

To find your local representative, please visit www.sensirion.com/contact

© Copyright Sensirion AG, Switzerland

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

SENSIRION User Manuals

Related Manuals