Back to List

IoT GPS Dog (or Reindeer) Tracker

Pete Febbraro Pete Febbraro   |  
Dec 09, 2016
 
With the growing popularity of the Internet of Things (IoT), more hardware components and connectivity platforms are available to developers than ever before.  It is now easier than ever to learn about hardware and create custom hardware projects.  The following is a description of a project I am working on to keep track of my dog Luna.  She is quite a rascal, fast and likes to jump fences.  I thought it would be handy to build a device that I could attach to her collar or harness that would obtain her coordinates using GPS, and then upload those coordinates to a database.  Then I could build a web site that would monitor the database and plot the incoming coordinates on a map.  With that in place, finding Luna would be as simple as logging in to the web site with my smart phone and viewing the map.   The following is a list of hardware components and software services used in this project.

Hardware components:
  • Adafruit FONA 808 - Mini Cellular GSM + GPS Breakout
  • Teensy 3.2 (ARM-based MCU board)
  • Adafruit Passive GPS Antenna uFL - 15mm x 15mm 1 dBi gain
  • Adafruit Slim Sticker-type GSM/Cellular Quad-Band Antenna - 3dBi uFL
  • Adafruit Lithium Ion Polymer Battery - 3.7v 500mAh
Software apps and online services:
  • Microsoft Azure
  • Google Maps Developer API
The Adafruit FONA is a breakout module that has GPS and cellular network functionality.  This makes it possible to get the longitude and latitude of the board and relay it using TCP/IP via the cellular connection.  For the cellular connection, a SIM card is required.  The FONA is not programmable, so we will use the Teensy MCU board to run our code that will process the signal from the GPS and relay the information.  This connection can be made with the on board UART of the MCU and FONA.  The figure below depicts how this can be wired.  Basically we are connecting the Tx and Rx pins of the boards for serial communication.  The Teensy (https://www.pjrc.com/teensy/) and Adafruit (https://www.adafruit.com/products/2542) web sites have detailed information about the board pins.



Now the MCU can be programmed to periodically query the Cellular + GPS breakout to obtain its longitude and latitude and once obtained, relay the data to an Azure IoT Hub. Azure IoT Hubs are designed for rapid telemetry ingestion. Microsoft also provides an IOT C SDK (https://github.com/Azure/azure-iot-sdks) that can be leveraged for programming devices, such as the Teensy MCU.  The IoT Hub basically acts as a message bus.  Once data is on the bus, other services can read the data and continue processing.  For this processing, an Azure Web Job can be created to monitor the bus for incoming GPS data and persist it to the coordinate database. When a data point is received, it will be added to an Azure Storage table.  Additionally, the Web Job can send out a notification that a coordinate has been received.  This makes it easier for the web site to show the data in real time by subscribing to these notifications instead of periodically polling the database for new coordinates.  This can easily be achieved using SignalR/WebSockets.  Now, when the web site is loaded it can plot these incoming coordinates on a map, as well as read and plot previous coordinates from persistent storage.  The Google Maps API is one such service that offers this plotting functionality to developers.  The following diagram shows the architecture of the system.



Now we have a good starting point for our dog tracking system.  Because the device size should be as small as possible, a good enhancement for this would be to get all this on one board instead of the MCU and breakout.  Fritzing (http://www.fritzing.org) is a great online tool for PCB (printed circuit board) design and fabrication.  There are also many other interesting sensors we could add to our tracking device, such as accelerometers, gyros, inertial measurement units (IMU), temperature, etc. All this data could be collected by our MCU and relayed to the hub.  Also, due to the scalability and device provisioning features of the Azure IoT Hub, we could provision multiple trackers and monitor their telemetry simultaneously.  Then, we could use machine learning to analyze the data and devise an algorithm to describe the movements of all the dogs in the neighborhood which could be an indicator of neighborhood rabbit migration patterns, but I digress.  There is a lot of new technology becoming available in the IoT space, so it really is exciting to be involved in these projects.  I hope this article has given you some ideas of what can be achieved. 
Azure

 

Love our Blogs?

Sign up to get notified of new Skyline posts.

 


Related Content


Spring 2019 Kentico User Group
Apr 17, 2019
Location: Waukesha County Technical College - Pewaukee Campus - 800 Main Street, Pewaukee, Wisconsin 53072 - Building: Q, Room: Q361
Aug 30, 2019
Interactive App Teaches Children How to Use 911

Skyline Technologies partnered with the Center for Childhood Safety (CCS) in Ashwaubenon to develop Kid's Practice 911 Dialer – a free app that teaches children ages 4-9 how to properly use 911. Through educational videos and simulated recordings based on actual 911 operator scripts...
Blog Article
Using Hooks to Reactify a Plain JavaScript Library: A Walkthrough
Andrew PetersenAndrew Petersen  |  
Aug 06, 2019
React Hooks make it really easy to wrap a vanilla JavaScript library with a React component so you can easily reuse it throughout your app and stay in "React Mode".In this walkthrough I'll be focusing on a single library, Shave.js, but the techniques and ideas should be applicable...
Blog Article
How to Create a Readable and Useful Bug Report
Blayne RoselleBlayne Roselle  |  
Jun 25, 2019
Creating a bug that is both readable and provides enough detail is a must-have skill for a Quality Assurance Analyst. Not only will it help when it comes time to retest, but it also provides credibility with your development team. In the content below, I will share the best practices for creating...
Blog Article
Machine Monitoring IoT Solution with Azure Services and Power BI
Eric SaltzmannEric Saltzmann  |  
Jun 11, 2019
We often hear organizations ask how they can drive more insights out of their connected devices. Though the Internet of Things (IoT) has been a buzzword for the last few years, many organizations are still struggling through the headache of implementing an IoT pilot or solution. Most of the...