/foosball-counter

A foosball counter developed using micropython and nodemmcu V3 CH340

Primary LanguagePythonMIT LicenseMIT

Foosball Counter

  1. A foosball counter developed using mycropython, IR sensors and nodemmcu V3 CH340
  2. Angular 8 for the scoreboard
  3. Mosquitto MQTT server

Materials

  1. Nodemmcu V3 Ch340 https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/

  2. Two IR sensors KY032

KY032
  1. 5 x push buttons ( 2 x Manual increase / 2 x Manual decrease / 1 x Reset)
Buttons
  1. Wires to make the connection based on the pinout configured in the boot.py
Wires

Python Files

  1. boot.py - Boot configurations (Pinout, Wifi information, MQTT Serve configuration)
  2. button.py - Increase/Decrease/ Reset button configurations
  3. connection.py - Connection/ Subscribe/Publish management
  4. counter.py - Counter class object used for managing information for each team.
  5. main.py - Main file
  6. message.py - Check message status to send to MQTT Server
  7. sensor.py - IR Sensor management
  8. umqttsimple.py - MQTT library used to make easier the communication with the MQTT server - https://github.com/RuiSantosdotme/ESP-MicroPython/blob/master/code/MQTT/umqttsimple.py

Docker files

  1. Dockerfile - Build the Angular application to show the game score. Angular App Screenshot
  2. docker-compose.yml - Setup two containers (Mosquitto MQTT Server and the Angular application)

Mosquitto configuration file

  1. mosquitto.conf - Configuration file allowing websocket (because of the Angular application) and MQTT protocol.