Irregular Countdown Calendar (+video, +source) DS1307 Max7219

I've been thinking a lot about how my life needs a balance between regularity and irregularity. While weeks and months provide a structured rhythm, I wanted to introduce an element of unpredictability—so I built an Arduino project to track the number of days until my age (in days, not years) becomes a prime number.

Since prime numbers appear at irregular intervals, this effectively divides my life into segments of unpredictable length. On these "irregular" days, I might engage in spontaneous or irrational activities—whether that's gambling, praying, dancing, or even arguing! Please give me some more suggestions for fun activities to perform on such days?

To visualize this, my project displays the countdown as a Matula Tree, with character data stored in PROGMEM. And when my age in days is prime, the screen twinkles to mark the occasion.

Right now, my age in days is somewhere between 16,000 and 17,000, and I see a prime about every 8 days on average. In about ten years, I'll hit a maximal prime gap of 44 days—one of the longest stretches of regularity I'll have in a while!

For practical purposes, I only need to check divisibility against the first ~50 primes to determine the next prime (at least until I turn 100). This makes the calculations fairly manageable.

(2 videos in playlist)

Components used

  • Arduino Nano
  • RTC DS1307 Clock module
  • Mod4 Max7219 8x32LED Matrix

Libraries used

Chronos Library by Inductive Kickback to calculate number of elapsed days.

Serial I/O

connect to phone using Serial USB Terminal by Kai Morich

output: current date, days until next prime

input: new current date (RTC does not support time zones)

Planned improvements

  • use a sine wave to swing the number across the display rather than bouncing it making it resemble a pendulum clock
  • use a sine wave to to make the clock seem more lively on prime days, gradually increasing and decreasing the amount of twinkles every 4 seconds.
  • store led intensity level in EEPROM
  • store start date in EEPROM
  • store the numbers using the parola's font mechanism.
  • Count down to even more irregular twin primes.
1 Like

On the other hand prime numbers are perfectly calculatable so you can plan all your irregular days in your agenda.

You could add some noise from an external source (assuming web access) like

to get more randomness in your data. E.g. when the last 2 digits of the debt is a prime.

Please give me some more suggestions for fun activities to perform on such days?

  • Have a walk on a beach you have never visited before.
  • Organize a bingo in the home of the elderly
  • Find classmates from primary school etc.
  • walk through your town and say something friendly to everyone you encounter.
  • give away free hugs => see https://www.youtube.com/watch?v=vr3x_RRJdd4

This is an interesting idea but if the device were to reset then it would get the latest debt value and suddenly there would be a different number of days to go which would be terribly confusing! :wink:

Thank you for these ideas but I am looking for activities with an element of irrationality or unpredictability (perhaps giving away free hugs would qualify)

suddenly there would be a different number of days to go which would be terribly confusing

Be careful what you ask for, you might get it...

An unpredictable activity could be travelling, a game I did as a child on a bike. As grown up you could do it by car.
Follow a car for 5 minutes, then select another car until you have had 13 cars. (1.5 hour drive?). No idea where you will end. More cars if you want to.

Or take the Guiness book of records and redo one if its records (local record of your village might be challenging enough)

thank you for the suggestions :grinning: