Skip to main content
An ancient Roman source of holy water

The vending machine was invented a lot earlier than you think

Heron of Alexandria is said to have invented the first vending machine in the 1st century AD. So, how did this contraption work, and what did it dispense?

Image: Shutterstock.com

What have the Ancient Greeks given us? Quite a lot – including democracy and the Olympics. Even seemingly modern machinery actually has its origins in the ancient world. The alarm clock is one example; another is the vending machine.

The next time you use a vending machine to fetch yourself a KitKat or bottled drink, you can silently thank Heron of Alexandria. This Ancient Greek mathematician and engineer has been credited with inventing the first-ever vending machine. Here’s what Sky HISTORY have been able to find out about it…

Who was Heron of Alexandria?

Little is known for definite about Heron of Alexandria’s life. However, as you might have already gathered from his name, he is thought to have been based in the Egyptian city of Alexandria.

Historians today can’t even be certain when he lived. From ancient sources referring to him, it has been deduced that he was likely active in the 1st or 2nd century AD.

So, who was he? By many accounts, the Thomas Edison or Steve Jobs of his time, inventing a wide array of clever tech, none of which relied on electricity.


What did Heron of Alexandria invent?

Admittedly, we can’t be absolutely sure how much he did invent. He is best known for ‘Heron’s formula’, where the lengths of a triangle’s sides are used to calculate the shape’s total area.

However, it is unclear where Heron conceived of the formula himself. The same can be said about mechanical inventions ascribed to him. These include the ‘aeolipile’ (the first documented steam engine), a fountain and even theatrical automatons. (The ancient equivalent of AI-generated actors, you could say…)

Though Heron wrote about all these contraptions, it is possible that he was referring to the existing work of earlier inventors. Nonetheless, many of his written works resemble lecture notes. This suggests that he taught at the Mouseion, the research institution housing the Great Library of Alexandria. So, he certainly could have been brainy enough to invent these machines himself.

Why did the ancients need a vending machine?

Alexandria was founded by the Macedonian king Alexander the Great in 331 BC. By Heron’s time, Egypt had been conquered by Rome but also attracted adherents of various faiths. This left religious temples in abundance across the province.

At these temples, holy water was a crucial part of the pre-worship cleansing ritual. At the same time, there was only so much of it to go around. A worshipper visiting the temple would buy some of this water there but often take more of it than they had really paid for.

For local priests, it would have been onerous and time-consuming for them to manually measure out each visitor’s allocation of consecrated water. So, there was a ready market for this peculiar, new-fangled contraption, the vending machine.


How did the first vending machine work?

Heron describes this vending machine – the earliest on historical record – in one of his treatises, Pneumatica. The user firstly inserted a coin into a slot on top of the machine. This coin would subsequently land on a lever inside.

The weight of the coin would depress the lever, tilting it. Inside the box, this lever was attached to a beam. This was itself connected to a plug blocking an aperture elsewhere on the container. Hence, the tilting of the lever unblocked this opening.

This motion, in turn, led holy water to pour out of the opening… but not for too long. At some point, the coin would inevitably slide off the lever. When it did, a counterweight lifted the lever back into its former position, turning off the tap before the next user stepped forward.

The precursor to modern vending machines

Vending machines made to this design were installed at temples across Egypt. These units ensured that all paying worshippers got their fair share of holy water, and must have seemed like miracles in themselves.

However, it still took a surprisingly long time for the general concept of the vending machine to catch on further afield. Similar brass containers offered tobacco in taverns across Stuart England. Later still, in 1822, English bookseller Richard Carlisle used vending machines to disseminate newspapers.

The earliest vending machines are a far cry from their modern-day counterparts with touchscreen interfaces and capacity for contactless payments. This doesn’t change the fact that Heron’s machine was an extraordinary display of forward thinking for its time.


For even more fascinating insights into the technology of the past, just sign up for the Sky HISTORY newsletter.