Public Lab Wiki documentation



GPS tracking device

This is a revision from November 05, 2014 05:34. View all revisions
1 | 13 | | #11171

 I am one of the students of the Public Laboratory for Science class at Umass Amherst in collaboration with the five colleges. The project that I am working on is  a GPS device set on an animal collar using cheap technology and open source software to track animals. It should be capable of being used whether for tracking domestic animals ( dogs) or wild animals. 

 The tracking device will be based on a TinyDuino. For data logging, i will need a **micro SD TinyShield** and **micro sd card **  to get data from GPS TinyShield that is going to be programmed through the Arduino ( there is a TinyDuino GPS Data Logger sketch that should be uploaded to the TinyDuino using the Arduino IDE ). The sketch is going to be adjusted, the Software Serial library files should be replaced. A maker that created a GPS collar for their cat shared the code for doing that on http://makezine.com/projects/make-37/gps-cat-tracker-2/

 If used for a domestic animal ( that we know is coming back home) the tracking data could be logged and stored in a micro SD card and then viewed on an application in the computer like Google earth. But for wild animals tracking, the data should be accessed simultaneously through the internet, and that is one of the main improvements that i want to add to this device. A **Tinyduino** cannot handle an internet connection, so i will have to add the **Arduino Ethernet Shield** that allows an Arduino board to connect to the internet. 

  One of the main challenges of this project is to keep the device as light as possible so it could be handled by smaller animals. So to power the system, i need a small and light battery that can run the system long enough. A small rechargeable lithium ion battery can give me up to 6 hours of logging. This could be enough for domestic animals tracking.  To study the movement of wild animals we might want logging that can go for weeks. So i though that a solar powered device could be the best idea for a self rechargeable device, but this would be the solution only and particularly for animals of medium size that live in deserted/warm areas.  

 I thought about battery saving by turning off GPS logging when the animal is immobile. I will have to search on how to program the Arduino to stop the data logging after a set period of time that returns the same location. 

I found this great experiment by this guy called Nick ( http://www.gammon.com.au/forum/?id=11497  ) that found the best way to significantly lower battery use by the Arduino using a **"bare bones" board** and programming the Arduino on different sleep modes. I will have to study his conclusions more closely!

The tracking device should be waterproof. The best way to make a perfect sized waterproof container is to use a 3d printer. And a PVC Polyester collar would be the cheapest waterproof material that could be used. 

I have a list of the parts that i need to make the device:

** __- TinyDuino Basic Kit item ( #ASK1001-R-P1from tiny-circuits.com ) : It includes the TinyDuino processor board, TinyShield USB programmer board, protoboard, and mounting screws. _ - Adafruit shield that is a two in one GPS/MicroSd shield http://www.adafruit.com/products/1272  

  • Arduino Ethernet Shield Rev3 WITHOUT PoE Module__

  • Battery, lithium ion polymer, 3.7V, 150mAh ( + Lithium ion battery charger)

  • JST-PH battery extension cable_**

    I decided to divide the making process through stages. In which each stage will address one of the feature that i want in the tracking device. This way i can measure my progress progressively instead of using all the parts at once and end up with multiple problems at different levels that would be much harder to address. Therefore, I am going to make the GPS through 3 main stages.

Stage1 : make a GPS tracker (using an Arduino Uno and the Adafruit ultimate GPS shield) So this GPS won't have internet access yet, and will only log the data on a micro SD card that has to be connected to the computer after the logging is done.

Stage2 : Introduce the Ethernet shield to the GPS and have simultaneous data logging.

Stage 3: address the battery usage challenge adding the bare bones board by studying Nick's experiment.

Now, i received my Arduino uno and Adafruit ultimate GPS shield, and i already have a micro SD card that i can use. So i can start Stage1.

Since it's my first time working with an Arduino, i tried the simple LED circuit first. I had a problem uploading the sketch to the Arduino, after checking out their help page, i found that i didn't set the Arduino to use the right serial port in Tools. I also made the circuit differently, so that i fully understand how the circuit works.

Assembly: To assemble the Arduino with the GPS shield , i used male headers that came with the Adafruit package.

gpsStage1.jpg

I stacked the GPS shield on top of the Arduino, then, i soldered all the pins ( after many failed attempts, i should work on my soldering skills).

gpasStage1_2.jpg

The great thing about using the Adafruit shield is that they have step by step instructions on how to make it work. The first way to test the GPS is to put the Adafruit shield on direct mode. This will make the Arduino work as if it's a USB bridge. I uploaded a blank sketch as instructed in the Adafruit website and the GPS started giving raw GPS output that was basically blank. The GPS should get a fix outside to give valid data, but this experiment verifies that the GPS is properly working.

After making sure that the GPS worked, I switched to soft serial connect and uploaded the Adafruit GPS library which has all the code i need to make the GPS work. So from this library, i uploaded the leo-echo sketch to the Arduino . I also kept the frequency update of the data to the lowest at 1 HZ (10 times a second).

Parsing Data : Adafruit made this task tremendously easily with their GPS library. It gives the user access to the updated information without any parsing work. I uploaded the parsing sketch to the Arduino , and did 2 small changes as instructed by the Adafruit makers < https://learn.adafruit.com/adafruit-ultimate-gps-logger-shield > .

SD logging: a micro Sd card has to be to the GPS shield to store all the GPS data as the internal logging is not recommended and is hard to use. I uploaded the shield_sdlog sketch to the Arduino from the GPS library. Now the GPS is ready to be tested!

I connected the GPS to my computer ( because it has no battery yet) and took the bus from Amherst media to Mount Holyoke. Then, i took the SD card from the GPS and connected it to my computer and found the file of the Data that has been logged. To map the data, i used Google Earth. But the file created by the GPS needs to be converted from its original format with the .TXT extension to the format accepted bt Google earth with the .gpx extension. To do that, i used this great website called " GPS visualizer" that converted the file for me. Screen_Shot_2014-10-08_at_4.55.40_PM.png

I opened the file in Google Earth and the data was mapped!

Screen_Shot_2014-10-09_at_2.35.51_PM.png

Now it's time to add a battery to the device. I connected a lithium battery to an extension cable that i cut and soldered to the back of the Arduino where the battery pins are.

10744516_709407662468855_1887329268_n.jpg

10744738_709408039135484_1302069551_n.jpg

Now i am moving to stage2 of the device. It is time to add internet connection to the GPS. So i will be adding the Arduino Ethernet shield to the Arduino UNO and GPS shield. There will be some challenges to make the 3 pieces work together: -Figure out which shield will have to use which pins. -Get familiar with the softSerial library of the Ethernet shield. -Learn how to create a webserver with a webpage. (start with Arduino's examples). - make an html file and add GPS data to it.