↓ Skip to main content
  1. Home projects/

avr_flow: a new brain for a liquid vending machine

··Index: 7·
Table of Contents

This machine sold liquid for coins, but the PLC-based controller it came with could do very little. I took it out, put a small ATmega328 board in its place (an Arduino Pro Mini running at 8 MHz) and wrote new firmware for it, avr_flow.

What the firmware does
#

Three coin acceptors add credit, and a running total of coins is saved to EEPROM, so the count survives power cuts. Pressing start switches on the pump. A flow meter sends pulses as liquid goes through, the firmware counts them and turns the pump off once customers get what they paid for, unless somebody presses stop earlier.

avr_flow: coin acceptors, buttons and flow meter feed an ATmega328 that drives the pump, display, status LED and buzzer3 coin acceptorsstart, stop, priceflow meterATmega328Arduino Pro Mini, 8 MHzcredit, pulse count,timeoutpump4-digit LED displaystatus LED, buzzerEEPROMcoin total, token price
What the ATmega328 reads and what it drives

While pouring, a 4-digit LED display counts down how much is left to dispense, and a status LED blinks faster and faster as the paid amount runs out. Owners set the price of a token with the buttons, and that value goes to EEPROM as well. There’s also an inactivity timeout and a buzzer.

Before building anything I simulated the display circuit in Proteus; those simulation projects and a photo of the hardware are in the repository too.

A few years later the same kind of machine got a Raspberry Pi successor, the liquid dispenser with a touchscreen.

Source on GitHub.