POOCHPAK: A SMART DOG WEARABLE

A smart dog wearable for object recognition using YOLO, reading biometric data, and sending SMS notifications.

MM

Connecting with your dog

We were waklking our beloved dog Sweetpea one afternoon and became curious about the dog experience. What was her experience like on that day? Was she happy or scared? Were there things she wanted to communicate to us that she couldnt? Wanting to understand our pet in a deeper way, we wanted to create a dog wearable for her that would track her biometrics and attach a camera to get a sense of her world view. This platform could be extended to various use cases such as

  • Connecting your pet to home security systems using onboard object recognition: security cameras are stationary. Your dog can patrol any area of your home and alert you of any shinanigans.
  • Accessing your dogs location at any time from your phone using Hologram Nova: dogs get microchipped but you would need someone to find your dog and scan them if they ever got lost. With this vest, you could quickly get coordinates on your dogs location from your cellphone at any time.
  • Search and rescue dog: Dogs are able to navigate spaces that humans cannot access. For example, having this YOLO object recognition camera on a search and rescue dog trying to find people stuck in rubble after an earthquake could potentially save lives.
  • Obtaining vitals and receiving alerts: has something gone wrong with your pet? Having biometric data could facilitate diagnosing your fuzzy companion.
With these ideas in mind, we went on to create PoochPak!

Hardware

Here is the hardware we used for this project. We also had plenty of wire, solder, solder iron, and a pcb board to slap this all together.

Software

Here is the software we'll be working with. Most of these will be installed using the repo we have built up.

Assembly

Wiring it all together is not too complicated. For all sensors connected via the GPIO pins, we will power them with the 3.3v pin which is pin 1. Pin 6 will be our ground pin. The trickiest part of this is to arrange all the wires on a pcb board neatly. We have the pi camera connected via the ribbon at the rightmost side of the pi. Depending whether you used a pi zero or a pi 2/3, you'll want to connect the hologram nova via the usb ports provided or using a microusb-to-usb cable.

Installation

Compatibility between project dependencies requires python3.4 as default python3. You should burn this specific image for your raspberry pi zero. After making this image and wiring the pi, boot up and go through the first-time boot configuration. Run sudo raspi-config and configure the following:

  • Under Advanced Options, Expand filesystem
  • Under Localization Options change timezone
  • Change User password
  • Under Interfacing Options, enable ssh, camera, SPI, IC2, and Serial
After a reboot, git clone our repo

cd ~/
git clone https://github.com/mayorquinmachines/PoochPak.git
cd PoochPak

Then run the install script provided in the repo. This will take a really long time! Since we're installing numpy and scipy for Tensorflow and OpenCV and since pis have pretty minimal computing power, this will take a while to compile and install. You should run this script overnight.

After you've woken up the next morning, give your pi a quick reboot and then run:


sudo modprobe bcm2835-v4l2
sudo modprobe w1-gpio
sudo modprobe w1-therm

This will ensure that all modules needed for the sensors are enabled and ready to use. The Hologram sdk and cli were installed in the script run earlier. You'll want to go to here and follow the instructions to set up your Hologram account and dashboard. After you've set up your dashboard you'll want to do the following. In your Dashboard, click on your device and navigate to Configuration. From that page, you'll want to configure your phone number under Configure phone number. This should set up you Nova to send SMS messages to this phone number. In this same page, you'll see + Show Device Key. Clicking on this button will give you a key you'll need to authenticate your hologram-python-sdk. You'll want to create a config file where you'll place this key for use. Run the following:

cd ~/PoochPak
touch config.py
echo "DEVICEKEY=''" >> config.py

To run the code, you'll want to start up two scripts:

Start up YOLO object recognition server


cd yolo_picam/
nohup sudo python3 picam.py &

Start up sensor server


nohup sudo python poochpak_server.py &

If you navigate to your local ip on your pi using your browser, ie http://:8925, you'll receive all the data being sent from the vest sensors and GPS location. Then if you go to http://, you'll be able to download all the videos where a person was detected. You should receive a text message to the phone you configured in your Hologram account notifying you that a person has been detected!

TroubleShooting

If you're having issues with the Yolo object recognitition script (picam.py) not finding the camera, it could be that you need to reenable the camera again. Try enabling it again using sudo raspi-config and run sudo modprobe bcm2835-v4l2 .

Sometimes the Hologram Nova loses signal. You should make sure that the red LED is lit up and the blue LED is flashing. Rapid flashing means you're on the 3G network, slower flashing means 2G network, and no blue light means the Nova isn't on a network yet.

If the sensors aren't working correctly, take a look at the wiring again and make sure everything is correct. Then try reenabling their modules again:


sudo modprobe w1-gpio      #For temp sensor
sudo modprobe w1-therm     #For temp sensor
sudo modprobe spi-bcm2708  #For pulse sensor

There are also a script you can run to test all of the sensors. Try running

python ~/PoochPak/tests/run_tests.py