↓ Skip to main content
  1. Home projects/

A coin-operated liquid dispenser on a Raspberry Pi

··
Table of Contents

A self-service dispenser for windscreen-washer fluid, in a summer and a winter version. The customer pays with coins or a payment terminal, presses start, and the machine pumps the paid amount. This is the software that runs it, on a Raspberry Pi with a 1024×600 touchscreen. It is the successor of the ATmega-based avr_flow.

How it works
#

  • Hardware through GPIO. Three coin acceptors and a card-terminal input, a flow-meter input counted on its rising edges, two pump outputs, a status LED, and service buttons (enter, up, down, cancel, start).
  • Dispensing. The flow meter gives a fixed number of pulses per litre, so the controller knows exactly how much has been pumped and stops at the paid amount.
  • Service menu. Pulses per litre (for calibration), price per litre, product type (summer or winter) and a counter reset, set with the buttons.
  • Statistics. Money taken and litres dispensed, in total and since the last reset, saved to disk so they survive restarts.
  • Kiosk screen. A full-screen tkinter interface shows the credit and the dispensed amount. The controller also publishes its state over a local WebSocket.
  • Running unattended. supervisord keeps the program running, the Pi boots into a read-only kiosk mode, and the GPIO pins get their initial states already at boot through the device tree, before the program starts.

Source on GitHub.

Related