Clocks That Can Measure Air Temperature and Humidity

by Nick Programmer in Circuits > Microcontrollers

2834 Views, 45 Favorites, 0 Comments

Clocks That Can Measure Air Temperature and Humidity

IMG_20231205_130659.jpg
IMG_20231205_125056.jpg

Smart Clocks is an ESP8266 d1 mini based clocks that can measure air temperature and humidity. I used to think that people don't need just the clocks and I was right. You can just take your smartphone or laptop and look at the time. But the thing you're not able to look on your smartphone is air humidity and temperature. People don't need just clocks, they need a clocks with an additional feature. This is why I made these smart clocks.

The DHT22 measures air temperature and humidity, this is why I named it "Smart".

TFT LCD 1.8 inch screen displays all the information about time, air humidity and temperature.

The ESP8266 has entry to the network, esp8266 parses information about date and time. Also esp8266 gets information about air temperature and humidity.

Supplies

IMG_20231205_130852.jpg
  • ESP8266 d1 mini x1;
  • DHT22 x1;
  • ST7735 TFT LCD 1.8 inch screen x1;
  • Resistor 560 ohm x1;

If you haven't BOOT button on your esp8266 board, you will need to solder or connect GPIO0 to GND using 560 ohm resistor, exception if your code uploads automatically.

How It Works?

Untibbbtled.png

I attempt to easy explain how it works.

ESP8266 d1 mini connects to the network, then it sends request to NTP server. NTP server knows time and date and sends data to the esp8266 back. ESP8266 d1 mini receives the data.

Install and Configure Arduino IDE *Optional

Software _ Arduino - Google Chrome 10_6_2023 12_38_42 PM.png
Captursjhssje.PNG
Capturejklklkl.PNG

If you have never used Arduino IDE, you will need to download and install it. We'll need to download and install Arduino IDE to upload the code into a microcontroller.

ATTENSION!!! Do not download 2.x versions, at the moment of 12/4/2023 there are still a lot of bugs. It better to download a 1.8.19 version.

Download it here - https://www.arduino.cc/en/software

  • After Installing, navigate to File > Preferences
  • Find Additional Boards Manager URLs, and paste this link into a text field - http://arduino.esp8266.com/stable/package_esp8266com_index.json
  • Then, navigate to Tools > Board: > Boards Manager
  • Type the "esp8266" in a search field, find and Install.

Download CH340 Driver

Captpddooxure.PNG

Download CH340 for Windows - http://wiki.amperka.ru/_media/articles:driver-ch340:ch340ser-wimdows.zip

Download CH340 for Mac - http://wiki.amperka.ru/_media/articles:driver-ch340:ch340ser-mac.zip

Attention!!! You can't open this link by click on it. Drop required link into a new tab.

  • Extract .zip file;
  • Open extracted file;
  • Open .exe file and install;


Install Libraries

Cahhhpture.PNG
  • Navigate to Sketch > Include library > Manage Libraries;
  • Type every single library one by one and download:
  1. DHT
  2. SPI
  3. ESP8266WiFi
  4. NTPClient
  5. Adafruit_ST7735
  6. Adafruit_GFX
  7. WiFiUdp

Download Firmware Folder

Capture1.PNG

Download the firmware that we will upload into a microcontroller.

GitHub Smart Clocks Repositoryhttps://github.com/NickProgrammerOffical/Smart-Clocks

  • Download .zip on my GitHub.
  • Extract the "Smart-Clocks.zip" folder, then open Firmware.ino file with Arduino IDE.

Set the Time Zone and Time Signing

Capture.PNG
gmt.PNG

You can set your own time zone by GMT.

  • Find time zone of your city by GMT.
  • Change int GMT value to your own;

Also you can change time metric system.

There's only two metric system: AM/PM; 24Hours;

  • If you want to set 24Hours, change display_time value to "24/H";
  • But if you want to set AM/PM, change display_time value to "AM/PM";

Assemble Smart Clocks

Untitled.png

Make sure that you rightly connected DHT22 Sensor and resistors.

Upload the Firmware

Caphjhjhture.PNG
Captjldkleekure.PNG

Change WIFI_SSID and WIFI_PASS values to your own WIFI SSID and Password.

Select Board and Port to be able to upload the firmware.

  • Navigate to Tools > Board: > ESP8266 Boards > LOLIN(WEMOS) D1 mini
  • Connect GPIO0 to GND pin using 560ohm resistor.
  • Navigate to Tools > Port > Select your port;
  • Click upload button in the left top corner;

Use It!

kisspng-hotspot-wi-fi-mobile-phones-internet-access-clip-a-5af1747fb7b098.1895188115257734397524.jpg

To be able to use it, you'll need to have Hotspot or WIFI router.

ESP8266 automatically connects to the network and parses date and time from there.