The Raspberry Pi Advent Calendar that Dispenses Chocolate!

The modern Raspberry Pi + LEGO approach to Advent calendars is awesome.

The Raspberry Pi Advent Calendar that Dispenses Chocolate!

The temptation of chocolate is ever-present in our lives. No matter how hard we try to hold out, no matter our convictions… at the end of the day, chocolate is just plain sinfully delicious. But that’s where technology can step in to save us from ourselves.

This Raspberry Pi uses the Build HAT with attached LEGO components to create the perfect method of controlled chocolate delivery. Inventor Richard Hayler realized that his incredibly clever children would nick all the chocolates on December the 1st, then carefully close all the doors of the Advent calendar afterward. Naturally, Richard set out to solve this problem with the world’s smallest and most versatile computer.

“Re-Adventing” the calendar

“Re-Adventing” the calendar

Using the new Raspberry Pi Build HAT (which allows the Raspberry Pi to connect with various LEGO motors and sensors), Richard was able to knock out some precision motor control far easier than it would have been just a few years ago.

The Raspberry Pi keeps a log file of whenever chocolate is released. This is a genius stroke because it can’t be gotten around by simply rebooting the Raspberry Pi and tricking it into forgetting which day of the month it is. Instead, the system checks to see if a chocolate has been listed in its log file and combines that with its calendar, allowing it to be sure that no two chocolates are dispensed on any one day.

The Raspberry Pi keeps a log file of whenever chocolate is released.

The Build HAT Python library proved a massive boon in this process as well, providing a solid grounding for the software that Richard needed to get things going. Supplemented with code from the GPIO Zero Python library, he was even able to get his 3D LED Christmas tree blinking for an added festive flare!

The Raspberry Pi Build HAT

The Raspberry Pi Build HAT

Of course, no grand invention is entirely without risk, and Richard was forced to eat an incredible amount of chocolate himself for testing purposes, as getting the right size and shape took some serious experimentation.

GPIO Christmas tree

The inventiveness of this machine is a real testament to Richard’s love of chocolate, and honestly sounds like the ideal project to share with the family afterward. This is why checking out the Raspberry Pi Build HAT is such a good idea! There are fairly unlimited projects that can now be accomplished with the astonishing extensive abilities of the HAT, supported by the huge Python libraries available to help you get off the ground with even the most original concepts.

Richard’s no stranger to other Raspberry Pi holiday projects, either, like these blinking Christmas lights! Looking at these, I already have so many ideas for things I could do with a Raspberry Pi to spice up the holiday vibe.


💡
Hi there! I’m Odin Halvorson, a librarian, independent scholar, film fanatic, fiction author, and tech enthusiast. If you like my work and want to support me, please consider becoming a paid subscriber for as little as $2.50 a month!

Subscribe for my regular newsletter. No spam, just the big updates.