The First Vending Machine Was Built Nearly 2,000 Years Ago
Nearly 2,000 years ago, Hero of Alexandria invented the world's first known vending machine.

When you drop a coin or tap your card on a vending machine for a cold drink, it feels like entirely modern technology. But the idea of a machine dispensing something the moment it receives payment isn’t modern, is not even medieval; it’s far older than that.
The world’s first known vending device was built nearly two thousand years ago, in the 1st century AD, in Roman-era Egypt. All it took was a coin, and it would dispense a fixed amount of holy water or wine automatically, with no one standing there to hand it out.
The genius behind this early automaton was Hero of Alexandria, a Greek engineer and mathematician working in that city during the Roman era. If his name rings a bell, it’s probably from Heron’s formula, the one calculating a triangle’s area from its three side lengths, the same one you probably learned and eventually forgot. Geometry, though, turns out to be the least surprising thing about him. He invented the aeolipile (an early steam engine), automated miniature theaters, heat-triggered temple doors, and dozens of other incredible mechanical tricks.

And among those dozens was this vending machine, built to solve a very real problem. In local temples, worshippers paid for holy water used in purification before prayer, but often walked away with more than they’d paid for. Holy water was limited, and measuring out each person’s share by hand ate up time and patience. Priests were, understandably, over it.
Hero’s solution was an automatic system, housed in a small vessel, that released a fixed amount of holy water upon receiving a coin. It had a slot on top where a worshipper dropped a coin, which landed on a pan attached to one end of an internal lever. The coin’s weight pulled the lever down, opening a valve and letting water flow out through a spigot.
As the lever kept tilting, the coin eventually slid off the pan and dropped into a collection box below. The moment it did, a counterweight snapped the lever back up, sealing the valve and cutting off the water before the next person’s turn. No chip. No sensor. Just gravity.
Hero documented the design in his treatise Pneumatica, alongside his other mechanical creations. To ancient worshippers unfamiliar with classical physics, the self-dispensing vessel must have felt like a small miracle, which only deepened the temple’s sense of sanctity.
Variants of the same mechanism were later used for dispensing wine instead of holy water in Roman social gatherings in Egypt. However, it would take close to 1,800 years for the idea to truly stick. Commercial vending machines didn’t reemerge until England and the US in the late 1800s, selling tobacco, postcards, stamps, and chewing gum.
Today’s high-tech vending machines may run on microchips and touchscreens rather than simple balance levers, but they operate on the same basic premise Hero of Alexandria envisioned two thousand years ago.
Story Sources: Sky History, Wikipedia, History Facts, TestingTable, The Vintage News, Explorable
I first published it on my website ScienceClock.com



We were so close to having VII/XI
I wonder how often modern inventions turn out to be old ideas wearing new clothes. The technology changes. Good engineering rarely does. Loved that, thank you!