When my algebra students were first introduced to Heron's (or Hero's) formula, I always told them a brief historical note about his invention of a steam-jet propelled automaton (called the æolipyle) that he created during the first century of the common era.
Over Christmas I received the little "Book of Secrets" as a gift and learned as I leafed through it that he was also the inventor of the first known vending machine. Apparently in ancient times folks were required to pay for holy water to wash themselves before entering the temples, but it seems they didn't always cough up the cash..... so... Heron invented a device to help keep them honest.
Here is how the device operated as provided on the Smithsonian Museum web page:
How it works: A person puts a coin in a slot at the top of a box. The coin hits a metal lever, like a balance beam. On the other end of the beam is a string tied to a plug that stops a container of liquid. As the beam tilts from the weight of the coin, the string lifts the plug and dispenses the desired drink until the coin drops off the beam.
Proof of complexity: Early modern vending machines actually used a similar system, before electrical machines took over.
Quirk: It was devised to distribute Holy Water at temples, because "people were taking more Holy Water than they were paying for," Humphrey says.