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
Blog Article
Scoundrels! Rascals! Facing Challenges of Low-Code Development
Bob SchommerBob Schommer  |  
Sep 29, 2020
Low-code application development is not new. As early as the 1990’s, Microsoft Access was used by non-IT developers to build business applications. Employees who understood the business and had some technical aptitude were able to quickly build solutions without having to wait for IT. They...
Blog Article
Accelerating Flow in the IT Value Stream
Bob SchommerBob Schommer  |  
Jul 21, 2020
Every CIO grapples with how to rapidly turn customer needs or good business ideas into working software to meet the demands of a VUCA (volatile, uncertain, complex, and ambiguous) world. With traditional waterfall development methodologies, it frequently takes months (or even years) before...
Blog Article
How to (and not to) Manage Group Permissions in SharePoint Online
Kyle ZiberKyle Ziber  |  
Jun 23, 2020
About the author: Kyle Ziber has been working in SharePoint and the Microsoft Cloud since 2010. He holds an MCSE in both SharePoint and Productivity from Microsoft.   There are many ways to manage permissions in SharePoint Online. Today, we’ll walk through three scenarios for...
Blog Article
How API Integrations Can Give Your Business One Source of Truth
Nick DopkinsNick Dopkins  |  
Feb 25, 2020
As an organization grows, so does its IT stack and the amount of applications it manages. If left unchecked, this can result in a multitude of disjointed programs that duplicate data, repeat logic, and know nothing about each other.   Implementing API integration to formulate one source of...