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.
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.
Getting these errors. Reformatted SD card and updated libraries. Any clues?
Arduino: 1.5.6-r2 (Mac OS X), Board: “Arduino Pro or Pro Mini, ATmega328 (5V, 16 MHz)”
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp: In function ‘void spiSend(uint8_t)’:
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp:54: error: ‘SPI’ was not declared in this scope
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp: In function ‘uint8_t spiRec()’:
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp:81: error: ‘SPI’ was not declared in this scope
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp: In member function ‘uint8_t Sd2Card::init(uint8_t, uint8_t, int8_t, int8_t, int8_t)’:
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp:326: error: ‘SPI’ was not declared in this scope
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp: In member function ‘uint8_t Sd2Card::setSckRate(uint8_t)’:
/Users/pfavaro/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp:585: error: ‘SPI’ was not declared in this scope
This report would have more information with
“Show verbose output during compilation”
I was wondering if you make them and sell them? To technical for me… lol
Hi i am a 10 year old trying to complete this project for my aunt’s birthday. She is in the foreign service and lives in Tunisia with a cat that she got in Afghanistan. I’m only getting time stamps and nothing else in the $GPGGA sequence. I have left it outside overnight on a clear night and still nothing. Help?
Make sure The GPS module is on top of the stack and nothing is covering it. Also make sure you don’t have any other metal objects close by. You might also need to download the GPSBabel free software, and use it to strip out any bad data. Download it and then run the file through as input using the NMEA format, and output it to a new file with the same NMEA format. http://www.gpsbabel.org/
This software update will make it work, if you’re still interested: https://codebender.cc/sketch:60928#TinyShield_GPS_V2.ino
Hi, I am combining this with the tiny accelerometer. The GPS and the accelerometer produce the correct output and separately write to the SD card using your code. I am having trouble stitching the two codings together though. Can you advise? Thank you. (I am 50 years old).
For anyone running into an issue uploading the sketch because of the following error:
avrdude: stk500_recv(): programmer is not responding
The solution is to go into the Arduino program under Tools… Board, make sure “Arduino Pro or Pro Mini” is selected.
Then under Tools… Processor, make sure the Processor is set to
“Atmega328 (3.3V, 8MHz).
Source: http://forum.tiny-circuits.com/index.php?topic=323.0
Also, I found that I needed to include SPI.h
#include
on a different note, I can’t seem to get the data to read in Google earth. When I try to import the data, I get an error telling me that there is no data: Loaded no data.
My file looks as follows (snipped):
$GLGSV,2,1,07,70,66,289,,85,64,331,,84,59,145,,69,36,027,*64
$GLGSV,2,2,07,71,24,237,,86,13,329,,83,05,148,*53
$GNRMC,214458$GPGGA,214459.000,3251.4212,N,09641.3899,W,1,03,5.0,164.1,M,-24.0,M,,0000*6F
$GNGNS,214459.000,3251.4212,N,09641.3899,W,AN,03,5.0,164.1,-24.0,,0000*54
$GNGSA,A,2,15,29,20,,,,,,,,,,5.9,5.0,3.2*28
$GNRMC,214459.000,A,3251.4212,N,09641.3899,W,1.16,306.66,091015,,,A*63
$GPGGA,214500.000,3251.4191,N,09641.3869,W,1,03,5.0,164.0,M,-24.0,M,,0000*64
$GNGNS,214500.000,3251.4191,N,09641.3869,W,AN,03,5.0,164.0,-24.0,,0000*5F
$GNGSA,A,2,15,20,29,,,,,,,,,,5.9,5.0,3.2*28
Any thoughts?
Did you figure out this issue? I’m having the exact same issue. Lots of data generated, but nothing which will load into google earth.
Unfortunately, no. I haven’t really been able to get very far with it.
It looks to me like a challenging text parsing problem. My guesses:
– It’s comma delimited
– Fields with $ indicate the first field, so rows with two $ indicate incomplete data collection.
– The first six digits are a time stamp, probably milliseconds.
– The * field indicates an end of record.
– The data following the * is in hex
– The $ fields indicate certain satellites, only some of them will be able to give you valid data, so filter out the rest
The numbers before N and W are the numbers you want, and they can be converted to lat / long values (you can probably get decent results with a simple a + b *x transformation, but to be more accurate you’d need to know the projection assumptions)
– The Other things are probably meta data relating to altitude, signal strength, projection assumptions, and maybe some secret listening station data (jk on the listening station part).
With more data and some info about your actual locations, I could probably create a parser for you.
I suspect that you’d probably get better results if you could get results less often. I’ve had similar problems capturing very basic temperature data. Some of the records just didn’t get written completely. I never spent the time to figure it out, but I figured that it would take some electricity know-how to tune the signal with capacitors and/or resistors, or maybe better control of the SD writing process.
Any luck yet? I just got all my parts for this project and am having the same issue. I used freenmea.net to check the output, and it also says there is no data.
Actually, it just needed more time outside, under the sky. I put it on my dash board while I drove to work, and it tracked me just fine.
Same here. Its recording to GPS.TXT just fine. I change it to GMS.nmea and follow the above instruction to view it in Google Earth, but I get “Loaded no data”.
You need to get the free software GPSBabel. Download it and then run the file through as input using the NMEA format, and output it to a new file with the same NMEA format. The program will strip out the bad data and you can feed the new file into Google Earth. It worked perfectly for me. Here’s the link for the software: http://www.gpsbabel.org/
You don’t need GPS to know what your cat’s doing! It’s just doing it’s part to help curtail biodiversity http://www.bbc.com/news/science-environment-21236690
I solved the no data problem, but I can’t get it to work with the lithium ion battery. Is the combination GPS module, SD card module and the TinyDuino processor too much for the battery?
I have run into the same problem regarding the lithium-ion battery. Any chance you have found a solution?
I finally found how to make it work. You have to use these software updates: https://codebender.cc/sketch:60928#TinyShield_GPS_V2.ino
The project works fine when using the USB TinyShield for power. However, I cannot run from a Lithium-ion Polymer Battery – 3.7V 270mAh from TinyCircuits. I have the USB TinyShield and the battery both connected, which I think charges the battery when the USB cable is connected to the host PC. The USB TinyShield is used to load the sketch and run, which works fine — the GPS data is logged to the microSD and I can view the data in Coogle Earth after converting the GPS.TXT using GPSBabel as mentioned in the comments. How can I tell if the lithium-ion battery is charged? I suspect it is not. The TinyDuino processor board is from the TinyCircuit Basic Kit and has the lithium-ion connector. Does TinyCircuits have a Lithium-ion battery charger? I saw one from AdaFruit that might work. The AdaFruit charger has a LED that shows if the battery is charged. AdaFruit warned that its charger should only be used with AdaFruit’s lithium-ion battery. Anyone know if the AdaFruit charger would work with the TinyCircuits lithium-ion battery? (Comments I read under the TinyCircuits lithium-ion battery make me think it would, but I am not sure.)
I really think the project is cool. Just want to make it work with the battery.
I gave up on this some months ago. I recently went back and I found a software update. It seems to make everything work. After I finish testing it out, I might buy their GPS with the external antenna, since the original module is not very accurate. https://codebender.cc/sketch:60928#TinyShield_GPS_V2.ino
Also, it takes a long time to connect. I tried it out on a drive to the store, and it didn’t connect until I was almost there. It worked fine on the drive home though. Maybe the module with the antenna will connect faster.
I costed this up and in the UK it came to about £80. You can get off the shelf units that do the same thing with more battery life for £30. Check out G-paws. I know that ‘making’ is largely about the ‘journey’ but for me it is also because making stuff is cheaper than buying off the shelf stuff.
A massive chunk of the cost (52%) was in the GPS board. Anyone got any ideas for cheaper alternatives?
Hello, I am trying to do this project with a Wifi module instead of an SD card. I haven’t received the Arduino yet, but want to work on the code. I tried downloading the 2 files in step two, but I can’t open them. What code should I use?
Also, what data should be seen in step six?
Hello, I am making a version with a wifi board instead of sd card and a coin cell battery instead of what is shown. I have started to use Cayenne IoT. My board does not pick up on the website. Do you have any tips on what to do?
What if someone steals the cat? I need something to find my bike when they steal it.
We'll assume you're ok with this, but you can opt-out if you wish.
Our websites use cookies to improve your experience while you navigate through the Make: ecosystem. Out of these cookies, some are categorized as essential for the working of basic functionalities of our websites.
We also use third-party cookies that help us analyze and understand how you use our websites. These cookies will be stored in your browser only with your consent. You have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Your choice here will be recorded for all the Make: Community Websites.