Jar Of Primes

The Jar of Primes is a knock-off version of the Primer, a kinetic sculpture by Karl Lautman. For a presentation of the original see the Numberphile video (also embedded at the bottom).

My version is built around a NodeMCU board which in turn contains a ESP8266 12E chip. To that it adds a pushbutton to command the next number and a counter to display it plus some bits and pieces like a voltage regulator and a relay to advance the counter.

The hardware is packaged in a discarded jar which I believe once contained olives. That also inspired the labelling. Not shown is the very pretty blinkenlights display that just happens to emerge from the fact that there are a number of SMD LEDs on the various modules.

The code is written in the Arduino IDE and available on GitHub. There is not a lot worth mentioning about it. Having been educated around really puny microcontrollers I had expected to build some sort of lookup table of the primes in range but I found that the ESP8266 is plenty powerful enough to simply brute-force its way from one prime to the next. This is especially true given the constraint of the mechanical counter. In fact I added a limiter to yield a nice and satisfying steampunky frequency for the counting.

Via WiFi the jar serves a webinterface that allows the usual configuration of credentials to connect to an access point and provides a landing-page for clients that happen to just pop by and connect to it.

The real payload of the UI is a virtual display of the counter and button that is synchronized to its physical representation. The physical world and all virtual clients are kept in sync through http or websockets.

Sorry to disappoint but no, the Jar Of Primes is not on the internet. It is rather noisy and I share space with it. Also I am a firm believer in the pending rise of the robots and refuse to add even single instances to their ranks.

Watch this video from the Numberphile youtube channel to see where I stole the idea from and to watch a real mathematician get all exited about twin primes and large prime gaps:

Thanks to Karl Lautman for a great idea and permission to rip off his work.