Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

WithTracker1

If you have an outdoor cat or dog, you’ve probably wondered where it goes during the day. Do they just hang around outside the house, or do they go on long adventures exploring the neighborhood? To snoop on my cat Conley, I made a GPS cat-tracking collar that would log his location during the day, then let me download the data to a computer when he gets back home.

At the core of this collar is a TinyDuino microcontroller and a few of the expansion TinyShields that are available for this platform. The TinyDuino works just like the Arduino Uno and can run the exact same sketches, yet it’s only the size of a quarter. You can easily add capabilities just by plugging TinyShields into it — I used the GPS TinyShield to get the position data and the microSD Card TinyShield to log the data.

GPS_Cat_Tracker_Wiring_Diagram

To power the system, you need a small and light battery with the capacity to run the system long enough to get useful data. The GPS and SD card writes are fairly power-hungry, so I use a small lithium-ion rechargeable battery that provides up to 6 hours of logging capability. A larger battery can also be used to get much longer logging times.

To make the electronics box for the collar, I used a Tic Tac container cut down to the exact size, with a small slot cut in it to let the cat collar slide through. This lets the GPS module sit on the back of Conley’s neck during his adventures strolling around, and provides the best GPS antenna reception.

The software used to program the system is very simple: an Arduino sketch runs on the TinyDuino, which captures the raw data from the GPS module and writes it to a text file on the microSD card. Pop out the microSD, put it in your computer, and you can open up the file in a program like Google Earth and see exactly where your cat was during the day, complete with timestamps.

Steps

Step #1: Assemble the electronics.

PrevNext
GPS Cat TrackerGPS Cat TrackerGPS Cat TrackerGPS Cat Tracker
  • To make it easy to connect and disconnect the battery, we'll hack a battery extension cable and solder it into the TinyDuino. Cut the extension cable to be about 1" long, with the female version of the connector left on it, and strip about 1/4" off each wire.
  • Solder the red wire of this cable to the “+” hole on the TinyDuino, and solder the black wire to the “–“ hole. Use the wire cutters to cut off any excess wire poking out through the holes.
  • Plug the microSD TinyShield into the TinyDuino. Then plug the GPS TinyShield on top of the microSD TinyShield.
  • Secure the boards together using the mounting screws: place the plastic standoffs between the boards where the screw holes are (tweezers are useful), then put the screws through the holes. Then finger-tighten the nuts onto the screws. You can then also trim the end of the screws since they will stick out a bit.

Step #2: Program and test the electronics.

PrevNext
GPS Cat Tracker
  • Use your computer to format the microSD card if not yet formatted. Slide the microSD card into the TinyShield microSD adapter.
  • Plug the USB TinyShield from the kit into the top of the stack of boards (on top of the GPS TinyShield). Connect the USB TinyShield to your computer using the USB cable.
  • Upload the TinyDuino GPS Data Logger sketch to the TinyDuino using the Arduino IDE. Then open the Serial Monitor in the Arduino IDE, and you should see a lot of data and weird text start appearing. This is data from the GPS module (in NMEA format) appearing in the window. In the Arduino SoftwareSerial Library (under ArduinolibrariesSoftwareSerial) the SoftwareSerial.h file needs a minor change to allow a larger serial buffer to be used. Replace the Software Serial library files with the ones in this zip file.
  • If you see any messages about problems writing to the SD card, check that it’s installed and formatted properly. The LED on the TinyDuino processor will also be flickering whenever it writes to the SD card, about once per second.
  • Unplug the USB cable from the USB TinyShield. Unplug the USB TinyShield from the top of the stack of boards (it doesn't need to be attached except when you need to connect to your computer).

Step #3: Build the enclosure.

PrevNext
GPS Cat TrackerGPS Cat TrackerGPS Cat TrackerGPS Cat Tracker
  • Empty out your standard-sized box of Tic Tacs. Then use a small hobby knife to cut away the label to free the top white lid, and lift it off.
  • Now cut the box down to the right size: measure 1-1/2" from the bottom of the box, and cut all around the box using the hobby knife.
  • Cut small slots on the sides of the enclosure near the walls so you can feed the collar through, then feed in the collar through both of this slots.

Step #4: Put it all together.

PrevNext
GPS Cat TrackerGPS Cat TrackerGPS Cat Tracker
  • Make sure the battery is fully charged using the lithium-ion charger. Then plug the microSD card into the microSD Adapter TinyShield.
  • Plug the battery into the system. The LED on the TinyDuino processor board should start flickering about every one second (this indicates that the GPS data being written to the microSD card).
  • Fit the electronics and battery into the Tic Tac case and put on the lid — the TinyDuino boards will sit side by side with the battery. The small rectangular component in the upper right of the GPS TinyShield is the antenna; put this on the far side of the battery.

Step #5: Put the collar on kitty!

PrevNext
GPS Cat Tracker

For best results, the enclosure should be on the back of the cat’s neck and the GPS antenna should be pointing up. Also try to keep anything metal away from the antenna, as this will impact the GPS reception. Let kitty roam around for the day, and when he gets back, it’s time to see where he went.

Step #6: View the data.

PrevNext
GPS Cat Tracker
  • When kitty comes back, take the collar off, unplug the battery, and unplug the microSD card. Place the microSD card into your computer, and there should be a file called gps.nmea on it.
  • NOTE: If you don't have a SD card reader on your computer, you can also download an Arduino sketch that will let you retrieve the file over the USB port.
  • There are a number of programs that can read the .nmea file — a great one that is free is Google Earth. To use, open Google Earth on your computer, and select Tools —>GPS. Under the Device, select “Import from File.” Under the import and output sections, make sure all options are selected. Click on Import and select the gps.nmea file. Google Earth will then display the data as a "track," which lets you see where kitty went during the day, along with timestamps.
Ken Burns

Ken Burns

Ken Burns is an engineer, programmer, and longtime electronics hobbyist living in Akron, Ohio. He is the founder and president of TinyCircuits, which develops miniature open source electronic circuits.


blog comments powered by Disqus

Featured Products from the MakerShed

Follow

Get every new post delivered to your Inbox.

Join 25,547 other followers