This is the story about how Making Waves Polska developed a system that makes it easy for the employees to see if the revered foosball table is free to use. The solution saves over 40 enthusiastic players time every day, by confirming online if it is time for a foosball game.
The idea behind the project
Like many other technology companies, Making Waves offers its employees the chance of spending a few minutes on a fun activity during their short breaks throughout the day. At the moment, there are two options: the FIFA 2014 Xbox videogame and a foosball table (better known at Making Waves by its Polish word piłkarzyki).
The FIFA videogame has gained popularity recently, but the foosball table remains the most common break option. There is no doubt that this active, entertaining game has a positive influence on the participants’ creativity and work performance. Spending just a few minutes away from your desk is clearly enough to provide inspiration for and insights into work challenges.
Making Waves Polska currently has around 85 employees, more than half of which play foosball during their breaks on a daily basis. The only foosball table, located in the basement, is frequently occupied and it was impossible to know whether it was free, forcing players to waste time trying to find out whether the table was available.
A team of three Making Waves employees – Bogdan Juszczak, Senior Systems Consultant, Paweł Bród, Front-end Developer and myself, Systems Consultant – decided to find a solution, and at the same time turn the idea into a research and development project.
Our main goal was to develop a system that would allow employees to check the current status of the foosball table online. As it is customary to play three games of up to five goals in each session, we also wanted the users to be able to check the live score and estimate when the table will be available.
How we did it
We built two systems that detect whether the table is free. The first one is a motion sensor placed under the table that checks if somebody moves around the table. The sensor has a limited angle of only 100 degrees so it only detects movement by players rather than anyone who happens to walk past near the table.
The second system (image below) is based on ultrasonic sensors located in both sides of the balls’ reception area. When a team scores a goal, the ball slides down a ramp and passes in front of the sensors, which triggers a signal that is sent to our system. One of the limitations of the sensors is that sometimes a signal is generated by dust, which is interpreted as a goal.
The core of the whole system is the so-called Raspberry Pi (Rpi), a credit card-sized single-board computer with a 700 MHz ARM processor and 512 MB of RAM memory. It also contains two USB audio, HDMI, Audio, Ethernet and SD card slot. Without digging into the details, this little computer can be used in electronics’ projects like this one or for other things on desktop PC (games, movies etc.). In our case Raspberry Pi is responsible for collecting and processing the data retrieved from Arduino Uno and presenting information about the foosball table status on a website.
Arduino is a microcontroller board with complementary components that facilitate programming and incorporation into other circuits. In our project it collects information from the sensors and sends it to the RPi using a serial port. A simplified schema of Arduino and the sensor circuit is shown below.
The web server at RPi is based on the node.js HTTP server with the web application framework Expressjs, providing a robust set of features for building web apps. We also use SocketIO to deliver real-time table status changes in web browsers and mobile devices without delay. A screenshot of our simple website is presented below.
We have a lot of ideas on how to develop the system further.
Due to the issue mentioned above with dust in the ball reception box, we are planning to replace the sensors with a laser source and a photoresistor. The laser light will point into the photoresistor and if something crosses it, a signal will be sent indicating that a goal was scored. The laser light is very strong and would not be interrupted by dust. It will be quite easy to build the system, which only requires the laser source and a receiver to bet set up across the path of the ball.
We would also like to create a display with the live score next to the table in the cantina, and perhaps a light signal in the rooms where employees are working, so that they do not need to check the status of the table online. With a standard monitor connected to the output of the microprocessor, we could retrieve the score from the website. Alternatively, we could create a program to show the score directly on the screen, but that would be more of challenge.
In addition, it would be handy to have some kind of rocket launch button for advance bookings. Some of the keenest players have also expressed a wish for a buffer that could be set to two minutes before the booked time of a match, so that there is plenty of time to go to the foosball table before their reservation expires.
Yet another feature would be a standard USB web camera to record video and take pictures when something moves inside the table. A webcam would enable us to check the image directly and the motion sensors would only be needed to update the score. This would be very easy to implement by plugging a video camera to the Raspberry Pi and installing the relevant software. As an anecdote I can tell you that I once implemented a similar solution in my own home, using both sensors and a webcam, to be able to know if someone is inside the house at any given moment.
Last but not least, we are also thinking about setting up a solution that will switch on the lights over the foosball table automatically when someone is playing.
All in all, it was a huge pleasure and a lot of fun to work on this project along with my colleagues Paweł and Bogdan. It was like enjoying one of my hobbies and time flew by very quickly while I was busy with it. This project also allowed the three of us to share our knowledge and skills to come up with the best solution. Working on internal R&D projects at Making Waves is a wonderful and fruitful experience, which allows consultants to gain insights that can be used in other projects.