• Digital prayer clock

    • All timings between 2000 and 2099 by truly astronomical calculation

    • Latitude/longitude can be entered with a resolution of 0.01°

    • All prayer and makrouh times, Hanafi and Shafi Asr calculation

    • Hijri calendar and crescent visibility

    • Qibla angle and sun azimuth/elevation angles

    • 4 different calculation algorithms

    • Real-time astronomical data about earth/sun/moon

    • Displays ambient temperature

    • Display brightness is dynamically adapted to surrounding light intensity

    • Automatically recites adhan on every prayer or only on fajr

    • Can recite predawn salawaat

    • Parametric fajr adhan & predawn salawaat timing

    • "Skip next adhan" option

    • 40 different adhans special for every prayer of the week

    • Automatic crystal adjustment to keep clock accurate

    • Automatic daylight-saving adjustment according to European convention

    • Recites salawaat before adhans and Friday prayer

    • 7 full Koran recitations



      Our adventure began in 1994, when we were dealing with embedded systems, with the passion to calculate the prayer times astronomically. So ALPEREN software was born in 1995. Then the idea of embedding this software into a microcontroller to develop a digital prayer clock resulted in the production of the first Vakitmatik in 1996. When we next intent to sample an adhan sound and write it into an EPROM, Ezanmatik come out in 1998. Since we couldn't give up using the clock for many years, we decided to replace the EPROM with an SD card. The vast capacity of SD cards inspire us finally to design Hatimmatik in 2015, which is a Koran reciting clock. If you are an electronic enthusiast and the topic so far aroused your interest, you can find the design details of Hatimmatik.




      A single 8-bit microcontroller has been used in the system to perform all the required tasks. 89S8253 from ATMEL contains 12 kB of FROM and 256 bytes of RAM. The embedded software can be updated via J2. All the timings related to prayer and the other astronomical data are calculated in real-time acoording to the parameters like geographical location, local time, etc. The algorithms, which are also utilized in the ALPEREN software, are developed specific to embedded applications and are detailed in the relevant paper. Since there is no hardware support on the processor for 16/32-bit & floating-point arithmetic/trigonometric functions, all these mathematical operations are realized through software. Hence the calculation of 6 basic prayer times just completes in one second.


      Real Time Clock (RTC)

      The current time & date information is kept in DS1307, which has a battery backup. All the system parameters, adjustable by the user, are preserved in its 56 bytes NVRAM memory, CRC protected, in order not be destroyed in case of supply removal. The IC communicates via I2C interface. Since our microcontroller does not possess any I2C hardware, this protocol is actualized by means of a driver software.


      Display & Driver Circuit

      The original design in 1996 has been conserved here, which employed 10 units of four digit 7-segment LED displays. In order to manage to drive all the 320 LEDs with a minimum number of pins (control:4 + data:2 = 6), a serial multiplexed driving technique has been applied. Each column (digit) is activated one-by-one at 64 Hz scanning frequency. For this, an interrupt is generated by timer T2 every 4 msec. 10-byte segment data of the column in-turn is serially sent by the interrupt subroutine to the 74HC164 serial-in/parallel-out shift registers, connected in chain, syncronous to a clock signal. Because the microcontroller has no synchronous commnication infrastructure appropriate, clock generation and shifting operations are fulfilled by software within 0.5 msec. The ambiance brightness is then measured with LDR/C2. Charge time of C2 is directly proportional to the resistance of LDR and inversely proportional to the light level. R1 is included to partially linearize the resistance/light curve of LDR. Measuring is carried out within 0.5 msec at most. Then a pulse (MPX) is forwarded to the MOSFET controlling the column in-turn, of which the pulse-width is between 0.03 and 2.2 msec, being proportional to the measured light intensity. To avoid from staying in the interrupt during this pulse, timer T0 is loaded with the required pulse duration and the interrupt is then exited, after starting the pulse. When the delay has passed, the pulse is ended by T0 interrupt subroutine. Control of the clock dots and inspection of the button states are also done during the T2 interrupt. The interrupt timing is shown here.


      Temperature Measurement

      The surrounding temperature is measured by the sensor DS1820. The data is flown over the 1-wire asynchronously at 9600 bps by a driver software. Only one measurement is taken each minute to minimize self-heating. The 1-wire protocol is time sensitive; therefore no interrupts are allowed in-between. That's why the driver software waits for the occurence of the T0 interrupt, to start the 1 msec transmission of each byte consecutively. The self-heating of the device is found to be approx. 4°C at max. power consumption (full brightness). This is compensated by subtracting a value proportional to the brightness level integrated over the time. The integration time constant is selected around 20 minutes, corresponding to the termal response of the enclosure.


      Audio Section

      The voice data, encoded with the CVSD compression algorithm and recorded onto the SD card, are read over the SPI interface of the microcontroller and transferred through two digital ports to the analog decoding circuit. The reconstructed audio signal is input to the TDA7052A amplifier-IC with 2W output, which powers the loudspeaker. The technical solution applied here is described thoroughly in the relevant paper. The time-sensitive characteristic of the voice reproduction forces that all interrupts are inhibited meanwhile and the displays are thus turned-off, but D6 indicates that sound is active. If SD card is not accessible, the system reminds the prayer time by a beep waveform instead. When the audio finishes, the line MLA is released to positive to mute the amplifier.