Hero of Alexandria described a remarkable coin-operated dispensing mechanism.
One invention used a coin-operated mechanism to dispense a measured quantity of water.
The weight of the coin temporarily activated a lever https://acmilsandiego.edu.ec/author/e39life/