Arduino – Part III
ARDUINO PART III – DHT22, LCD & SD CARD READER
In this set of arduino lessons you will learn how to:
- Use the DHT22 sensor to record temperature and humidity.
- Write this data to an SD card.
- Display and live-update these on an LCD screen.
DHT 22 – Temperature & Humidity
Follow this tutorial to start using the DHT 22. It will show you how to install the DHT library, connect the sensor and display the data in the serial monitor.
Please note: At the end of the video, Dejan advertises his tutorial for the LCD. Do not rely on that one because he uses an older version than we have so the code won’t work.
Written version if you prefer that:
SD Card
The SD card tutorial will help you understand how it works, but only test if the Arduino recognizes it. You will not be writing data onto it yet.
Please format the SD card on your computer before using it.
LCD
There is no video on this one, but it’s definitely the simplest. This tutorial will let you print up to 16 characters on each line. It is pretty straightforward once you read the code.
https://arduinogetstarted.com/tutorials/arduino-lcd-i2c
Combining the Three
In the next steps, you will combine all three components into one code script. The code is on the Teams page in the TA Questions channel under files.
Here is the initial wiring diagram, which is just how I did it, but there are multiple ways. If you have the libraries downloaded from the previous set of tutorials, you should be able to upload the script to the Arduino. I will post a video recording of what each portion of the script does this afternoon. It’s not very aesthetic, but it should be straightforward.
Video: