SHTC3 temperature and humidity sensor
The SHTC3 combined temperature and relative humidity sensor provides a simple and low-cost solution. It has the additional benefit that it uses the I2C serial communications protocol. This is a system that is ableto connect several devices using just two wires, one for data (SDA) and the other for a synchronising clock signal (SCL).
The instructions below show how to connect the SHTC3 up to your Particle device, and takes you through the process of finding and including the right library in your application code using the Web IDE.
First, set up the hardware connections as shown in Figure 2. (Please note that the device shown in Fig.2 is actually a DHT22 sensor. That is because at the time of writing there is no Fritzing graphic for the SHTC3.)
Next, go to the Particle Web IDE and click on the Libraries icon
in the navigation panel. Search for shtc3 and select the
SparkFun_SHTC3_Arduino_Library
as shown in Figure 3
After clicking on the library, you have the opportunity to use a
ready-made example as shown in Fig.4. Select the one called
BasicReadings.ino
and then click the Use this example button
to create your own copy.
Once you have flashed the code to your device, the sensor will start
taking readings straight away and the example code displays the readings
on the serial monitor. To start the serial monitor, open a command
window on your laptop and type the command particle serial monitor
.
By default, temperature values are displayed in Fahrenheit. There are some comments in the code that tell you how to change this to Celsius.