Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Smart Alarm Clock with OLED Display, DHT11 Sensor, and Wi-Fi Connectivity

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Alarm Clock with OLED Display, DHT11 Sensor, and Wi-Fi Connectivity

Circuit Documentation

Summary

This circuit is designed to interface an ESP32 microcontroller with a DHT11 humidity and temperature sensor, a DS1307 real-time clock (RTC), multiple pushbuttons, and a 128x64 OLED display. The ESP32 reads temperature and humidity data from the DHT11 sensor, displays the time and sensor data on the OLED display, and allows setting alarms using the pushbuttons. The circuit is also capable of connecting to a WiFi network and can synchronize the RTC with an NTP server.

Component List

ESP32 - 38 pins

DHT11 Humidity and Temperature Sensor

RTC DS1307

Pushbutton (3 instances)

128x64 OLED Display (I2C IIC SPI Serial)

Wiring Details

ESP32 - 38 pins

DHT11 Humidity and Temperature Sensor

RTC DS1307

Pushbuttons

128x64 OLED Display (I2C IIC SPI Serial)

Documented Code

The code provided is for the ESP32 microcontroller and includes the following functionalities:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>
#include <WiFi.h>
#include <WebServer.h>
#include <RTClib.h> 
#include <WiFiUdp.h>
#include <NTPClient.h>

// ... (Code omitted for brevity)

void setup() {
  // Setup code including initialization of peripherals and WiFi connection
  // ...
}

void loop() {
  // Main loop handling web server, NTP updates, and display updates
  // ...
}

// Additional functions for handling web server requests, displaying information, and setting alarms
// ...

Note: The actual code is extensive and includes detailed functions for handling various tasks such as web server requests, displaying data on the OLED, reading sensor values, and managing alarms. The provided snippet is a high-level overview of the setup and loop functions, which are the core of the embedded application. For a complete understanding, one should refer to the full code provided in the input.