Adhan Clock for ESP32
An ESP32 display project involving TFT display.
Parts and sourceBefore you start
Check the exact TFT display configuration against the upstream wiring or parts list.
Upstream README
🕌 Adhan Clock — ساعة الأذان (ESP32)
An open-source Islamic desk clock built with an ESP32, a 1.8" ST7735S TFT, a TTP223 touch sensor and a buzzer. Created by El-Amine (@MedMA07) — Oran, Algeria 🇩🇿.
If you use, modify or share this project, please keep the credit to the original author (see LICENSE). Contributions and improvements are welcome ❤️
(PC simulation of the screens — the real display is 160×128)
✨ Features
- Clock + Gregorian date + Hijri date, big countdown to the next prayer
- Prayer times for your city (Aladhan API, cached; offline fallback calculation)
- Adhkar & du'as slideshow (60+ pages: morning, evening, after prayer, sleep, Qur'anic du'as, Ayat al-Kursi, Mu'awwidhat…)
- Reminders: adhan alert, pre-adhan alert, morning/evening/sleep adhkar, Surat al-Kahf on Friday, hourly istighfar
- One touch sensor switches screens (tap / hold)
- Phone link by QR code: scan → join the clock's Wi-Fi → open the settings page (Wi-Fi, city, method, alerts, times…)
- Splash screen: بسم الله الرحمن الرحيم + إن الصلاة كانت على المؤمنين كتابا موقوتا
- Arabic text rendered as pre-generated, compressed anti-aliased bitmaps (Amiri font) — no Arabic font engine needed on the ESP32
🧰 Hardware
ESP32 38-pin devkit · TFT 1.8" 128×160 ST7735S · TTP223 touch module · buzzer · S8050 NPN + 1 kΩ (optional driver) · jumper wires.
Wiring

| Module | ESP32 |
|---|---|
| TFT VCC / LED | 3V3 |
| TFT GND | GND |
| TFT CS | GPIO 5 |
| TFT RESET | GPIO 22 |
| TFT A0 (DC) | GPIO 21 |
| TFT SDA (MOSI) | GPIO 23 |
| TFT SCK | GPIO 18 |
| TTP223 VCC / GND / I/O | 3V3 / GND / GPIO 27 |
| Buzzer (+) | VIN (5V) |
| Buzzer (−) | S8050 collector |
| S8050 base | 1 kΩ → GPIO 25 |
| S8050 emitter | GND |
S8050 (TO-92, flat face towards you): E – B – C from left to right. Simple alternative for a small buzzer: (+) → GPIO 25, (−) → GND.
🚀 Install
- Arduino IDE → Boards Manager → esp32 by Espressif, version 2.0.17 (stable).
- Library Manager → install:
Adafruit GFX Library,Adafruit BusIO,Adafruit ST7735 and ST7789 Library,ArduinoJson(7.x). (The QR generator is bundled.) - Open
AdhanClock/AdhanClock.ino(keep all files of the folder together). - Board ESP32 Dev Module, Partition Scheme Huge APP (3MB No OTA/1MB SPIFFS) (recommended), then Upload.
👆 Controls
| Touch | Action |
|---|---|
| Tap | next screen (Home → Prayer times → Adhkar → QR) |
| Hold ≈1 s | next page (adhkar) · switch QR · confirm "Kahf read" (Home, Friday) |
| Hold ≈2 s | next adhkar category |
| Hold 6 s on QR screen | factory reset |
| Any touch during the adhan | silence + show the after-adhan du'a |
📱 First use
- After the splash, tap until screen 4 (QR).
- QR #1 → join Wi-Fi
AdhanClock(passwordadhan1234). QR #2 → openshttp://192.168.4.1. - In the page: scan Wi-Fi → password → city & country in English (e.g.
Algiers/Algeria) → Save.

The settings page as seen on a phone (Arabic, RTL)
- Defaults: Algeria, method 19, UTC+1. Morocco: method 21. No internet? Times are calculated locally and you can set the clock from your phone.
🔧 Display options (AdhanClock/config.h)
Picture shifted/colored edge → TAB_TYPE (INITR_GREENTAB/INITR_REDTAB) · inverted colors → TFT_INVERT 1 · red/blue swapped → SWAP_RB 1 · upside down → ROTATION 3 · noise → lower SPI_HZ · touch inverted → TOUCH_ACTIVE_HIGH 0.
🛠️ Edit the adhkar / Arabic texts
Arabic is stored as bitmaps. Edit AdhanClock/tools/gen_assets.py (DUAS, LABELS, CATS), then:
pip install pillow # needs RAQM support
cd AdhanClock/tools && python3 gen_assets.py
This regenerates assets_*.h; upload again.
❓ Troubleshooting
| Problem | Fix |
|---|---|
'DayData' has not been declared |
keep types.h next to the .ino |
esptool: unrecognized arguments |
use esp32 core 2.0.17, not an alpha/other build |
hundreds of undefined reference to millis/delay… |
clear %TEMP%\arduino_cache_* and arduino_build_*, rebuild and let it finish |
| Sketch too big | choose Huge APP partition scheme |
Cloud Editor esptool not found |
update the Arduino Create Agent, or flash the .bin files with esptool-js |
🇩🇿 دليل مختصر (Darija)
مشروع ساعة أذان كاملة: وقت + تاريخ ميلادي وهجري + مواقيت الصلاة + أذكار وأدعية + تذكير سورة الكهف يوم الجمعة، وتتحكم فيها بحساس لمس واحد وتربطها بالهاتف عبر QR. التوصيل والتثبيت فوق. أي مشكل افتح Issue.
🗺️ Roadmap (planned for the next versions)
- [ ] Adhkar redesign: every type of dhikr/du'a gets its own dedicated page (morning, evening, after prayer, sleep, Qur'anic du'as, istighfar…) — nothing mixed together, easier to navigate.
- [ ] Over-the-air (OTA) updates: update the clock from the settings page (upload or one-click update) — no cable, no need to download and re-install everything from the computer.
- [ ] A dedicated mobile app to control settings and updates, built so that a bad setting or update can never break the device.
- [ ] More ideas: room temperature/humidity on the home screen (DHT11), automatic screen dimming at night (LDR), more languages, and more features to come إن شاء الله.
🤝 Contributing
Anyone is welcome to use this project, fork it, improve it or help move it forward — you're very welcome! 🙏 Just please keep the credit and tag me (@MedMA07 · LinkedIn) when you share your version. Issues and pull requests are open.
بالدارجة: كل واحد يحب ياخد المشروع ولا يعاون فيه ولا يطوره، مرحبا بيه. غير ما ينساش يذكرني (tag) ويخلي الكريدي.
📄 License & credits
MIT © 2026 El-Amine (MedMA07). Third-party components (QR generator, Amiri font, Adafruit/ArduinoJson libraries, Aladhan API): see THIRD_PARTY_NOTICES.md.
☕ Support My Work
🌐 Connect with Me (El-Amine):
📧 Email: elaminemed.ad@gmail.com
📱 Phone/WhatsApp: +213 668 59 87 10
📍 Location: Oran, Algeria
Made with ❤️ by El-Amine