What do outdoor cats do all day? Whose lawn are they desecrating? This project clears all that up, revealing exact locations on Google Maps. It even works with spouses and teenagers ― assuming they don’t discover they’ve been bugged with a discrete, quarter-sized component tracker.
Required materials
• TinyDuino microcontroller x 1
• GPS TinyShield x 1
• microSD Adapter TinyShield x 1
• microSD card x 1
• Lithium-ion battery with battery extension cable x 1
• Tic Tac container (or any small container) x 1
• Mounting screws x 4
• Plastic standoffs x 4
• Hobbyist knife x 1
• Collar x 1
Quick summary
A small and light battery such a lithium-ion provides the excellent balance of size, weight, and power; logging the GPS data to the SD card is power-draining, but a standard rechargeable lithium-ion will last up to six hours (a larger battery will last longer). As for the chassis, we will be using a Tic Tac container cut down to a specific size; however, anything small and discrete will work. The Tic Tac container simply provides an opening for sliding your pet’s collar through.
Lastly, we will run an Arduino sketch on the TinyDuino microcontroller to capture the data from the GPS module and record it on to a microSD card. Tiny Duino is able to run the exact sketches as an Arduino Uno, but is covertly the size of a quarter. The GPS TinyShield and microSD card shield will provide the extended functions we need. Finally, the harnessed data can be opened with Google Earth to view each location and its accompanying timestamp.
Step 1 – Assembling the electronics
Hacking the battery extension cable will permit us to easily connect and disconnect the battery. We do this by cutting the extension cable to approximately an inch, stripping ¼” off each wire, and soldering it to the TinyDuino. Solder the red wire to the “+” side of the TinyDuino and the black to the “-“side.
Next, plug the microSD TinyDuino shield into the TinyDuino board; follow this up by situating the GPS shield atop. Once both shields are in place, we will secure the boards using mounting screws. Don’t forget to insert plastic standoffs between the boards in the location of the screw holes; tweezers will make task much, much easier. Trim the excess length once all four screws are fixated.
Step 2 – Program and test
First and foremost, ensure that the microSD card is formatted before proceeding. Once this is completed, stack the USB TinyShield on top of the microSD and GPS shield mound to link the TinyDuino to your computer. Proceed to upload the TinyDuino GPS Data Logger sketch using the Arduino IDE before opening the Serial Monitor in the Arduino IDE. Look for the SoftwareSerial.h file in the Arduino SoftwareSerial Library (the library appears under ArduinolibrariesSoftwareSerial). The SoftwareSerial.h files must be slightly altered to allow a larger serial buffer to be used; this is accomplished by replacing the Software Serial library files with these.
Any error messages about writing to the card that may arise at this point indicate that the microSD was not properly formatted, so take a step backward and reformat it before attempting to rewrite the files. The LED bulb on the TinyDuino blinks anytime data is being written on to the microSD. Congratulations, you’ve created a tracking device! All that’s left is to remove the USB cable and build the enclosure to protect our board.
Step 3 – Constructing an enclosure
We’ll be using a modified Tic Tac container for the sake of attaching the TinyDuino to our animal companions’ collar, although any small container will work, particularly if the device will be inserted in the pursue of a spouse or teenage daughter.
Begin by removing the Tic Tac label using an exacto/hobbyist knife; you’ll want something with a replaceable, thin blade. Remove the top portion of the container (the white part). Measure 1 ½” inches from the bottom of the box and cut this portion free. Make two thin incisions on the width of the container ― this is where the collar slides through. Derogatory
Step 4 – Assembly time
Plug the microSD card into the microSD Adapter TinyShield and plug the fully charged lithium-ion battery into its respective slot. The LED bulb will begin flickering immediately (about once a second) specifying that the GPS data is being recorded.
Here comes to fun part: snug the electronics and battery into the white portion of the Tic Tac case, placing the TinyDuino on the left and the battery on the right. Don’t forget to move the GPS TinySheild’s antenna to the far side of the battery; it’s the small rectangular component in the upper right of the shield.
Step 5 – Strap it on the collar
Run the animal’s collar through side slits and strap it on. Fit the enclosure behind the animal’s head with the antenna pointing up for the best results. And that’s it! Set her free and rub your hands in anticipation.
Step 6 – Check out the data
Once the target has returned home, remove the tracker, unplugging the battery and microSD card. You’ll immediately notice a file titled gps.nmea sitting in the SD card once you’ve connected the card reader to your computer. If you lack an SD card reader, there’s a downloadable Arduino sketch that permits file extraction via USB instead.
There are multiple ways to view the data, but Google Earth is the common solution that is readily available. Selecting the GPS function under tools yields the “import from file,” function. Activate all the options, select the gps.nmea file, and voila! Google Earth now displays a track of where your pet, spouse, or teenager has traveled over the last couple hours with a timestamp for each location.
Project via Ken Burns @Maker
Related Products: RF and Microwave