How To: Making a Raspberry Pi Christmas Countdown Ornament

Adam Feil
2 min readDec 2, 2018

My simple Christmas countdown ornament went viral on Twitter thanks to retweets from adafruit industries and the Raspberry Pi Foundation Twitter account.

A few folks asked for a guide. This is the requested guide :)

The Hardware

I’m using a Raspberry Pi 3 Model B+, but just about any model should suffice for this.

The LCD is a common 1602 (16 characters per row, 2 rows) model that has an integrated I2C module. (like this:

The Software

First things first — the code is all Python.

I’m using a library written by Denis Pleic to handle the details of communication with the LCD. You can find his library here: and some examples from Denis here:

The Code

The code, while not elegant, is straightforward:

  • Connect to the LCD
  • Get a date value for Christmas (12am because who can wait ‘till morning)
  • Calculate the difference between now and Christmas
  • Turn that into pretty string values for the number of days, hours, minutes, and seconds.
  • Output to the LCD
  • Wait 200 milliseconds to loop again

Putting it all together

I’ll have to keep this brief, but luckily there are many good guides out there to show you how to get things working (I used them myself).

There’s some configuration you need to do on your Pi to get I2C communication working. Here’s a nice explanation of that:

Once you’ve got I2C enabled, you can download the I2C_LCD_driver and write or copy the code.

I connected my LCD to the Pi using a few meters of ethernet cable. I soldered connectors on the ends to connect to the Pi and the LCD. If you don’t want to solder, you can just use pre-made wires.

Lastly, if you want the program to start automatically, and why wouldn’t you, you can edit your /etc/local.rc file to do just that.

Right above the last line in the file that says “exit 0” you can add this line:

(sleep 10; python /home/pi/

That should do it. Good luck!

I’m happy to answer any questions or hear feedback about how this is all wrong :) I’m on Twitter @adamfeil



Adam Feil

Educational Psychology Ph.D., business analytics nerd, computer scientist, President @MakeStickers