Introduction
Temperature and humidity are two very important parameters when it comes to having a greenhouse since they guarantee the quality as well as the integrity of the plants or products that are grown.
In today's post, we are going to see how to connect a SHT20 temperature and humidity sensor to our openmote b board, using i2c communication.
Latest Posts
Requirements
SHT20 Temperture and humidity sensorÂ
4 Wires
Connections
First of all, we are going to connect the wires between the SHT20 temperature and humidity sensor, and the openmote b board, as shown in the picture below.
How to download openmote B files
In order to program the openmote, you will have to download the openmote files that you can take from step number 2 How to download openmote files >>>
Running the SHT20 code
Once the files are already downloaded, from the openmote-fw/ you can run the code by using docker-compose with the following command:Â
docker-compose run --rm openmote test-sht20
Getting the data
Finally, install the screen if you do not have it yet:
sudo apt install
sudo apt install screen
And open the serial port in order to get the sensor data, by running:
screen /dev/ttyUSB1 115200
Finally, you should see an output like the picture below, with the humidity and temperature coming from the SHT20 I2C sensor.
Exit screen by pressing 'Ctrl + a', then '\', and finally 'y'.
I2C Sensor & Openmote B board