Welcome to UmarDevWorks

Hey there 👋 Welcome to my world of innovation, crafting code to empower ideas!

Projects

H&T Clock

A humidity and temperature Display with NTP time and Date.

Project Overview:

This project involves an ESP8266 or ESP32 microcontroller, a DHT11 temperature and humidity sensor, and an SSD1306 OLED display. The microcontroller fetches data from the DHT11 sensor and displays temperature, humidity, time, and date on the OLED display.

Full code

Wiring Connections:

ESP8266/ESP32 to OLED SSD1306:

  • SDA (Serial Data) and SCL (Serial Clock) Pins:
  • Connect the microcontroller's SDA pin to the OLED display's SDA pin.
  • Connect the microcontroller's SCL pin to the OLED display's SCL pin.
  • Example code:
  • #define SDA_PIN 21 // SDA pin for OLED
    #define SCL_PIN 22 // SCL pin for OLED
    Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
  • Ensure the connections follow the I2C communication protocol.

DHT11 Sensor:

  • Data Pin:
  • Connect the DHT11 sensor's data pin to a GPIO pin on the microcontroller.
  • Example code:
  • #define DHT_PIN 4 // Pin connected to DHT11
    #define DHT_TYPE DHT11
    DHT dht(DHT_PIN, DHT_TYPE);
  • Specify the pin to which the data pin of the DHT11 sensor is connected.

Code Summary:

  1. Initialization:
    • Initializes the OLED display, DHT11 sensor, and WiFi connection.
    • Sets up connections and configurations for the OLED and DHT11.
  2. Loop Function:
    • Fetches data from the DHT11 sensor at regular intervals.
    • Displays the collected data (temperature and humidity) on the OLED display.
    • Updates the display to show the time (fetched from an NTP server) and date.
    • Switches between different information displays at specific time intervals.
  3. Functionality:
    • Reads temperature and humidity data from the DHT11 sensor.
    • Connects to a WiFi network for internet access to fetch time data.
    • Updates the display with temperature, humidity, time, and date information.

Summary:

The ESP8266/ESP32 connects to both the OLED display and DHT11 sensor. The OLED display shows temperature, humidity, time, and date data fetched from the DHT11 sensor and an NTP server via WiFi. Proper wiring ensures data communication between the microcontroller, sensor, and display, while the code manages data collection and display functionality.

Remember to validate the pin configurations and wiring connections for accurate operation of the project. Correctly set up, this project provides real-time environmental data displayed on the OLED screen.

About Me

I am currently a student in the second year of O-Levels with computer science as my elective subject along with Physics & Chemistry in the Science group.

I have experience in developing html and javascript websites and now I am learning NodeJS. I also have a significant amount of experience in automation including Arduino and ESP family of microcontrollers. Tinkering with electronics to learn along the way is my hobby and have experience in designing home automation systems as further explained in the project section.

Contact Me

Socials Connections

Socials