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
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:
- Displays prayer times.
- Automatic Wi-Fi setup using WiFiManager.
- Dynamic API link and time zone, changeable via WIFI manager.
- Real-time synchronization with NTP for accurate timings.
- Plays the athan (call to prayer) for the corresponding prayer time.
- 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
Components:
- ESP01.
- Arduino uno to program the esp01.
- 20x4 LCD with I2C interface.
- Generic mp3 module and micro sd card (1Gb is enough).
- 2w speaker.
- 3.3v voltage regulator to power the esp.
- Pushbutton.
- 2N2222 transistor to power the mp3 module.
- 1k and 10k resistors.
- an enclosure of your choice.
Circuit Diagram, Code and Library
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.
Downloads
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 :
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:
Operation
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 :)