Trackpack: Backpack With Turn Signals, Automatic Backlights and Routetracking to Go on a Walk With Your Horse
by Kato Borms in Circuits > Raspberry Pi
896 Views, 3 Favorites, 0 Comments
Trackpack: Backpack With Turn Signals, Automatic Backlights and Routetracking to Go on a Walk With Your Horse
For my Project One at MCT, Howest Kortrijk, I will make a backpack with turnsignals, automatic backlights and route tracking specific for horseriding. On my website you will be able to start a route, keep track of all your previous routes and manage your horses.
This is a project which contains Python, Javascript, HTML, CSS and the database is kept in MySQL. You need a bit of experience to work with this. The code is in the last step. I will explain some code so you can understand how it works. I hope you enjoy my project en maybe even try to build it!
Supplies
- Raspberry Pi 4B 2GB
- LDR
- Buttons
- Leds
- LCD 1602 with I2C
- SPI MCP3008
- NEO-8M GPS Module with battery
- Backpack
- Lots of wires
- Resistors
- MPU6050
Downloads
Getting Things Ready
To start I will install some programs, those will help us in the project.
The following programs should be installed on the Pi:
- MariaDB
- Apache2
- Python3
- Chromium
Now we can enable SSH if not enabled yet. If it is enabled we can open Visual Studio Code and connect with remote control. Set up or use your WLAN IP, if you are connected to wifi you can use that too.
I worked with a Githubrepo for my school, so you can choose whether you clone a repository or not.
Fritzing and Electric Scheme
Then it's important to make a fritzing scheme so you can keep track of all your wires. With the scheme you can also check which pins you are using.
I listed up all my components and see how the data should be read or send. For instance, the ldr has an analog input, the Raspberry Pi can't read analog values compared to an Arduino. So we will use an SPI to read this.
The GPS-module works with UART, so it's also very important to enable UART in the settings of your Pi.
Set Up the Database
In the next step i will set up the database. This database is important for storing all of our sensordata, horses and the previous routes.
I made 5 tables: Actions, Device, History, Horses and Routehistory.
In the backend Datarepository, i will get the info out of the database or write new data to the database.
In python we need to make a config file which connects our MariaDB to our database. In the backend Datarepository, i will get the info out of the database or write new data to the database.
Write the Code for Frontend and Backend
Here you can find a link to my GitHub with al my code.
In the backend I write the functions for my LCD, MPU6050, LDR, Turn signals, start and stop a route...
In the frontend you will find the HTML and CSS for the visuals of my website and JavaScript for the frontend functions. In my JavaScript i give the buttons on the website functions.
Here you can find my GitHub repository: https://github.com/howest-mct/2021-2022-projectone-BormsKato
Connect and Build!
The last step is to solder everything together. Personally this was my least favorite thing to do because it takes a lot of time. So if you want to build this project, make sure you have enough time!
I soldered everything on print PCB's but if you want a cleaner version i suggest you make a presoldered PCB online. I sewed the lcd in the backpack.
If everything is soldered i always check with a multimeter to see if there are no short circuits.
The End Result
Here you can see the end result in the dark. The LCD shows the IP-address but you can't see it on the photo.