in Development, DIY, Javascript

Foosball Scoreboard using node and Johnny-Five

 

We are quite competitive when it comes to foosball at the office, we try to mentally keep track of scores and wins over a few weeks span but that never works out. We wanted a method of tracking points that din’t involve us writing it down.

This is when we came up with the idea of building a mobile website that we would use on our phones to track game scores and stats.

Being an amateur hardware hacker, I decided to take it a step further and automate the scoring with an Arduino (To be replaced with a raspberry pi on final version) to send and receive information from the table to web page scoreboard, I used the Socket.IO library and Johnny-five library. It allowed me to capture events from the Arduino sensors mounted on the table and send them in real time to the scoreboard and also form the scoreboard back to the Arduino.

Communication

Server to Arduino communication

Using the Johnny-Five library, when the ball goes down the goals it brakes the laser and triggers a switch that lets the server know that a point was scored.

Server/Client communication

We are using socket.io to send information from the server in real time to the scoreboard web page.

 

Counting points

Counting PointsTo count the point a pair of lasers and photo resistors wired to an Arduino where used as buttons to trigger a function in my application to add points for each team. When the ball cuts the laser it interrupts a switch and Johnny-five on the server records the change of state and triggers a goal!

 

 

The project is still ongoing but currently on hold as other priorities have taken over but work on this should resume shortly.