Mars clock

As a time-enthousiast I wondered how time was kept on other planets, like Mars. Of course the citizens of Mars (none found at the time of this writing) did not decide on this themselves, but NASA did.

I decided it would be cool to have a physical clock on the wall telling me the time on Mars, to get used to it in case I ever go there. There's software for it but nothing beats a circle on the wall with arrows indicating the current time coordinates.

After pondering a bit I realised arrows would require a noisy mechanical construction and decided against this option. The circle stayed but instead I would use LEDs showing hours, minutes and seconds. This was motivated a bit by that I had bought a LED ring from aliexpress.

Things I had to do: figure out how to use the ring, figure out how time works on Mars, write software and create something I could stick to the wall.

Using the ring is simple, just use the FastLED Arduino library (and thus an Arduino - in this case an ESP8266 as I then can sync time against the internet). Connect the data-pin to pin 2 of the ESP8266 (or D2 in case of a NodeMCU/WeeMos D1) or any other pin if you like (then adjust the PIN_NEOPIXELS #define in the source code).

Time on mars is described, complete with formulas on the NASA-website.

The arduino source code: marsklok.ino (or adapted for platform-io)
The program does this: retrieve the current time from an NTP server, recalculate that into the Mars-time and then using the FastLED library light-up 3 LEDs. There's also code in (which can be disabled) to listen to an MQTT server for ON/OFF messages (to save a tiny bit of power consumption).

Something to stick to the wall was easy: I had access to a lasercutter at that time. So some clicking in (for a small box that contains the micro-controller) and drawing in Inkscape and the result can be seen below. I'm not a graphics-artists and that's clear by the look of it but still I think it is pretty neat!

The colors of the LEDs indicate: red LED is hour, green LED is minutes and the blue LED is: seconds.

Other projects: here and here.

The Lotter allows you to participate in lotteries from all over the world!