Build PawGuard: a DIY Smart Pet Tracker With GPS, Motion & Breathing Monitoring

by Thomas Van Haute in Circuits > Raspberry Pi

11 Views, 0 Favorites, 0 Comments

Build PawGuard: a DIY Smart Pet Tracker With GPS, Motion & Breathing Monitoring

20260616_154645.jpg

Does your dog always seem to find a way to escape when left alone? Mine certainly does. That's why I built PawGuard.


PawGuard is a device that records your pet's data (movement, breathing, and location) and keeps it for you. It also includes an alarm that will go off if your pet gets too far away, allowing you to monitor your pet with minimal effort. It's made with simple components (powerbank, GPS, MPU, PVDF sensor, LED strip, and speaker), all housed in two 3D-printed enclosures that can easily be modified.

Supplies

Electrical components:

  1. joy-it nodemcu-c
  2. MPU-6050
  3. GY-NEO6MV2
  4. LDT1-28K
  5. MCP6002
  6. 5v powerbank
  7. usb c to usb cable
  8. small speaker
  9. PAM8403
  10. lcd screen 16x2
  11. rb led strip
  12. rapberry pi 5
  13. PLA

estimated cost: €352.80 (if all components are new)


Mechanical parts:

  1. 2x 3d printed shell/housing
  2. screws


Tools:

  1. soldering iron
  2. solder
  3. wire cutters
  4. screwdriver
  5. 3d printer (or access to one)
  6. usb to usb c cable (that can send data)


Nice-to-have tools:

  1. wire stripper
  2. solder wick(for mistakes)

software:

  1. arduino
  2. visual studio code
  3. mysql (on the raspberry pi and pc)


Note:

this instructable assumes you have some experience in

  1. electronics
  2. networking
  3. soldering
  4. drilling
  5. 3D printing (can be googled)


*For a more detailed BOM, check the attached PDF.

Adding the Code on the Raspberry Pi

Now you need to connect to your Raspberry Pi and open Visual Studio Code in whichever way you prefer (via SSH or HDMI locally) and open the attached GitHub link. It will bring you to my repo and you just have to clone it and it will work.

Making the Database

Get your Pi and make sure you can connect to it via SSH. After that, go to MySQL Workbench on your laptop and add an SQL connection to your Raspberry Pi. Then just drag the SQL file from the repo into MySQL Workbench and click on the lightning icon in the top left (execute). After that, you should be all set and ready for the next step.

Adding the Code to the Esp32

Adding the Arduino code is also very easy. All you have to do is use your USB to USB-C cable that is capable of transferring data and upload the code from the attached file. The code will work, but if you know how to code, you may want to adjust some things.

Making the Shell/housing

Now here's the big one, to make the shell first you'll have to 3D print it now that shouldn't be hard as i have already attached both the files you need to this step. Just open them in your slicer and start printing.


Beware: If you use other components then the one in the bom some of the measurements might be slightly off so check them.

Making the Esp32 Box

Unfortunately, it won't be that easy this time. You'll have to make some changes. First of all, in the ESP32 box you'll have to make an extra hole for the USB port. This can be done with either a milling machine or a Dremel (rotary tool). You'll also have to add another hole for the speaker. My speaker has a wider top (about 40 mm), but a smaller body underneath, so I made a 36 mm opening after you make the opening glue the speaker in place.

Making the Raspberry Pi Box

Thankfully the raspberry pi shell/housing doesn't need many changes you just need to cut a piece off the protection plate so that your pi can stick out a little and you can plug in your ethernet.

Making Holes for the Pi

Before we make connections you will need to make some holes to be able to attach the pi and lcd screen to the shell/frame. for the lcd screen this might be a little tough but you only need 2 diagonal bolts to keep it up.

Assembling the Pi

For the Raspberry Pi connections, you will have to connect your wires from your Pi directly to your LCD screen. For this, you will need to look up a picture of the pinout on the Pi. For the specifics, just follow the attached file (you don't need a cobbler; it's added to show the pinout). You can change some of the pins, but it's not recommended since the code relies on those pins. If you do, you will need to change something in the code. Changing 5V or GND pins to other 5V or GND pins is fine, though. After this, you can attach the Pi and LCD screen to the inside of the case and run the app.py. Its LAN IP should pop up on the screen. It will be a little hard to see, though. If you don't see this, you will have to retrace some steps.

Making Holes for the Esp32

To be able to attach all components to the ESP32, you will, just like with the Pi, have to make some holes. Rest easy though, as these holes are much easier to make. After this, you can attach your GPS and MPU to the case and your breadboard, but don't attach the ESP32 yet. You will find out why in the next step.

Connecting the Esp32

Before you connect the ESP32, you will have to solder 3 wires to the LED strip and the amplifier to the speaker. This can be seen in the Fritzing schema. To connect the ESP32, you will need to have both sides of the ESP32 visible, since the pin numbers are at the top of the ESP32 and the pins are on the bottom. I recommend using a combination of wires to get the connections, but you can just follow the Fritzing schema however you like. After you're done, just put the ESP into the case pins up and the USB-C through the hole, and then you can connect the LED strip, PVDF, and speaker. Then just close the case and you're done.