IOT

DIY ESP32-Based Smart Clock with Weather Forecasting

In this project, we will build an ESP32-based smart clock for weather forecasting.  Makerfabs sent me an electronics kit with numerous active and passive electronic components. A PCB Board with SMD components was also constructed on the board. In addition, it included a 1.44-inch LCD display and a 3D casing. This comprehensive package may be utilized to create a Smart Clock with Weather Forecasting and Alarm System.

You can also create a real-time clock that retrieves the current global time through the Network timing protocol. You can also quickly set your local time zone. It also includes an alarm clock that emits a loud sound. The third best feature is an online global weather forecaster that provides information on the local temperature and humidity. Without reprogramming, you can quickly modify or alter your address or cities.

Before starting you can follow our ESP32 NTP Clock post to learn more about Network Time Protocol. And in order to purchase this kit, you can visit the Makerfabs Link to directly purchase the kit.

Features: ESP32 Based Smart Clock with Weather Forecasting

  1. ESP32 WROOM module: WiFi, Bluetooth, 4MB Flash
  2. 1.44inch 128128 color display, ST7735 driver
  3. Micro USB interface for programming
  4. Support Arduino IDE
  5. 450mAh Lithium-Ion battery
  6. Support Battery Charging
  7. Plug-in components, easy soldering

Design & Schematic

Following is the schematic for the DIY ESP32-based smart clock and weather forecasting system project.

The WiFi and Bluetooth-capable ESP32-WROOM-32 chip is the heart of the project. The LED indicator and three distinct pushbutton switches are wired directly to the ESP32 digital Pin. The 1.44-inch SPI Color LCD is connected to the ESP32 by SPI Pins. For automatic programming, the two SMD Push buttons for Reset and Program are coupled by transistor. This means that no button must be pressed during code uploading.

The board has a CP2104 USB-to-Serial Converter IC. The CP2104 is a highly integrated USB-to-UART Bridge Controller that features a USB 2.0 full-speed function controller and USB transceiver for firmware uploading. In addition to low power voltage regulators and MCP73831 Battery Charging IC for Battery Management & Charging, the board also includes low power voltage regulators.

The device is portable due to the 3.7V Lithium-Ion battery that powers it. The device can also be powered using the USB cable.

PCB, Part List & Components

Inside the box of the ESP32-Based Smart Clock with Weather Forecasting System Kit are the following components:

1. ESP32 SmartClock Kit Mainboard

2. Batch of Capacitors& Resistors/Connectors

3. Colorful LCD Module

4. Lipo Battery

5. Acrylic Boards

6. Nuts & screws

The front part of the PCB looks something like this.

On the PCB Board are SMD Components that have already been soldered. The through-hole components must be soldered on both the front and back of the board. On the rear, we must solder the three buttons and LCD display.

This component list will assist you in soldering the components onto the board.

After soldering is done, the front and backside look as follows.

ESP32 Smart Clock
ESP32 Based Weather Forecasting

Source Code: ESP32 Smart Clock with Weather Forecasting

The kit includes preprogrammed software. If you wish to review the code and make any modifications, you can visit the following Github repository.

Download: ESP32 Smart Clock Code

The code has the following header file.

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <SPI.h>
#include “wifi_save.h”
#include <WiFi.h>
#include “time.h”
#include <ArduinoJson.h>
#include <HTTPClient.h>

This is the reason why you need to add the following libraries to the Arduino Library Folder.

1. Adafruit_GFX library: https://github.com/adafruit/Adafruit-GFX-Library

2. Adafruit_ST7735 library: https://github.com/adafruit/Adafruit-ST7735-Library

3. ArduinoJson library: https://github.com/bblanchon/ArduinoJson

To upload the code, select “ESP32 Dev Module” and “Huge APP” from the drop-down menus and click the upload button.

Testing & Demo

After half an hour of soldering and installation, you may set the WiFi SSID and password over the phone by following a few simple steps.

After powering on the device, it will attempt to connect to the network that was previously saved. Observe the directions provided on the LCD screen if you wish to connect to the new network. Hold a button down for 3 seconds. Then, connect your mobile device to the ESP32 WiFi Network.

Enter the WiFi Credentials and continue as depicted below.

So, after WiFi connectivity is established, the gadget will indicate connection success.

The time and date will then be displayed based on your time zone. It will obtain global real-time from the Network timing protocol, and you can easily set your local time zone.

ESP32 Based Smart Clock with Weather Forecasting

You can change the time zone by using the 3 push buttons.

The device is also capable of retrieving weather information, including temperature, humidity, and atmospheric conditions. The device functions as an online global weather forecaster, and you can change your address or city without reprogramming.

ESP32 Based Smart Clock with Weather Forecasting

Additionally, the device can function as an alarm clock. To alter the alarm time, use the three buttons to set the time. During the saved time, the buzzer begins automatically.

ESP32 Alarm Clock

So here is how you can create your own ESP32 Based Smart Clock with Weather Forecasting System.

Conclusion

Hope this blog helps you to understand how to design a DIY ESP32-Based Smart Clock with Weather Forecasting. We, MATHA ELECTRONICS  will come back with more informative blogs.

Leave a Reply

Your email address will not be published.