DIY Prayer Times Clock With ESP01 and 20x4 I2c LCD Display

by MohammadM109 in Circuits > Microcontrollers

161 Views, 1 Favorites, 0 Comments

DIY Prayer Times Clock With ESP01 and 20x4 I2c LCD Display

WhatsApp Image 2024-12-12 at 12.35.38_426fa31a.jpg
WhatsApp Image 2024-12-12 at 12.35.38_636229dc.jpg
WhatsApp Image 2024-12-12 at 12.35.38_a3634f00.jpg
DIY Prayer Times Clock With ESP01 and 20x4 I2c LCD Display

In this instructable, I showcase my custom-built prayer times clock. Powered by the ESP01 and a 20x4 I2C LCD, this project fetches prayer timings from an online API link and displays them along with the current Gregorian and Hijri dates.

Features:

  1. Displays prayer times.
  2. Automatic Wi-Fi setup using WiFiManager.
  3. Dynamic API link and time zone, changeable via WIFI manager.
  4. Real-time synchronization with NTP for accurate timings.
  5. Plays the athan (call to prayer) for the corresponding prayer time.
  6. Hijri calendar integration for an Islamic date display.

This clock is perfect for anyone looking to build a functional and modern Islamic clock for their home or mosque.

Supplies

20x4-lcd-display-blue-display-with-i2c-solder-34882-95-O.jpg
voltaat-3-3v-voltage-regulator-module-3856335831142.jpg
images.jpg
df.jpg
713RqpanpbL._AC_UF350,350_QL80_.jpg
71U1zR0d7jL._AC_UF894,1000_QL80_.jpg
asd.jpg
imageasds.jpg

Components:

  1. ESP01.
  2. Arduino uno to program the esp01.
  3. 20x4 LCD with I2C interface.
  4. Generic mp3 module and micro sd card (1Gb is enough).
  5. 2w speaker.
  6. 3.3v voltage regulator to power the esp.
  7. Pushbutton.
  8. 2N2222 transistor to power the mp3 module.
  9. 1k and 10k resistors.
  10. an enclosure of your choice.

Circuit Diagram, Code and Library

PRAYER TIMES CLOCK.jpg
Screenshot 2024-12-11 202856.jpg
Untitledfggf.jpg
connect-esp8266-to-arduino.jpg

connections are easy and simple.

i used Arduino Uno to program the esp01, follow the tutorial in the link below :

https://iotcircuithub.com/esp8266-programming-arduino/


library used:

https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

important:

make sure to temporarily remove any other LCD libraries before uploading to avoid errors.

API Usage

i am using API to get the prayer times, see the link below for more info:

https://aladhan.com/prayer-times-api


this an example :

https://api.aladhan.com/v1/timingsByAddress/currentdate?address=Amman,jordan&method=23&tune=0,0,0,0,0,0,0,0,0&adjustment=1


timingsByAddress: get the timing by address

currentdate: get the timings for current date

address: specify address here (city,country)

method: prayer times calculation method 23 methods available see the link to choose method based on location and government preferences of your country : https://api.aladhan.com/v1/methods

tune=0,0,0,0,0,0,0,0,0: here you can tune timings of each prayer if needed. the order is Imsak,Fajr,Sunrise,Dhuhr,Asr,Maghrib,Sunset,Isha,Midnight

adjustment: to adjust hijri date based on location and moon sighting, number presents number of days to adjust hijri date, you can use negative value as well.


refer to the link below for full explanation:

https://aladhan.com/prayer-times-api

Operation

WhatsApp Image 2024-12-12 at 12.59.26_a0467c1a.jpg
WhatsApp Image 2024-12-12 at 12.59.26_82311b5c.jpg

on startup you will be directed to connect to "Prayer time Clock", sign in and click configure wifi, next page enter your SSD credentials, edit the API link to your preferences, and set the time zone.

you can reset settings via reset button anytime to reconfigure.


you can select Athan audio files from here:

https://aladhan.com/download-adhans


thats it :)