atm-pico

Pizza box as seen on MoneroKon 2023.

AGPL-3.0 License

Stars
6

ATM Pico

This is a small ATM build that costs around 200-300 EUR. It uses the OpenKiosk protocol and daemons.

Components

  • Alberici BillyOne bill acceptor - 150 EUR
    Any bill acceptor with pulse interface should work.
  • 616 coin acceptor - 18 EUR
    Any coin acceptor with pulse interface should work.
  • YHDAA M800D barcode scanner - 27 EUR
    Any serial barcode/QR code scanner should work.
  • 7" touchscreen HDMI display - 44 EUR
    A touchscreen is required for this build but the size doesn't matter. You can make the enclosure to fit a smaller/bigger screen.
  • Cables, jumpers, shrink tubes and whatever you need to connect things
  • A computer with GPIO. SBCs are great for this but you can also use external GPIO boards. We used a Raspberry Pi 3b+ for our build. But since all the software is written in Go, you can use any computer including RISC-V and MIPS architectures.

Software requirements

Step 1 - Wire things together

Connect your components. Take notes of the GPIO input pins and serial device names that you will be using. This part is heavily dependent on your choice of hardware but for our build we did the following:

  • BillyOne pulse pin GPIO23, enable pin connected to GPIO18.
  • Coin acceptor coin (pulse) pin connected to GPIO27.
  • Serial QR code scanner is mapped to /dev/ttyACM0.
  • The 7-inch touchscreen HDMI display is powered on via Pi's USB port.

Connecting the coin and bill acceptors

Both acceptor devices require 12 volts. Since Raspberry Pi and many others use 5V, you can either choose to power these seperately or you can use a step down converter to supply 5V to the Pi from the same 12V power supply. In our MoneroKon PoC build we used two different adapters: 5V one for the Pi, 12V one for the bill and coin acceptors.

Note: The colors of the wires in this diagram do not match the pictures.

Close up of coin acceptor pins:

The adapter connects to all pins but the COUNTER pin is actually not used. This pin is undocumented, nobody really knows what it does.

Close up of bill acceptor pins:

The numbers in paranthesis in the drawn diagram above are as described in BillyOne's datasheet:

Step 2 - The software

Before starting the backend program (called atm-pico), make sure the pulseacceptord, coinacceptord and the MQTT bridge is up and running else the components might miss start/stop commands. If you have both bill and coin acceptors, you will have two instances of pulseacceptord running. You don't need to have MoneroPay running while testing but keep in mind that you won't be able to transfer Monero without it and the final step in the ATM will timeout.

Bill acceptor configuration

The following pulseacceptord configuration works for Alberici BillyOne:

device:
  pulse_pin: 23
  debounce: "100ms"
  denoise: "100ms"
  timeout: "100ms"
 
# Some devices have "enable" pins to start/stop money input.
enable_pin_control: true
# Specify if enable_pin_control is enabled.
enable_pin: 18 
enabled_when_high: false

# pulses: amount (cents)
values:
  1: 500
  2: 1000
  4: 2000
  10: 5000
  20: 10000
  40: 20000

mqtt:
  brokers:
    - "mqtt://127.0.0.1:1883"
  topic: "pulseacceptord"
  client_id: "pulseacceptord-billyone"

Coin acceptor configuration

This one is tricky because we used a cheap coin acceptor which is extremely sensitive to noise and not too accurate with the pulse intervals. We recommend inserting coins and checking pulse/pause widths to verify using the pulse-watcher program.

The pulseacceptord configuration below works with 616 coin acceptors from China.

device:
  pulse_pin: 27
  debounce: "102ms"
  denoise: "28ms"
  timeout: "30ms"
  
# pulses: amount (cents). Don't forget to change these values
# if they don't match your own configuration!
values:
  2: 10
  4: 20
  10: 100

mqtt:
  brokers:
    - "mqtt://127.0.0.1:1883"
  topic: "pulseacceptord"
  client_id: "pulseacceptord-coin"

QR code scanner configuration:

Following codescannerd configuration works for our scanner:

device:
  portname: "/dev/ttyACM0"
  bufflen: 150
  debounce: "1s"

mqtt:
  brokers:
    - "mqtt://127.0.0.1:1883"
  topic: "codescannerd"
  client_id: "codescannerd-1"

Backend configuration

The backend needs to be configured first, see config.yaml:

mqtt:
  brokers:
    - "mqtt://127.0.0.1:1883"
  client_id: "atm-backend"

  topics: # ATM devices' topics
    - "pulseacceptord"
    - "codescannerd"

log_format: "pretty"
log_file: "log.txt"

# Mainnet or stagenet.
mode: "mainnet"

# This is the ATM fee percentage. For example 0.5 is 0.5%
fee: 0.5

# Address of MoneroPay instance. Can be remote.
# HTTPS and basic auth URL scheme is supported.
moneropay: "http://192.168.2.206:5000"

# Update the price value this often.
price_poll_frequency: "5m"

# Currency short name to display in UI.
currency_short: "EUR"

# Some message to display on the idle view
motd: "Welcome to Monero Konferenco 2023!"

# When to return to idle view after inactivity. If the user has
# inputted address and money into the ATM already, after this much
# time monero will be sent.
state_timeout: "5m"

# After a withdrawal has been completed, return to the idle view
# after this much time.
finish_timeout: "30s"

# Rate to use if fetching it online wasn't possible.
fallback_rate: 123.45

If you don't have a coin acceptor, bill acceptor or a QR code scanner you can omit these devices topics from the topics field.

Step 3 - Start it up

The MQTT broker must be started first, followed by the component daemons and at last the daemon.

If all went well, you should have a working ATM without an enclosure already!

Step 4 - Enclosure

Order 2-3 42 cm pizzas. Enjoy them. Keep the pizza boxes. Glue and cut them like this:

Front:

Back:

Need help?

Join our Matrix room: #atm:kernal.eu