Virtual Minecraft birthday cake
By Rob Zwetsloot. Posted
While some (us) might argue that the best part of a birthday cake is the cake itself, there’s definitely something to be said for an interactive model cake that does stuff in Minecraft. Also, there is a real cake underneath it all after you’ve finished with the virtual stuff.
“The virtual cake consists of a looping video of a cake created on Minecraft with nine candles that can be blown out by spinning miniature wind turbines on a matching physical model cake,” Stephen Thompson, the creator of this cake, tells us. “Once all the candles are blown out, the birthday child can lift the model cake to reveal an edible cake which is mercifully free of children’s saliva.”
Sounds a bit more tasty and clean when you put it that way.
“I have always enjoyed making my children’s birthday cakes, with a firm belief that form and function are as important as flavour,” Stephen explains. “In 2021, I was faced with the problem of not being able to blow out candles on the cake… A virtual cake controlled by miniature wind turbines seemed the obvious solution. I’d recently started developing web applications for research and education in surgery, so it made sense to reuse these skills for the virtual cake.”
Virtualising baked goods
While something like this could be in some way achieved in Minecraft Raspberry Pi Edition, that was not why a Raspberry Pi was used.
“Raspberry Pi provided an easy way to interface with the analogue-to-digital converters needed to read the wind turbine voltages,” Stephen says. “Along with sufficient computing power to serve a web application from within the cake itself, using Raspberry Pi enabled me use the same software architecture (Python, Flask, HTML) as I have used professionally. Sourcing the right HAT to measure nine voltages was very easy."

The virtual cake instead uses looping video overlaid with candle GIFs served via a web app in a clever way, as Stephen explains:
“The application uses Flask to serve a web page which any device on the local network can access… a JavaScript loop is used to repeatedly send a POST request to the web server asking for the voltage from one of nine analogue-to-digital converters (the ADC board can support up to 16 candles). The code to interface with the ADCs and reply to the POST requests is written in Python and utilises the Flask and gpiozero libraries. All the code is available on GitHub.”
Proof in the dessert
Despite the best efforts of developers, sometimes an interface is not always clear to the user – especially when they’ve just turned nine.

“I was slightly nervous that the children would find it too abstract, but they worked it out pretty quickly,” Stephen mentions. “They saw the connection between the plastic wind turbines on the cake and the candles on the screen, and worked out that you could turn the on-screen candles off by blowing on the wind turbines. There was much laughter and smiles.
The children were also very pleased to discover that there was actual cake underneath it all.” If only there were cake underneath every interactive Raspberry Pi project.

Rob is amazing. He’s also the Features Editor of Raspberry Pi Official Magazine, a hobbyist maker, cosplayer, comic book writer, and extremely modest.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Make your RAM go further – Raspberry Pi OS memory optimisation tips
In issue 164 of Raspberry Pi Official Magazine we have been playing around with the new Raspberry Pi 5 1GB RAM. While the RAM shortage caused by the demands of AI infrastructure is annoying beyond belief, this has been a great chance for us to really get to grips with RAM. Generating images in Stable […]
Read more →
Mighty Projects – 1GB Computer in Raspberry Pi Official Magazine 164
It’s normal for computers to get faster and more pwerful, but the new-ish Raspberry Pi 5 1GB is a step in the other direction: it has all the processing power and the same GPIO pins of its more costly siblings, but with only 1GB of RAM it’s at a price that’s friendlier on the wallet […]
Read more →
Win one of five 256GB Raspberry Pi Flash Drives
If you’ve been around long enough, you know that every Raspberry Pi accessory is top quality, and the latest Flash Drive is no different. Fancy a big one? We have five up for grabs, and you can enter below… Win 1 of 5 256GB Raspberry Pi Flash Drives
Read more →