A real time clock with the ability to show Gregorian date, Hijri date, Daily prayer times, Temperature (celsius and fahrenheit) and greeting messages on special days. No RTC module is used; instead it gets current accurate time from NTP service (pool.ntp.org). Similarly it doesn't use any temperature sensor module but fetches current outside temperature information from the openweathermap.org website.
Why NodeMCU ESP8266 ESP-12E?
One main goal while developing this project was to have minimal hardware components and achieve the result with software. For this reason I chose NodeMCU ESP8266 ESP-12E which has following advantages
- No additional components needed for wifi / internet access
- Works well with Arduino IDE
- More Flash (4MB) and RAM (128KB) to load all required libraries and the static values
- Most NodeMCU development boards work on standard 5V
Hardware required
- 1 x NodeMCU ESP8266 ESP-12E
- 1 x WS2812B RGB Individually Addressable Digital 16x16 256 LED display
- 1 x 220 Ohms resistor (100 Ohms also works)
Prerequisites for making this project
In addition to the hardware components mentioned above you need to have the following available
- Wifi access point details ( )
- Your timezone information ( refer https://www.timeanddate.com/time/map/)
- Longitude & Altitude details of your location for calculating accurate prayer times (refer https://www.latlong.net/ )
- Prayer time calculation method used in your locality ( refer http://praytimes.org/wiki/Calculation_Methods )
- Asr prayer calculation method (http://praytimes.org/calculation )
- An account with openweathermap.org for fetching temperature data
- Openweathermap ID of your location/city which can be found at https://openweathermap.org/city
Following values need to be updated in the program prior to running it.
const char *ssid = "Your wifi SSID";
const char *password = "Your wifi password";
String OPEN_WEATHER_MAP_APP_ID = "xxxxxxxxxxxx";
String OPEN_WEATHER_MAP_LOCATION_ID = "123456";
double my_latitude = 37.368832;
double my_longitude = -122.036346;
double my_timezone = -8;
bool my_dst_on = false;
String my_calc_method = "ISNA";
String my_asr_method = "Shafii";
String my_high_lats_method = "None";
Program flow
Description
This program is made with the assumption of a decent internet connectivity via a wifi hotspot. Date & time get picked up from NTP servers (pool.ntp.org) and the outside temperature in your locality is fetched from the APIs of openweathermap.org. It calculates Hijri date and prayer time from the Gregorian date, timezone and other location specific configurables. Some standard and nonstandard libraries are needed for the code to function. Standard libraries can be installed via Arduino IDE’s “Mange Libraries” interface. Non-standard libraries can be installed easily by referring to any online instruction or you can follow the “Library setup” section in https://github.com/shajeebtm/PrayerTimes-Library-For-Arduino .
A note about power supply : The 256 LED display may draw (depends on the brightness & color) upto 1A from the power supply. So please ensure that your 5v source is capable of that much power, feed the display directly from the source (not via NodeMCU board).
Visitheretowatchademovideoofthisproject







Comments