3 weeks ago

Table Foosball – interactive score board

If football is a results business, it should be easy to keep score. With Matmi’s Pi-driven scoreboard for table football, you can do just that

Football is a funny old game, so they say, but table football – or foosball as Americans call it – is much quirkier. Popular for many decades (its origins stretch back to 1921), it involves moving up to eight rows of footballers on rotating and sliding bars in the hope of passing the ball from player to player and smashing home more goals than the opponent.

This article first appeared in The MagPi 74 and was written by David Crookes

The bods at Matmi understand it well. When they’re not busy working on digital projects for the likes of indie band Gorillaz, singer Lily Allen, actor Warwick Davies, the BBC, Alton Towers, United Airlines, Comic Relief, and more, they gather around their own foosball table in the office and have some fun.

Trouble is, they get so involved, they often forget the score, and those who are watching struggle to keep up with the action. To solve this, they turned to the Raspberry Pi 3B+. “We decided to reimagine our foosball table as a technologically enhanced experience, creating competition and adding scoreboards,” says Matmi founder Jeff Coghlan.

The idea was to create a Red vs Blue Table Foosball companion app which lets players enter their names and track their scores in real-time. Initially, the team worked on sketches and analysed the table to work out the best way to detect goals. They quickly identified most of the required hardware and ordered a Pi, a Class 10 microSD card, a USB microSD interface, a 2.5 A power supply, some microswitches, and lots of wires.

“The Raspberry Pi 3B+ fit the requirements perfectly,” Jeff says. “Not only is it a GPIO-capable single-board computer, but when using a Raspbian desktop and Visual Studio Code, it is also a fully capable development suite, making the development process that much faster and more convenient.”

The team says using the Vue.js open-source JavaScript framework made the process of creating the app easier due to the abundance of examples on Stack Overflow

Goal-line technology

The physical side of the project was also completed quickly, with sensors placed within the foosball table’s pipes to update the scores whenever the ball rolls past. “We examined various options for goal sensing and ultimately decided to use microswitches with paddles to detect the goal as the ball drops down,” Jeff explains. “Gravity forces the paddle out of the way, triggering the microswitch and this simple approach works perfectly. It allowed us to quickly move on from the physical and get stuck into the presentation.”

Will Booth, who started in the Matmi internship program, began by setting up the Pi to read the sensor inputs and print them to a score log. A laptop was then connected to the Pi via a WiFi network, allowing the data to be presented on the Pi’s HTTP server. “The built-in wireless adapter and Raspbian OS made configuring the network easy and it also fit in with our end vision of preserving the vintage feel through minimal wiring,” says Will, who also designed the scoreboard’s graphics using Paint.net.

The result is a table which lets the players and spectators follow the action, but the team is keen to go further. “For now we are working on a top-down camera for goal replays and an evolution of the GUI,” says Jeff. “We will present it again when we have taken it to the next level.”