Zwaardgame

by TjörvenBuyse in Circuits > Raspberry Pi

106 Views, 1 Favorites, 0 Comments

Zwaardgame

Knipsel.PNG
1218741.png

Description:

In my first year of MCT at Howest Kortrijk I was tasked with making a project 'Project One'. The porpose of this project is to combine all the things your learned that year and apply them in a real world example.

After delivering 3 possible project I thought would be good for this project the teachers recommended this because it was doable an filled al the requirements of the assignment.

So Zwaardgame came out,

It's a sword that tracks it's location, enabling you to play a game on it where you need to hold it as steady as posibble. If you hold it right it also reads the moisture level of your hands wich gives you insight in how stressed you are while playing.

So the purpose of the project is to have fun and demonstrate the possibilities. More games can ofcourse be added.

Supplies

COMPONENTS:

- Raspberry Pi 4 model b

- T-cobbler

- MPU6050

- MCP3008

-ME110 (moisture sensor)

-LCD screen

-Capacitive touch button

Fritzing Schema

breadbord.PNG
schema.PNG

In the pictures you can see the connections for the project.

the breadbord view is what I build at this point to test everything and read the sensors.

I later removed the T-coppler and directly connected to the Pi

Normalized Database

database.png

This is the database tructure used.

I used Mysql Workbench to make the database.

To get this database yourself you can rectreate this ERD in Workbench and then forward engineer it to get the database and create a dump file to place in your visual studio project.

Code Verwijzen Naar Code Op GITHUB of Archive File

Installing python packages

Before you can run anything, you need to install the following packages first.

- pip3 install mysql-connector-python

- pip3 install flask-socketio

- pip3 install flask-cors

-pip3 install

Enabeling interfaces

command: "sudo raspi config"

enable:

- i2C

-SPI

Coding

All code was writting in visual studio code. You can find the source code below:

github

To read the MPU I used a library, but it's included in the source code so it shouldn't be a problem.




The Housing

20220829_102627(1).jpg
20220829_102034.jpg

The housing works but can certainly be improved upon.


I designed a very simple sword in 3d and then split it up so it was printable.

To then get the pieces back together I used holes on but side ant small cilinders with glue to hold the parts together and give some structure to it. All files are provided below, note that they are designed in 1/2 of the real size.


For some parts I had to reinforce the bond with simple rectangles of printed plastic and glue.

loaded up the sword is quite heavy and will break when not handled with care.