Long before snack machines, one ingenious device made a coin release a measured flow of water.

The Greek engineer Heron of Alexandria described a coin-operated holy-water dispenser for Egyptian temples. A worshipper dropped a coin into a slot; its weight tipped a small pan, which opened a valve and let water flow. When the coin slid off, the pan rose and the valve closed. The mechanism turned a brief payment into an automatic action, without a person ladling each portion.

A Smith College history-of-science exhibit explains the machine as a practical way to dispense water for ritual washing. Heron's writing describes a design, not a surviving machine, so we cannot be sure how widely it was built or used. Calling it an ancestor of the vending machine is a handy comparison, though it sold no snacks and did not run on electricity.

The clever part is the simple chain of cause and effect: coin, lever, valve, water.