DIY - Temperature and Humidity
Requirements
Destinations of the Station
In this station we are dealing with the temperature and humidity sensor of the senseBox, the HDC1080.
Materials
- combined temperature and humidity sensor
HDC1080
Basics
The HDC1080 Sensor
HDC1080
, from the Texas Instruments HDX10XX series, is a combined temperature and humidity sensor. The sensor can measure the humidity from 0% to 100%, as well as the temperature from -40 ° C to 125 ° C with an accuracy of ± 2% or ± 0.2 ° C.
The communication of the sensor with the microcontroller runs over the I²C Bus.
Unlike simple digital or analog inputs, multiple I²C devices (such as sensors or displays) can be connected in parallel to the data bus.
Each device has a unique identifier so that the data bus can assign each one of them and address them separately.I²C Bus
Construction
Plug in the circuit as you see it in the graphic below.
Programming
First, an instance of the sensor must be created.
#include "SenseBoxMCU.h"
HDC1080 hdc;
In the setup()-function
setup()
-function the sensor should now be started:void setup(){
hdc.begin();
}
After initializing the sensor as described above, you can use two commands in the loop()-function
loop ()
-function to output a temperature or humidityvoid loop(){
hdc.getHumidity();
hdc.getTemperature();
}
Tasks
Build the circuit which is described above and try to read the HDC1008 out. Print the measured data in the serial monitor.Task 1