🔌 Installer Guide

Coin Vendo Wiring & Flashing

The plug-and-play coin board — it does everything the standard board does (a coin credits the customer on the portal) plus prints a WiFi voucher code for walk-ups with no phone. Wire it, flash it, power on — it auto-connects to the BaiFi router.

Connection diagram

Signal wires from the ESP32 to each part. Power & ground detail is in the cards below.

ESP32 DevKit 21·SDA 22·SCL 17·TX2 25 5V GND 27 🖳 LCD 20×4 I²C · addr 0x27 🧾 Thermal Printer 58mm · 5V·2A own supply ⏺ PRINT button momentary · to GND 🔌 Power 5V → ESP · 12V → coin 5V·2A → printer 🪙 Coin Acceptor universal · 12V 1 pulse = ₱1 SDA→21 SCL→22 RX←17 BTN 25 SIGNAL→27 12V 5V GND 5V · 2A
Signal / GPIO I²C (LCD) 5V power 12V power GND (common)

Exact connections

Every wire, part by part. Left = ESP32 pin, right = where it goes.

🪙Coin Acceptor

Universal acceptor, set to 1 pulse = ₱1, NC mode.

  • GPIO27SIGNAL / COIN
  • 12V +12V supply +
  • GNDcommon GND

🖳LCD 20×4 (I²C)

I²C backpack, address 0x27.

  • GPIO21SDA
  • GPIO22SCL
  • 5VVCC
  • GNDGND

🧾Thermal Printer

58mm serial (TTL). Own 5V · 2A supply.

  • GPIO17printer RX
  • 5V · 2Aprinter VH / +
  • GNDcommon GND

PRINT Button

Momentary push button.

  • GPIO25button leg 1
  • GNDbutton leg 2

🔌Power

Tie all grounds together (mandatory).

  • 5VESP32 5V/VIN + LCD
  • 12Vcoin acceptor
  • 5V · 2Aprinter (separate)

Flash the firmware

Use the free NodeMCU PyFlasher app — it works for both boards. Fill it in like this:

1pick the Serial port2Browse to the .bin3Flash mode = DIO4Flash NodeMCU

For the ESP8266 board: same window — just Browse to coinslot_esp8266.bin instead (Offset stays 0x000000).

🧰What you need

  • • A USB data cable (not a charge-only one)
  • • USB driver: CH340 or CP2102 (whichever chip your board has)
  • NodeMCU PyFlasher — free, works for both boards (Windows / Mac)

🪙ESP32 board (LCD + printer)

Firmware: coinslot_esp32_lcd_MERGED.bin

  1. Open NodeMCU PyFlasher, plug the ESP32 in via USB
  2. Serial port → pick the board's COM (click Reload if empty)
  3. Browsecoinslot_esp32_lcd_MERGED.bin · Offset 0x000000
  4. Baud 115200 · Flash mode DIO · Erase yes (wipes all data)Flash NodeMCU

🔌ESP8266 board (standard)

Firmware: coinslot_esp8266.bin

  1. Open NodeMCU PyFlasher, plug the ESP8266 in via USB
  2. Serial port → pick the board's COM (click Reload if empty)
  3. Browsecoinslot_esp8266.bin · Offset 0x000000
  4. Baud 115200 · Flash mode DIO · Erase yes (wipes all data)Flash NodeMCU

When it shows Done, unplug, wire it per the diagram above, and power on — the board auto-connects to the BaiFi WiFi. No settings, no config.

Before you power on

Pinout reference

ESP32 pinWireGoes to
GPIO27signalCoin acceptor SIGNAL
GPIO25signalPRINT button → GND
GPIO17TX2Thermal printer RX
GPIO21I²C SDALCD SDA
GPIO22I²C SCLLCD SCL
5V / GNDpowerESP32, LCD, common ground

The board auto-decides per coin: a portal customer on screen → credits their session; otherwise → piles up for the PRINT button.

Standard coin board (ESP8266)

The plain BaiFi coin board (no LCD/printer) uses this fixed pinout.

ESP8266 pinGoes to
GPIO2 · D4COINSLOT IN (coin pulse)
GPIO4 · D2RELAY → acceptor 12V
GPIO15 · D8INSERT LED