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

Part of @smart-football-table to control a RGB LED strip
https://smart-football-table.github.io/
GNU Lesser General Public License v2.1
1 stars 1 forks source link
esp8266 java ledstrip mqtt

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:

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

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