Temperature And Humidity Data From SHT40 To Thingspeak With Maker Feather AIOT S3

Temperature And Humidity Data From SHT40 To Thingspeak With Maker Feather AIOT S3

Introduction

 In this tutorial today, we would like to see how to display the temperature and humidity data from SHT40 to Thingspeak using the Maker Feather AIOT S3. 

 

 

What is SHT40? 

SHT40 is a digital sensor platform for measuring relative humidity and temperature at different frequency classes. The SHT40 has an excellent ±1.8% typical relative humidity accuracy from 25 to 75% and ±0.2 °C typical accuracy from 0 to 75 °C. The I2C interface makes it easier for interfacing with only two wires (plus power and ground!). Thanks to the voltage regulator and level shifting circuitry we've included on the breakout It is also is 3V or 5V compliant, so you can power and communicate with it using any microcontroller or microcomputer.

 

Hardware

1x Maker Feather AIOT S3

1x SHT40 Sensor

Software

For this tutorial we have used the Arduino IDE to program the board and the Thingspeak to display the data. First we need to install these 2 libraries (refer figure below).

 

 

Steps

Once the libraries are installed we are ready, but we need to do one more thing, which is to set up Thingspeak account in order to send the data.

The first step is go Thingspeak

Next click the login icon and enter the email if you have an account. If you dont have and account, then you need to create one. Once we logged in, we will directed to this window. In this window click the "New Channel"  button. This will bring you to another window.

In this window, key in the details of the channel.

 

And obtain the channel id, and the API keys as well. This will later be used in the Arduino code.

 

That's all the steps needed to setup the Thingspeak. Next we can start to code.

Code

For the coding we will test each of the sample code seperately before we merge them together to achieve the goal of this tutorial which is to send the data to the Thingspeak. First we will test the SHT40 sensor. For this i am using the sample code. The code is as shown below.

 

Once the code is successfully compiled and uploaded we can see the output in the serial output as shown below.

 

The next step is to test the Thingspeak sample code. The code is as shown below.

 

 

Make sure to update the details as shown

The data in box need to updated accordingly. And once it is updated we can compile and upload the code. When open the terminal we can see as per the image below.

 

And in the Thingspeak we can see that the data is being updated accordingly

Now we have confirmed that both the device works properly and the data can be sent to Thingspeak, we can start to merge the code. The final code is as shown below

 

And in the Thingspeak we can see that the data is populated in the graph for the temperature and humidity.

This data can further be analysed using the Matlab tool.

 

Demo

Below is the video of this tutorial. 

 

Hardware Components