Smart Fridge
In this project, you will build a Smart Fridge Environment Monitor that displays:
- Current Time
- Current Date
- Temperature
- Humidity
All data is shown on a 3.5" SPI TFT display, creating a clean and modern fridge dashboard.
This is a simplified version of a larger smart fridge system, focusing only on real-time environmental monitoring.
This works by taking data from the DHT11 Humidity and Temperature Module and the DS1307 RTC or Real Time Clock and displaying that information onto the SPI Display.
Supplies
Core Components
- Arduino (UNO / Mega / similar)
- 3.5" SPI TFT Display (480×320, capacitive touch optional)
- DHT11
- DS1307 RTC Module
- Breadboard
- Jumper wires
Wiring the Components
SPI Display
- VCC → 5V
- GND → GND
- CS → Pin 10 (optional: not included in this project)
- CD → Pin 9
- RST → Pin 8
- MOSI → Pin 11
- MISO → Pin 12
- SCK → Pin 13
- LED → Pin 5 (optional: not included in this project)
- SCK → Pin 13
The optional pins don't actually need to be connected to the SPI and Arduino. However, when we move onto the software section, you have to define these pins (LED, CS) for the initialization of the SPI Display.
DHT Sensor
- VCC → 5V
- GND → GND
- DATA → Pin 2
RTC Module (I2C)
- VCC → 5V
- GND → GND
- SDA → A4
- SCL → A5
Downloading the Libraries
Download the Following Libraries:
- DHT11 sensor library
- RTClib
In order to download the Display libraries, you have to do some more. Since I am using the 3.5'' TFT SPI, I will show you how to do it with this display.
- First: Head to this website: https://www.lcdwiki.com/3.5inch_IPS_SPI_Module_ST7796
- Second: Scroll down to Program Download where it says 3.5inch IPS SPI Module MSP3525_MSP3526 Package
- Third: Unzip the download. Press 1-Demo → Demo_UNO_Mega2500 → Install libraries. Select LCDWIKI_GUI and LCDWIKI_SPI and add them to the Arduino Library. (If you want to work with the touch screen capabilities by yourself, you can also add LCDWIKI_TOUCH to your library)
- To add them to your Arduino Library, go to your menu bar and press Sketch → Include Library → Add .ZIP Library. Then you can select LCDWIKI_GUI and LCDWIKI_SPI to import them.
Coding
Now that you have wired all components and downloaded all the libraries, you can copy the code from https://github.com/AC583/Sensors
If you have any problems, I created small testing files for debugging purposes so you can isolate what component isn't working correctly.
Then, make sure your computer is connected to the Arduino via cable and press upload.
Common Issues
Q: My RTC Module is giving the correct time and date.
A: Ensure all connections are secure; Try resetting your Arduino or unplugging and plugging your cable back in or re-upload your code. Honestly, I don't know why it sometimes breaks, but I didn't have to change my code to fix this.
Q: My Display isn't working
A: There could be a number of issues to why your SPI display isn't working. I found that 3.5inch IPS SPI Module UNO_Mega2560 Demo Instructions was really helpful.