SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic) Hookup
Guide
Introduction
Looking to keep a log of the climate in your greenhouse, create a humidor control system or want to track
temperature and humidity data for a weather station project? The SparkFun Humidity Sensor Breakout - SHTC3
(Qwiic) may be the perfect option for you! The SHTC3 is a low cost, easy-to-use, highly accurate digital humidity
and temperature sensor. The SHTC3 communicates via I2C so, as you can tell by the name, we have broken out
the pins on the sensor to Qwiic connectors so you can easily connect it to SparkFun's ever growing Qwiic
Ecosystem.
SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic)
SEN-16467
Product Showcase: SparkFun Qwiic Humidity Sensor Breakout
In this guide we will highlight some of the unique features of this breakout, how to connect and use it as well as an
Arduino library with four examples to get you started with your next environmental monitoring project.
Required Materials
To follow along with this guide you will need a microcontroller to communicate with the SHTC3. Below are a few
options that come Qwiic-enabled out of the box:
SparkFun Thing Plus - ESP32 WROOM
WRL-15663
SparkFun Qwiic Pro Micro - USB-C
(ATmega32U4)
DEV-15795
SparkFun RedBoard Qwiic
SparkFun RedBoard Artemis
DEV-15123
DEV-15444
If your chosen microcontroller is not already Qwiic-enabled, you can add that functionality with one or more of the
following items:
SparkFun Qwiic Cable Kit
SparkFun Qwiic Shield for Arduino
KIT-15081
DEV-14352
SparkFun Qwiic Adapter
SparkFun Qwiic Shield for Arduino Nano
DEV-14495
DEV-16130
You will also need at least one Qwiic cable to connect your sensor to your microcontroller.
Qwiic Cable - 100mm
Qwiic Cable - 200mm
PRT-14427
PRT-14428
Qwiic Cable - 500mm
Qwiic Cable - 50mm
PRT-14429
PRT-14426
Suggested Reading
If you aren't familiar with the Qwiic system, we recommend reading here for an overview.
We would also recommend taking a look at the following tutorials if you aren't familiar with them. If you are using
one of the Qwiic Shields listed above, you may want to read through their respective Hookup Guides as well
before you get started with the SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic).
I2C
Serial Terminal Basics
An introduction to I2C, one of the main embedded
communications protocols in use today.
This tutorial will show you how to communicate with
your serial devices using a variety of terminal emulator
applications.
Qwiic Shield for Arduino & Photon Hookup
Guide
SparkFun Qwiic Shield for Arduino Nano
Hookup Guide
Get started with our Qwiic ecosystem with the Qwiic
shield for Arduino or Photon.
Hookup Guide for the SparkFun Qwiic Shield for
Arduino Nano.
Hardware Overview
The SHTC3 Humidity and Temperature Sensor from Sensirion is an highly accurate digital humidity and
temperature sensor that communicates using the I2C protocol. It is designed to work exceptionally well in battery
powered applications such as wearables or remote environmental monitoring. In this section we will cover the
operating characteristics of the SHTC3 along with the hardware present on the breakout board.
Sensor Specifications
The table below outlines some of the SHTC3's humidity and temperature sensor specifications. For a complete list
and details about recommended operating conditions, review the SHTC3 Datasheet.
Parameter
Value
Specified Humidity Range
0 to 100 %RH
Specified Temperature Range
-40 to +125 °C
Relative Humidity Accuracy Tolerance
Temperature Accuracy Tolerance
± 2.0%RH (Typ.)
± 0.2°C (Typ.)
Power
Power for the SHTC3 is provided over the Qwiic interface or if you would prefer you can power it with 1.62-3.6V
through the pins labeled 3.3V and GND. We recommend powering the board with a regulated 3.3V source,
especially if you are using it with other Qwiic boards.
Qwiic and I2C Interface
The SHTC3 communicates via I2C and these pins are broken out to the two Qwiic connectors on the board as well
as the SDA and SCL pins. The SHTC3's I2C interface supports clock frequencies between 0 to 1MHz with clock
stretching to match the Fast Mode Plus specification. The I2C address is 0x70 (1110000 bin) and is hardwaredefined. A multiplexer/Mux is required to communicate to multiple SHTC3 sensors on a single I2C bus. If you need
to use more than one SHTC3 sensor on a single bus, consider using the Qwiic Mux Breakout - 8-Channel.
Jumpers
If you have never worked with solder jumpers and PCB traces before or would like a quick refresher, check
out our How to Work with Solder Jumpers and PCB Traces tutorial for detailed instructions and tips.
The SparkFun Humidity Sensor - SHTC3 (Qwiic) has two solder jumpers on the board labeled I2C and PWR (or
PWRLED if you are looking at the schematic). The I2C jumper pulls the SDA and SCL pins to VDD (normally 3.3V)
through two 2.2K Ohm resistors. If you have many slave devices on the same bus you may want to disable these
by opening the jumper (assuming they are also operating at 3.3V logic).
The PWRLED jumper connects the power LED to VDD (normally 3.3V) through a 1K Ohm resistor. To disable the
power LED simply open the jumper by severing the trace between the two solder pads. This is particularly useful
for lower power applications where current draw needs to be kept at a minimum.
I2C Jumper
Power LED Jumper
Board Dimensions
This breakout is designed to our Qwiic standard 1x1" sizing to easily stack with other Qwiic products. There are
four mounting holes on the board that fit a 4-40 screw.
Now that we have a solid understanding of the hardware present on the breakout, we'll get it hooked up in the next
section and move swiftly on to programming and talking to the sensor.
Hardware Hookup
Using the Qwiic system, assembling the hardware is simple. All you need to do is connect your SparkFun Humidity
Sensor Breakout - SHTC3 (Qwiic) to your chosen development board with a Qwiic cable or adapter cable.
Otherwise, you can use the I2C pins broken out if you prefer. If you are not using a Qwiic-enabled board, make
sure your input voltage and logic are either running at 3.3V or you are running both controller and SHTC3 at the
same logic level.
If you prefer to use the PTH pins broken out on the Humidity Sensor you will need to either solder to them or, if you
want a temporary connection for prototyping, these IC Hooks are a perfect option to make that connection. If you
are not familiar with through-hole soldering, take a look at this tutorial:
How to Solder: Through-Hole Soldering
SEPTEMBER 19, 2013
This tutorial covers everything you need to know about through-hole soldering.
With our SHTC3 connected to our microcontroller we can move on to writing some code to start monitoring
temperature and humidity.
SHTC3 Arduino Library
Note: This library assumes you are using the latest version of the Arduino IDE on your desktop. If this is your
first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously
installed an Arduino library, please check out our installation guide.
The SparkFun SHTC3 Arduino library can be downloaded with the Arduino library manager by searching
'SparkFun SHTC3' or you can grab the zip here from the GitHub repository:
SPARKFUN SHTC3 ARDUINO LIBRARY (ZIP)
Once the library is installed, we can move on to working with the included example sketches and take some
sensor readings.
Example 1: Basic Readings
Open the first example by heading to File > Examples > SparkFun SHTC3 Humidity and Temperature Sensor
Library > Example1_BasicReadings. Select your board (in our case, the Arduino/Genuino Uno) and the COM
port that it enumerated on. Then hit upload. Open the Arduino Serial Monitor at 115200 baud to start viewing the
humidity and temperature!
Try holding your hand over the sensor or breathe lightly on to the SHTC3 and watch the values change.
Example 2: Verify Checksums
This example is very similar to the Basic Readings but also enables and returns checksum data calculated by the
sensor to ensure the data is valid. Open it by following the instructions for Example 1 but instead select
Example2_VerifyChecksums. The checksum pass indicators are passIDcrc , passRHcrc and passTcrc for the
sensor ID, relative humidity and temperature, respectively.
Using checksums is not absolutely necessary but can be helpful for troubleshooting any I2C communication errors.
Once the code is uploaded, it will print out over serial all checksum data and whether or not it has passed or failed
so you can identify if something such as the device ID is not returned properly.
Example 3: Changing Options
The third example builds on the previous two and demonstrates how to configure the SHTC3 using the setMode
function as well as selecting your Wire port and clock speed. Again, open the example by navigating to the SHTC
library and selecting Example2_ChangingOptions.
Below are the available modes available on the SHTC3:
SHTC3_CMD_CSE_RHF_NPM = 0x5C24,
SHTC3_CMD_CSE_RHF_LPM = 0x44DE,
SHTC3_CMD_CSE_TF_NPM = 0x7CA2,
SHTC3_CMD_CSE_TF_LPM = 0x6458,
//
//
//
//
Clock
Clock
Clock
Clock
stretching,
stretching,
stretching,
stretching,
SHTC3_CMD_CSD_RHF_NPM = 0x58E0,
// Polling,
SHTC3_CMD_CSD_RHF_LPM = 0x401A,
// Polling,
SHTC3_CMD_CSD_TF_NPM = 0x7866,
// Polling,
SHTC3_CMD_CSD_TF_LPM = 0x609C
// Polling, T
RH first, Normal power mode
RH first, Low power mode
T first, Normal power mode
T first, Low power mode
RH first, Normal power mode
RH first, Low power mode
T first, Normal power mode
first, Low power mode
By default, the code sets the SHTC3 up to use clock stretching, report temperature data first and run on low power
mode. To change to another mode, refer to the settings above and change this line:
mySHTC3.setMode(SHTC3_CMD_CSE_TF_LPM) == SHTC3_Status_Nominal
Once you have selected which mode you want the SHTC3 to operate in, upload it and open a serial monitor to
115200 baud. You should see the checksum data print and then whether or not the setMode function was
successful. Note that the code defaults to print out "Choosing low-power measurements with T first: " so if
you use a different mode, you may want to alter that print statement to avoid confusion.
If all of that is successful, the code will start printing out humidity and temperature data.
Example 4: Using Callback
The fourth example in the library demonstrates how to use the callback feature on the SHTC3. You may be
wondering, what is a callback? It is a way that a library can provide a place for the user to do something. The
library was written with a function that is called (nearly) every time a function is exited. How is that useful? You can
overwrite the function with your own definition that allows you to do things like debug or watch the program
execute.
Make a function with this signature:
void SHTC3_exitOp_Callback(SHTC3_Status_TypeDef status, bool inProcess, char * file, uint16_t li
ne)
Then write in it some code that might help you. The example helps us watch the code execute by displaying the
line number, file, and status every time that a function finishes.
Including these functions is particularly helpful for debugging but can be taxing on your processor and slow down
your code.
Resources & Going Further
That's all for this guide. Hopefully by now you have the know-how and circuit to start your own humidity and
temperature monitoring. For further information about the SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic),
check out the links below. Thanks for reading!
Schematic (PDF)
Eagle Files (ZIP)
Board Dimensions (PNG)
Datasheet (PDF)
Arduino Library
Hardware GitHub Repository
Need help?
If your product is not working as you expected or you need technical assistance or information, head on over
to the SparkFun Technical Assistance page for some initial troubleshooting.
Need some inspiration for your next project? Check out some of these weather sensing related tutorials:
Environmental Monitoring with the Tessel 2
CCS811 Air Quality Breakout Hookup Guide
Build an air-conditioner monitoring device to collect
environment information and store it in the cloud.
This tutorial shows you how to get data from a CCS811
breakout board with the I2C interface.
w!
Ne
Spectral Triad (AS7265x) Hookup Guide
Learn how to wield the power of 18 channels of UV to
NIR spectroscopy with AS72651 (UV), AS72652 (VIS),
and AS72653 (NIR) sensors!
SparkFun Environmental Sensor Breakout BME680 (Qwiic) Hookup Guide
A hookup guide to get started with the BME680
Environmental Sensor from Bosch. Monitor the air
quality, temperature, humidity, and barometric pressure
with this Qwiic sensor!