A Raspberry Pi is surprisingly handy if you want to build your own vending machine

Raspberry Pi 4 runs Windows 11
(Image credit: The Raspberry Pi Foundation)

A Raspberry Pi might be the key to running your very own vending machine, and what dyed in the wool PC gamer wouldn't want an entire vending machine in their house? Okay, well perhaps some don't, but this is another great use of the compact computer.

User OfficalFlance on Reddit posted their vending machine conversion to the site after they managed to get the broken machine up and running again (good spot, Tom's Hardware). Essentially, they took an old, burned out vending machine and gave it a Pi-powered makeover to get it dispensing sweet treats once again.

"Basically I found an old vending machine that had a burnt out motherboard, bad lights, and the only thing working in them were motors, and tore out everything to be a part of the Pi-family," they say in the post.

The modder says they bought the old machine for $200, and replaced its ruined innards with a Raspberry Pi 4, which is a $35–$75 part. An Arduino Mega microcontroller is being used to control all the motors, which is a sub $50 part. You really don't want your snacks to get stuck in those blasted coils because of a dodgy controller.

Your next machine

(Image credit: Future)

Best gaming PC: The top pre-built machines from the pros
Best gaming laptop: Perfect notebooks for mobile gaming

So that's a cheap build overall, though rebuilding of the vending machine's insides doesn't sound like an altogether simple one, actually requiring a full rewire.

Currently the vending machine only accepts cash, but the modder is hoping to make it work with credit card readers at some point in the future. The difficulty being with sourcing a decent Java API, which they haven't managed to do just yet.

OfficalFlance hopes for the vending machine to find a new use inside a church, though they say they are building more. Once again proving that the tiny Pi computer is a mighty tool in the right hands, despite its diminutive size.

Jacob Ridley
Managing Editor, Hardware

Jacob earned his first byline writing for his own tech blog. From there, he graduated to professionally breaking things as hardware writer at PCGamesN, and would go on to run the team as hardware editor. He joined PC Gamer's top staff as senior hardware editor before becoming managing editor of the hardware team, and you'll now find him reporting on the latest developments in the technology and gaming industries and testing the newest PC components.

Read more
Various creations in Minecraft, including computers and calculators.
This Minecraft creation blots out the sun for the villagers below, they surely praise it as God, but we know it really to be a functioning 32-bit computer with 2 kB of RAM
Texas Instruments MSPM0C1104 tiny chip
World's smallest microcontroller looks like I could easily accidentally inhale it but packs a genuine 32-bit Arm CPU
Knolling shot of "Steam Brick," a Steam Deck with many of its parts removed so it could fit in a smaller enclosure, with some of the removed components arranged tastefully around it.
One mad modder has massacred the Steam Deck, folding it into a 'Steam Brick' with 'no screen, no controller, and absolutely no sense'
Aooster's G-Flip 370 mini PC
This palm-sized PC has removable memory, a flip up screen, and a Ryzen AI 9 HX 370 processor
Two pictures of Billet Labs' copper gaming PCs
This 4090-equipped water-cooled copper PC 'looks like a steam engine' and I'm in love
DeepSeek
Today I learned I can run my very own DeepSeek R1 chatbot on just $6,000 of PC hardware and no megabucks Nvidia GPUs required
Latest in Hardware
The Razer Huntsman Mini 60% gaming keyboard floats in the teal PC Gamer deal void. The per-key RGB lights are on.
The most adorable Razer keyboard features not only an almost half-size form factor, but an almost half-size price at only $70
Razer DeathAdder V3 Pro gaming mouse on a blue background
The Razer DeathAdder V3 Pro is as cheap as I've ever seen it and it's even cheaper than the cut-back HyperSpeed version
bulky headphones on black made using x rays
'We essentially created a virtual headset': Scientists transmit inaudible sound using ultrasonic beams to create single person 'audio enclaves'
A promotional image for the Compal Adapt X modular laptop, as presented by the iF Design Foundation
If you've ever wanted to upgrade a laptop with 'modular AI units' then Compal might just have the very thing you're looking for
Dune Awakening
Dune: Awakening system requirements are here, complete with Razer Sensa HD haptic support to 'feel the rumble of your ornithopter's seat'
An image of a MSI power supply unit against a circular gradient blue background
MSI has gone so heavy with 12V-2x6 power sockets in its latest high-end PSUs that many AMD and Intel graphics cards have no way of being powered
Latest in News
A True Kin knight stands in a ruin in Caves of Qud, flanked by bloodstained furniture and a freshly mortalized corpse.
Despite making a roguelike where you can have countless arms and legs, Caves of Qud's creators say the ideal form is a limbless sphere: 'We started in perfection and only moved farther from God'
Civilization 7 Great Britain - Modern Civ art (via YouTube)
As Civilization 7 struggles to keep up with Civ 5 player counts, a new patch is coming tomorrow with still more UI changes and gameplay tweaks
Metaphor: ReFantazio character art
Metaphor: ReFantazio battle director says turn-based RPGs can still be just as popular as action RPGs: 'I personally believe turn-based games have a long future ahead of them'
assassin's creed shadows review
Assassin's Creed Shadows streamer goes viral after confronting whining commenters: 'Normal people don't get upset about this sh***'
Assassin's Creed Shadows change seasons - An upper-body shot of Yasuke looking cheerfully up into the distance.
'This is just the beginning': Assassin's Creed Shadows dev team thanks fans for their support and promises more to come in the future
Geralt sitting on a wall wearing a Cyberpunk jacket modded by TheRealArdCarraigh
The Witcher 3 devs had to practically remake the game engine to make official modding possible