Skip to content

smart-football-table/smart-football-table-ledcontrol

Repository files navigation

smart-football-table-ledcontrol

Build Status BCH compliance codecov Maintainability Known Vulnerabilities Dependabot Status GitLicense FOSSA Status

Java program that receives events via MQTT and displays scenes using a TPM2 device (connected via serial link) which controls a connected LED strip. The program writes TPM2 frames to the serial link which will then be interpreted by a TPM2 device. The TPM2 device can be a simple µController like an Arduino or an ESP8266. However, the Arduino seems to be not fast enough to manage the amount of data sent since it is very limited both in processing speed and the size of the serial buffer.

Scenes visualized using the strip:

  • Goals: Whole strip blinks in the goal getting team's color
  • Fouls: Whole strip blinks yellow
  • Score: The score of both teams in visualized during the game
  • Game over: Whole strip blinks in the winning team's color
  • Idle: Plays some animation if noone is playing

The strip can also be used to lighten the football table.

  • Foreground color: No matter what else should be displayed, only the foreground color is shown. This can be used to have the brightest possible light on the table by selecting white as color (#FFFFFF) or any other RGB color
  • Background color: All not active (black) leds can be turned on, also any RGB color is supported

Docker

You can either run docker in privileged mode (--privileged) or pass in the device(s) available in the container docker run --rm --device=/dev/ttyUSB4:/dev/ttyUSB0 -e LEDS=72 -e TTY=/dev/ttyUSB0 -e MQTTHOST=mqtt -e MQTTPORT=1883 ledcontrol Because the device numbers depends on the order the devices are connected you should use static links. You can add your own udev rule or just use the already existing link: docker run --rm --device=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0:/dev/ttyUSB0 -e LEDS=72 -e TTY=/dev/ttyUSB0 -e MQTTHOST=mqtt -e MQTTPORT=1883 ledcontrol

Score LED strip showing score

See below for building your own TPM2 device. You can find the sketch to upload in this repo.

PCB top PCB bottom
LED controller module using an ESP8266, top and bottom layout view

Soldered The soldered PCB

Case Showing the ESP8266 module inside a hand crafted case (used to be a RasPi case)

Part list

Beside the RGB LED strip (WS2812B), the three wire (white/green/red) connection cable (JST) and a micro USB cable we used the following parts to build the TPM2 device.

Amount Description Price (china)
1 Resistor 470Ω 0,10€
1 Capacitor 1,0mF 0,50€
1 WeMos D1 mini (ESP8266) 2,00€
1 5V Power supply 6A/30W
(One RBG LED drains upto 60mA)
8,00€
1 PCB mount power socket connector
(matching power supply connector)
0,05€
1 PCB 15"x15" <1€
(2) (Optional) 8 pins single row female pin header 0,10€

License

FOSSA Status