Irregular Countdown Calendar
I realized that my life needs a balance between regularity and irregularity.
Weeks and months provide regularity and to have an element of irregularity I have created an Arduino project to show the number of days remaining until my age in days (not years) is a prime number.
Since prime numbers appear at irregular intervals, this will divide my life into segeents of irregular length.
On irregular days I might perform irrational activities such as gambling, praying, dancing or arguing.
The number of days remaing is displayed as a Matula Tree. These characters are stored in PROGMEM.
On days where my age is a prime number (an irregular day) the screen will twinkle.
Currently my age in days is around 16000~17000 and primes appear on average every 8 days. A maximal prime gap will appear in ~10 years and will be 44 days long.
To calculate the next prime (until i'm ~100 years old) its only necessary to test numbers for divisibility by the first ~50 primes.
Components used
Arduino Nano
RTC DS1307 Clock module
Mod4 Max7219 8x32LED Matrix
Libraries used
Chronos Library to calculate number of elapsed days.
Serial I/O
Connect to phone Serial USB Terminal
output: current date, days until next prime
input: new current date (RTC does not support time zones)
Planned improvements
To resemble pendulum clock, use a sine wave to swing the number across the display rather than bouncing it.
To make the clock seem more lively on prime days, use a sine wave to gradually increase and decrease amount of twinkles every 4 seconds.
Use EEPROM to store led intensity level.
Use EEPROM to store start date.
Perhaps use the parola's font mechanism to store the numbers.
Count down to even more irregular twin primes.
Subscribe to my newsletter
Read articles from Arno den Hond directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Arno den Hond
Arno den Hond
Self-taught software developer since childhood. Android developer since 2009, now using Kotlin & Compose. Designed, developed and published various apps. Strengths: inventive and open-minded. Interests: smart contracts, single-board computers, AI.