VolleyVision: Volleyball Foot Fault Detection With Sensors and Raspberry Pi
by Syben Van Hoecke in Circuits > Raspberry Pi
59 Views, 0 Favorites, 0 Comments
VolleyVision: Volleyball Foot Fault Detection With Sensors and Raspberry Pi
In volleyball, a foot fault happens when the server touches or crosses the service line before hitting the ball. This can be difficult to see during a fast match, especially when the referee also has to focus on other things.
That is why I created VolleyVision: a smart volleyball foot fault detection system. The system uses sensors near the service line to detect possible foot faults during a serve. An ESP32 reads all the sensors in and sends the data to a Raspberry Pi with Bluetooth. The Raspberry Pi processes the data, stores it in a database and shows the results on a dashboard.
VolleyVision also gives direct feedback with actuators. It uses a LED strip and a speaker as visual and audible feedback. The system also uses an LCD screen that shows useful information such as the IP address of the website.
The goal of this project is not to replace the referees but to support them with extra information. It also makes foot fault detection more visible and easier to analyze afterwards.
The reason that I made this project is because I play volleyball myself and it is frustrating when the referee doesn't see big faults.
Supplies
Before I started building VolleyVision, I made a bill of materials to keep track of all components, suppliers and costs. The total estimated cost of this project is about €311.58.
- 1x Raspberry Pi 5
- 1x ESP32 dev board
- 1x SF15-600 force sensor
- 1x DFRobot SEN0413 TOF IR distance sensor
- 1x KY-038 microphone sensor
- 1x 16x2 I2C LCD display
- 1x Micro SD card
- 1x WS2812B RGB LED strip, 1 meter
- 1x 3W 8 ohm speakers
- 1x PAM8403 stereo amplifier
- 1x 16 mm pushbutton with LED, green
- 1x 16 mm pushbutton, red
- 1x Raspberry Pi 5 power supply, 5V 5A
- 1x 5V 3A power supply for LED strip
- 1x 5V 3A power supply for ESP32
- 1x USB-C connector to connect the LED strip
The LED strip is powered by a separate 5V power supply because it can draw more current than the Raspberry Pi can safely provide. The ground of the LED strip power supply and the Raspberry Pi must be connected together.
3D printing and mounting materials
For the enclosures I used 3D_printed parts. The exact amount of filament depends on the final design and print settings.
I used:
- PETG filament for stronger enclosure parts
- PLA filament for decorative parts and inlays
- screws
- heat inserts
- magnets
- glue or double-sided tape
- 16x 6x3 mm N52 magnets
Tools:
The following tools were used during this build:
- 3D printer
- soldering iron
- wire stripper
- screwdrivers
- multimeter
- heat-shrink tubing
Downloads
3D Printing the Enclosures
Before assembling the electronics, I recommend printing all the enclosure parts first. The enclosures make it easier to mount the sensors, buttons, LCD, speakers and Raspberry Pi in the correct position.
VolleyVision uses two main 3D-printed units:
- the sensor unit, this system is placed near the service line
- the control unit, this system is placed near the referee table
The sensor unit contains the ESP32 and the sensors. This unit has to be placed accurately because the sensors need to detect what happens on the service line.
The control unit has the Raspberry Pi, LCD screen, buttons and speakers with the amplifier. This unit is used to control the system and give feedback during a serve.
Recommended print settings
- Layer height: 0.2 mm
- Nozzle size: 0.4 mm
- infill: 15-25%
- Walls: 3
- No supports needed
Magnet insert
It is very important to let the printer stop right before it closes the hole for the magnets. You can set this in your slicers. Check which layer closes the holes and pause the print one layer earlier. To make sure that the magnets stay in place, use glue.
Electrical Diagrams
While everything is printing, let's go over the electrical diagrams. These diagrams show how all components are connected and will help during soldering and assembly.
I made separate diagrams for the Raspberry Pi control unit and the ESP32 sensor unit.
Here are the color wires I used:
- Red: 5V
- Orange: 3.3V
- Black: ground
Putting the LCD in the LCD Enclosure
First, insert four M3 heat inserts into the holes in the corners, as show on the picture. After that, insert the LCD screen, place the back cover on the enclosure and secure it with four M3 screws.
Inserting the LCD Module in the Raspberry Pi Enclosure
After putting in the LCD screen I recommend connecting the cables to the LCD screen to make it easier later. Then you insert the LCD module in the hole made for the LCD screen. I used double-sided tape in each corner of the LCD module to make sure it stays in place.
Hint: when you want to replace the LCD screen later you can easily remove the screws and replace the LCD
Inserting the USB-C Connector
For the next step I recommend to first solder 2 electrical wires to the V and G on the USB-C connector. These wires will later be soldered to the LED strip.
Now you can insert the USB-C connector into the hole made for it. I use glue to secure it.
Putting the Speakers in Place
For this step we are going to put the speakers in place. There are 2 holes on both sides. The speakers can rest on the beam below them. To secure the speakers I used double side tape.
It is important to place the speakers with the cables facing the front of the case.
Inserting the Buttons
Before inserting the buttons, you need to solder cables to the buttons. The buttons are connected with a 330 ohm resistor and the LED on the green button has a 470 ohm resistor. The LED on the button is indicated with a minus and plus symbol.
After that you can insert the buttons into the 2 holes.
Soldering the LED Strip and Amplifier
For the next step we are going to solder a few things. First, connect the V wire from the USB-C connector with the VCC on the LED strip. Then connect the G from the USB-C connector with the GND of the LED strip AND the GND of the Raspberry Pi.
It is very important that you connect the GND wires together.
After that we will solder the wires of the speakers to the amplifier and from the amplifier to the Raspberry Pi. Earlier we saw the electrical diagram where you can see how everything is connected.
Placing the LED Strip
After soldering the LED strip we can mount it on the top. First put the LED strip through the hole, after that you can remove the back cover to reveal the sticky side and paste the LED strip on top of the enclosure.
Be careful while putting the LED strip through the hole that you don't break the wire connections.
Placing the Raspberry Pi
Before placing the Raspberry Pi in its correct position, make sure to insert the heat inserts of M2 in the 4 corners to later secure the Raspberry Pi.
After you put in the heat inserts you can mount the Raspberry Pi and secure it with 4 x M2 screws.
Placing the Amplifier
We are almost there for the first enclosure. Between the Raspberry Pi and the wall there is a big space left for the amplifier. Place the amplifier there with double side tape.
Connecting Everything Together
Now we will be connecting all the wires to the Raspberry Pi. Here you can see the electrical diagram of the Raspberry Pi module in detail to help you connect everything.
After that, the Raspberry Pi module is done!
Inserting the TOF Sensor
Good news for anyone who hates soldering: the second enclosure does not require any soldering!
Before inserting the TOF sensor you need to insert 2 x M2 heat inserts into the holes for the sensor. After that you can mount the TOF sensor with 2 x M2 screws. These need to be a little bit longer than the other ones.
Fun fact: the reason that the TOF sensor is so far back is because the sensor has a cone-shaped field of view. To reduce this, I made a tunnel for the sensor, which makes the detection area more focused.
Inserting the Microphone Sensor
Before inserting the microphone sensor, you guessed it: it is time for another heat insert. This time it is only 1 x M4.
After that you can secure the microphone sensor in place with 1 x M4 screw.
Inserting the ESP32
First, put 4 x M3 heat inserts into the 4 holes for the ESP32. After that you can put the USB-C port of the ESP32 through the hole and secure the ESP32 in place with 4 x M3 screws.
Note: if you can't screw the first 2 holes, you can leave them open. The hole for the USB-C connector and the 2 screws at the back secure the ESP32 enough.
Connecting Everything
Now that everything is in place, you can connect the electrical wires. I used a breadboard to distribute the ground and 5V/3.3V from the ESP32. Here you can see the ESP32 electrical diagram in detail
To connect the force sensor, I recommend to first put it through the hole and then connect it in the enclosure. To secure the force sensor I used glue.
Start Up the Raspberry Pi
After connecting everything correctly, you can power on the Raspberry Pi. Then connect to the Raspberry Pi to your computer using the Ethernet cable. This allows you to make an SSH connection in Visual Studio Code with the remote controller. First install the remote controller in the extensions tab. After installing the remote controller, you will see a new icon on the left of your screen. Open that and add a new connection with the IP of your Raspberry Pi.
Clone the GitHub Repository
When you are connected to the Raspberry Pi in Visual Studio Code, clone the GitHub repository to download the project files.
Making a Venv and Installing the Requirements
Creating a venv:
Activating the venv
Installing the requirements
Configuring the Database
To configure the database I recommend following the instructions in the GitHub repository under docs/2_Configuration.md.
When you are done with the configuration of the database you can run the sql file in your database workbench. This file can be found under data/VolleyVision_db.sql in the GitHub repository.
Installing Apache and Script Autostart Raspberry Pi
For the final step, you need to install Apache. To do this, follow the instructions under docs/3_Production.md.
After you have done everything, just restart the Raspberry Pi.
Running the Code on the ESP32
To run the code on the ESP32, you will need to download the .ino file under Arduino/VolleyVision_ESP32.ino. Just download this file, open it in Arduino and upload the code to your ESP32.
Setting Up Bluetooth Connection
First, power on the ESP32 and make sure that the code is uploaded and that Bluetooth is enabled in the code.
On the Raspberry Pi, open the Bluetooth settings ore use the terminal and search for nearby Bluetooth devices. Look for the ESP32 device. In my project, the ESP32 is named:
ESP32_VolleyVision
Pair the Raspberry Pi with the ESP32. After pairing, the Raspberry Pi can connect to the ESP32 and receive sensor data.
If the Raspberry Pi does not receive data, check the following things:
- the ESP32 is powered on
- the ESP32 Bluetooth name is correct
- the Raspberry Pi is paired with the ESP32
- the ESP32 code is uploaded and running
- the ESP32 is close enough to the Raspberry Pi
Time to Play Volleyball
After completing the hardware and software setup, it is finally time to test VolleyVision.
Place the sensor unit near the service line and place the control unit near the referee table. Make sure both units are powered on and that the ESP32 is connected to the Raspberry Pi.
Start a serve from the control unit or the web dashboard. When the serve is active, the system checks the sensors near the service line.
Have fun playing volleyball!