Source of Idea- One in 3 pets will get lost at some point in their lifetime. 90% of these pets with an ID return home, while 90% of pets without are never found by their owner. Moreover, 15% of the 78M dogs and 86M cats in the US only, are lost every year. Make sure your favourite pet isn’t one of them, especially because only 15% of found dogs and 2% of cats are reunited with their owners.
Have your pets gotten loose on the streets and were captured by animal control? Are they sitting alone in isolated metal cages at one of the numerous animal centers around? Are they too close for comfort in the busy traffic?
These images and thoughts would run through any loving pet owner’s mind, especially considering how pets like dogs are known to run away or get stolen. However, pinova GPS pet tracking device can lessen the stress on you by ensuring your pet’s safety.
Lots of people let their dog out to poop in the morning. It’s tempting to just let them out the yard by themselves and give them time to sniff around while you stay warm and cozy inside and finish your coffee. But there’s two problems with that. The dog might run away (if you don’t have a fenced yard.
Regardless of when or where, always stay connected to your dog or cat. With Pinova GPS real-time tracking, you can see the exact trace of your four-legged friend.
I designed Pinova GPS to be easy to use for anyone, anywhere. Thanks to cutting edge technologies (Holgram Nova), Tractive GPS trackers can be located accurately and reliably from almost anywhere in the world, whether your pet is in the backyard or on the other side of the globe, you can monitor the location.
Key Features:
- Get proactive alerts via email, the app, or text notification when your dog leaves the safe place so you are aware of the breach before he gets too far away
- Follow your pet’s movements over the last 24 hours to learn where he went and when, as Whistle creates a new trip each time your dog leaves and returns to one of his places
- Track your dog’s activity and rest to gain valuable health information
- GPS pet tracking products help owners get a real-time location of their dog directly on a smartphone.
- Lightweight and waterproof
- GPS trackers with an integrated SIM card
- Real-time location tracking and live positioning for your dog
- Hologram Nova
- Raspberry Pi Zero Wireless
- BU-353-S4 USB GPS Receiver
- External Battery
- USB Hub
- Waterproof project box
- Hologram Global IoT SIM Card
The full code and build instructions are available on github.
PubNub cloud provides a realtime messaging API for building Mobile, Web, and IoT Applications. It has SDKs supporting a large set of platforms languages and Operating Systems.
To use PubNub, you should first register for an account, create an application and add a new Key set for our GPS data streaming. For more information you can consult the Quick Start guide.
After that you will get a pair of Keys one for publishing data to a channel and other one for subscribing to it.
2.2 Embedded Software:2.2.1 Broadband connection:With an open-source design and industrial grade modules, the Nova platform is fully hackable and scalable for integrating cellular connectivity into Raspberry pi.
GPS modules put out typically on the serial interface a series of strings of information called the National Marine Electronics Association (NMEA) protocol.
For our use case all we need is to fetch the position, speed and time. For that parsing the $GPRMC sentences is enough. As parsing library we use minmea, a lightweight C library:
Parsing is restricted to only RMC sentences:
minmea_sentence_id(line, false) == MINMEA_SENTENCE_RMC
If input line is not empty pack it into a rmc frame :
struct minmea_sentence_rmc frame;
if (minmea_parse_rmc(&frame, line)) {
...
}
Get time, speed (m/s) and coordinates (latitude, longitude) :
minmea_gettime(&ts, &frame.date, &frame.time);
/*convert speed from knot to mps*/
speed = KNT2MPS*minmea_tofloat(&frame.speed);
minmea_tocoord(&frame.latitude);
minmea_tocoord(&frame.longitude);
Those parameters are then packed into a json array :
/*format json string*/
asprintf(&gps_json_string, gps_data,
minmea_tocoord(&frame.latitude),
minmea_tocoord(&frame.longitude),
speed,
time);
gps = json_tokener_parse(gps_json_string);
Here is an output example:
[ { "latlng": [ 47.648102, 18.327868 ], "speed": 20.011890, "time": "2017-07-03 17:36:42" } ]
2.2.3 Location publishing:PubNub C-SDK is used to used to publish the data on the cloud:
The connection initialization is done using the Publish/Subscribe keys:
struct pubnub_sync *sync = pubnub_sync_init();
struct pubnub *pubnb = pubnub_init(PUBKEY, SUBKEY,
&pubnub_sync_callbacks, sync);
Publishing the json GPS data:
pubnub_publish(p,CHANNEL,data,TMOUT,NULL,NULL);
*In our code, we choose to send data only if the target is moving (speed > Threshold)
Finally verify if data was correctly sent:
if (pubnub_sync_last_result(s) != PNR_OK)
printf("pubnub publish error!\n");
2.3 Live View Web Interface:For tracking the device and display the position in real-time on a map, we will use Mapbox and Javascript powered EON Dashboard.
The full code can be found here.
To start you will need to create a MapBox account. Once this is done, you can either create a new map design or use an existing one for example Mapbox streets.
You will also get a Mapbox authentication token to be used to connect with your account.
The Javascript code will subscribe to the PuBNub corresponding channel, fetch the position and show it on the Map in real-time.
Initialize connection to PubNub
var pn = new PubNub({
//replace with your own sub-key
subscribeKey: 'sub-c-xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxx'
});
Define the EON map function by providing the API access token (mbToken), map ID (mbId) and the channel used to get GPS data from:
var map = eon.map({
pubnub: pn,
id: 'map',
mbId: 'mapbox.streets',
mbToken: 'pk.eyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
channels: ['gps-location'],
Function setView is added to set the initial position from the last know value:
message: function (data) {
map.setView(data[0].latlng);
},
Zoom option is set a focus on the position:
options: {
zoomAnimation: true,
zoom:16
},
Finally a following position marker parses the latlng coordinates and show them on the map:
marker: function (latlng) {
return (new L.Marker(latlng));
}
});
Step 3: Client- Display Locations in Browser:GPS tracking systems are widely utilized in a multitude of applications such as fleet management, security, personal or merchandise remote monitoring. In this Project, I will show how to build and program a mobile GPS Tracking device that is capable of streaming location coordinates to an IoT cloud and enable a real-time map view from any location/device with a simple web-browser of anything(car, pet or child).i Have tested it in car & we can also use it as a child monitoring device.
Google Maps APIs expect a latitude and longitude pair to show the location on Google Maps in a browser window.
You can also track the distance from a starting point say your home, college or work place. You need to give the latitude and longitude of the starting point in map.html. Upon hovering mouse over a marker, it shows the local time when the position was recorded and distance from starting point.
In this tutorial I have implemented a real-time GPS tracking system using a Raspberry pi and Hologram Nova connected to the Cloud. In future I will show how to extend this setup to stream more data from the car/Dog to the cloud.
Comments