Trackpack: Backpack With Turn Signals, Automatic Backlights and Routetracking to Go on a Walk With Your Horse

by Kato Borms in Circuits > Raspberry Pi

845 Views, 3 Favorites, 0 Comments

Trackpack: Backpack With Turn Signals, Automatic Backlights and Routetracking to Go on a Walk With Your Horse

301210195_540505511162666_7017791955229634317_n_preview_rev_1.png

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

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

Untitled Sketch 2_schema.jpg
Untitled Sketch 2_bb.jpg
301151345_546566743889850_1220616934635380555_n.jpg

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

Picture8.png
Picture7.png
Picture6.png
Picture5.png
Picture4.png
Picture3.png

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

Picture12.png
Picture9.png
Picture10.png
Picture11.png

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!

301183603_749519793003700_2345695031439596571_n.jpg
301533344_1047494775969980_188128049244957453_n.jpg

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

302159292_322475386712885_553847624149329835_n_preview_rev_1.png

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.