Smart Goal
Hello, my name is James Van Weyenbergh student MCT at Howest Kortrijk. Today I will show you how to make a Smart Goal.
Descripion
The intention of this project is to make a Goal that automatically counts when you score a point. The reason I made this project is that it is for a school project and I like games and soccer so i made a soccer game.
How does it work? First you will have to go to your webstie and fill in your name, then choose one of the 3 options. In this case 5 minutes, 7 minutes or 10 minutes. In that time you have to score as many goals as possible. Once the game if finished all the data will be send to the database.
These are the components I used to make this project.
----------------------------------------------------------------
Housing
- wine box (€ 8,49): https://www.ava.be/nl
- Green fabric (€ 10,00): Local shop
- Plastic straws for the goal(€ 15,00): https://www.bol.com/nl/
Raspberry Pi:
- Raspberry Pi Model 3 B (€ 65,95): https://www.bol.com/nl/
Sensors
- FSR-406 Force Sensing Resistor 1.5" Square (€ 12,04): https://www.antratek.be/
- PIR motion sensor (€ 12,04): https://www.antratek.be/
- HC-SR04 ultrasone sensor (€ 4,78): https://www.antratek.be/
Actuators
- LCD Display (€ 26,61): https://www.antratek.be/
- ISD1820 Sound module (€ 2,70): https://www.reichelt.com/
Extras
- Jumper wires (€ 5,99): https://www.antratek.be/
- Breadboard (€ 7,20): https://www.antratek.be/
Tools used:
- Dremel multitool
- Soldering iron
- Superglue
- Drill
- Hammer
- nails & screws
Total cost: € 170,8
----------------------------------------------------------------
Schematic
As you can see it is not that difficult it's just that there are a lot of wires because of the LCD display.
Database
Above you can see a picture of the database with its relations. You can find the dump file bellow.
Downloads
Code
Below I will post a rar folder with all the code needed. Most of the code can be found in /code/backend/app.py. As you will see there is a frontend directory too, that's because i made a website that is needed to start the game. You can also see a 'history' table from the sensors and actuators. A tab where the scores are displayed is available too.
How does my code work. After you got your pi running and you're done with the electronics you will have to check some files:
- config.py: this is the file to connect to your database. I removed some things so you don't see my password.
Next step: run app.py. Then you will be able to access the website, once on the website go to 'spelen', fill out the little form and press play. Now that the website part is done you will have to press the FSR or start button to begin the game.
Building
First you can start by crafting the goal. To make the goal myself I followed a DIY video on youtube.
If you are finished with goal you can start with your wine box, begin drawing and drill/saw where you want your components.
As for the third step, Make sure your electronics are correct and start putting it inside the box. I personally taped most of my wires so I could keep them distinguished and they don't come loose. As you can see I put my electronics on a little plank so I could drill it to the bottom of the box.
Once you are finished, start testing if it still works because now you still have the chance to take it out fairly easy.
Next up. lay down the green fabric and make sure you fasten it with glue or nails, once that is done the housing should be finished.
At last remember to always keep testing in case something happens.
Outro
thank you in advance for checking this out and i hope you enjoyed making this project. If you have any remarks make sure to put them in the comments.