The (WIP) ESP32 Pinball Coin Meter connects an ESP32 microcontroller to a pinball machine's coin meter (usually inside the coin door) to detect coin drops and send real-time notifications to your smartphone via Firebase Cloud Messaging (FCM). A mobile companion app for configuring the ESP32 and tracking dollars earned per game will be available.
- 1x ESP32 microcontroller
- 1x 5v power supply
- 4x 220 Ohm resistor
- 2x 10k Ohm resistor
- 2x 1N5817 Schottky diodes
- 1x PC817 optocoupler
- 1x RGB LED
- 1x momentary push button (standard switch button)
Connect 1N5817 diode between pin 1 and 2 on PC817:
- Cathode (banded side) to pin 1, anode to pin 2
Connect the coin meter molex connector:
- Pin 1 ground (usually WHT) -> PC817 cathode (pin 2)
- Pin 3 strobe (usually GRY/RED) -> 220 Ohm resistor -> PC817 anode (pin 1)
Connect ESP32 side:
- PC817 emitter (pin 3) -> (anode) 1N5817 (cathode) -> 10k Ohm resistor -> ESP32 GPIO
- PC817 collector (pin 4) -> ESP32 GND
- Connect RGB LED and button to any available GPIO pins with appropriate resistors.
The RGB LED provides visual feedback on system status. Persistent states use solid or slow blinks, while transient events use quick flashes.
- Blink Red: Error state, no wifi credentials or connection failed (NO_WIFI)
- Blink White: Error state, no Firebase token stored (NO_TOKEN)
- Blink Blue: Error state, no game stored (NO_GAME)
- Solid Red: Mobile app/ wifi AP connected (WIFI_AP_CONNECTED)
- Solid Green: Normal operation, connected to wifi and Firebase (READY)
- Flash Yellow: Mobile app/ wifi credentials saved (WIFI_SAVED)
- Flash Cyan: Mobile app/ FCM token saved (TOKEN_SAVED)
- Flash Magenta: Mobile app/ game name saved (GAME_SAVED) or coin drop detected (COIN_IN)
To reset the device, clearing configuration and stored data:
- Disconnect power
- Press and hold the momentary push button
- Reconnect power
- Continue holding the button until the LED turns solid red
- Release the button
- Configure the device again via the mobile app