Introduction: Track-O: a Cost Efficient GPS Tracking Device Using NODE-RED & FREEBOARD

Picture of Track-O: a Cost Efficient GPS Tracking Device Using NODE-RED & FREEBOARD

Hello folks,

TrackO is affordable and easily deployable tracking device which is compact & easy to use. Its accuracy is about 10m from the given location.

The idea of this project came up in my mind when I saw my parents concerning about my sister as she is a working woman and came home at night. After deploying this device in her car, they can track her anytime and from any place. It solves the problem of my parent's.

Step 1: Overview

TrackO is consist of two parts:-

HARDWARE: I m using Arduino Nano, sim900a mini (GSM Arduino module) & Ublox Neo 6MV2 (GPS module ).

SERVER: I'm using the Node-red for getting the data from the device so I can see and visualize the data and map the latitude and longitude on GOOGLE MAP. Mapping of the data is done on

It's upon you where you want you to visualize your data. You can also make an app for it.

Step 2: Hardware Needed:

Picture of Hardware Needed:
  1. Arduino nano (or Uno or any other microcontroller ).
  2. Sim900a GSM module.
  3. Ublox Neo 6MV2 (GPS module ).
  4. PCB or Breadboard.
  5. 5V adapter.
  6. Soldering Iron If using PCB.

Step 3: Hardware Connections:

Picture of Hardware Connections:
  1. Nano GND --> GND (External DC Power Source)
  2. Nano Vin --> 5V (External DC Power Source)
  3. Nano D3(RX) --> TX (GPS)
  4. Nano D4(TX) --> RX(GPS)
  5. Nano D7(RX) --> TX (GSM)
  6. Nano D8(TX) --> RX (GSM)
  7. Connect the GND and VCC of GSM and GPS to the power source

Step 4: Arduino NANO Code:

<p>/**<br>© Rahul Agarwal & Ashtam Singh 2016, All Rights Reserved
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit
* */
#include <SoftwareSerial.h>
//Global Variables for Latitude and Longitude
long lat, lon;
float latitude, longitude;
SoftwareSerial GPS_Com(3, 4);//RX, TX
SoftwareSerial GSM_Com(7, 8); //RX, TX
TinyGPS gps;
String deviceID = "TRACKO";
void setup()
//Serial.println("Connecting GPS......"); }
void loop() {
void gpsGetdata() {
//Time Variables
int year;
byte month, day, hour, minute, second, hundredths;
unsigned long age;
while (GPS_Com.available() != 0) {
if (gps.encode( {
gps.get_position(&lat, &lon);
//gps.get_datetime(&date, &time, &age);
gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
//Time Calculations
char date[16];
char timer[16];
sprintf(date, "%02d/%02d/%02d", month, day, year);
sprintf(timer, "%02d:%02d:%02d", hour, minute, second);
latitude = (lat * 0.000001);
longitude = (lon * 0.000001);
//Serial.print("Position: "); //Serial.print("Lat: "); //Serial.print(latitude, 4); //Serial.print(" "); //Serial.print("Lon: "); //Serial.println(longitude, 4); //Serial.print(" "); //Serial.print("Date: "); //Serial.println(date); //Serial.print(" "); //Serial.print("Time: "); //Serial.println(timer); //Serial.print(" ");
gsmGetdata(latitude, longitude, date, timer); } } }
void gsmGetdata(float la, float lo, String pdate, String ptimer)
//Serial.println("Geting Data from GSM:");
//Setup the GPRS in GSM
//Check GPRS Connection Status
if (check(0, 5000))
{ //Serial.println("GPRS connection ok"); }
else { //Serial.println("GPRS connection err"); }
//Set the APN for GSM Setting
if (check(0, 5000))
{ //Serial.println("APN connection ok"); }
else { //Serial.println("APN connection err"); }
//Setup the SAPBR
for (int i = 0; i < 3; i++)
{ GSM_Com.println("AT+SAPBR=1,1");
//setting the APN, the second need you fill in your local apn server
if (check(0, 10000)) { //Serial.println("SAPBR connection ok");
break; }
else { //Serial.println("SAPBR connection err"); } }
//Initialize the HTTP Client
if (check(0, 5000)) { //Serial.println("HTTP connection ok"); }
else { //Serial.println("HTTP connection err"); }
//Serial.println("AT+HTTPPARA=\"URL\",\"http://URL-NODE-RED/tracko?deviceID=" + deviceID + "&Latitude=" + String(la, 6) + "&Longitude=" + String(lo, 6) + "&Date=" + String(pdate) + "&Time=" + String(ptimer) + "\"");</p><p>//Put your Node red URL here 
GSM_Com.println("AT+HTTPPARA=\"URL\",\"http://URL-NODE-RED/tracko?deviceID=" + deviceID + "&Latitude=" + String(la, 6) + "&Longitude=" + String(lo, 6) + "&Date=" + String(pdate) + "&Time=" + String(ptimer) + "\"");
//Setup the HTTP Action
if (check(0, 5000))
{ //Serial.println("Send ok"); }
else { //Serial.println("Send err"); }
if (check(2, 10000))
{ //Serial.println("Send ok"); }
else { //Serial.println("Send err"); }
//Read the Data from the Server
if (check(0, 10000))
{ //Serial.println("GSM done"); }
else { //Serial.println("GSM err"); }
//Terminate the HTTP Client
if (check(0, 5000))
{ //Serial.println("Terminate done"); }
else { //Serial.println("Terminate err"); }
if (check(0, 5000))
{ //Serial.println("Terminate done"); }
else { //Serial.println("Terminate err"); }
//GSM Check Commands
bool check(int v, uint32_t timeout, String & Data)
unsigned long start = millis();
char a;
while (millis() - start < timeout) {
while (GSM_Com.available() > 0)
{ a =;
if (a == '\0') continue;
Data += a; }
if (Data.indexOf("OK") != -1 && v == 0)
{ //Serial.println(Data);
return 1;
if (Data.indexOf(">") != -1 && v == 1)
{ //Serial.println(Data);
return 1;
if (Data.indexOf(":") != -1 && v == 2)
{ //Serial.println(Data);
return 1;
} }
return 0;
bool check(int v, uint32_t timeout)
{ unsigned long start = millis();
char a;
String Data;
while (millis() - start < timeout)
while (GSM_Com.available() > 0)
{ a =;
if (a == '\0') continue;
Data += a; }
if (Data.indexOf("OK") != -1 && v == 0)
{ //Serial.println(Data);
return 1; }
if (Data.indexOf(">") != -1 && v == 1)
{ //Serial.println(Data);
return 1;
if (Data.indexOf(":") != -1 && v == 2)
{ //Serial.println(Data);
return 1;
} }
return 0;
void rxempty()
while (GSM_Com.available() != 0)

After debugging the code, please make sure to comment the serial monitor as it may lead to malfunctioning. Also, make a separate folder in Arduino library for the TinyGPS library and put the .h &.CPP file in it.

Step 5: Server Side:

Part 1: API made in Node-red

I m using Node-red.

You can see the full Documentation here:-

My Node red Flow:

[{"id":"213a0461.834cfc","type":"http in","z":"d8215eb6.bdc4d","name":"","url":"/tracko","method":"get","swaggerDoc":"","x":165,"y":105,"wires":[["b549696f.3bcd88","e18f90a5.1ecd8"]]},{"id":"b549696f.3bcd88","type":"mongodb out","z":"d8215eb6.bdc4d","mongodb":"a6c5cf74.81249","name":"","collection":"tracko","payonly":true,"upsert":false,"multi":false,"operation":"insert","x":549,"y":111,"wires":[]},{"id":"e18f90a5.1ecd8","type":"http response","z":"d8215eb6.bdc4d","name":"","x":360,"y":137,"wires":[]},{"id":"a2a0dd02.cc704","type":"http in","z":"d8215eb6.bdc4d","name":"","url":"/get_tracko","method":"get","swaggerDoc":"","x":91,"y":309,"wires":[["65281481.e6026c"]]},{"id":"a36fbbb1.a89418","type":"mongodb in","z":"d8215eb6.bdc4d","mongodb":"a6c5cf74.81249","name":"","collection":"tracko","operation":"find","x":462,"y":309,"wires":[["dbdf926c.04f77"]]},{"id":"4799ade4.87d914","type":"http response","z":"d8215eb6.bdc4d","name":"","x":860,"y":302,"wires":[]},{"id":"dbdf926c.04f77","type":"json","z":"d8215eb6.bdc4d","name":"","x":717,"y":312,"wires":[["4799ade4.87d914"]]},{"id":"65281481.e6026c","type":"function","z":"d8215eb6.bdc4d","name":"","func":"msg.limit = 1;\nmsg.sort = {\"_id\" : -1};\nmsg.skip = 0;\nreturn msg;","outputs":1,"noerr":0,"x":231.5,"y":290,"wires":[["a36fbbb1.a89418"]]},{"id":"a6c5cf74.81249","type":"mongodb","z":"","hostname":"","port":"27017","db":"db","name":""}]

Part 2: Using the API in FREEBOARD

  1. Goto
  2. Sign Up there.
  3. Now go through the video given.
  4. At the end of the video, you can see the location of my device.It is not moving, but when you put it in a car or something running, then you can easily track your path.


jowan_kurd (author)2017-06-20


awesome, Good job My Friend,
I could not download the video file (final.mp4),
How can I have this video?
Good Luck,

onion2 (author)2017-06-02

hello, it's a really cool project
but I have some questions.
how musch does it cost ?
what is the power consumption?

thank you very much

LearnerB (author)2017-05-07

Hello there, is it possible to send sms or call if a switch is used for that?

Pifouni (author)2017-03-08


Bravo for your project.

Just a question / I am amazed you don't initialise the PIN code ?

Thank you for your explanation.


Ashtam55 (author)Pifouni2017-03-08

Bec while using Software serial we initialise the pin at starting. And in this instructable we are treating the pins as RX & TX.

Pifouni (author)Ashtam552017-03-09


there is a misunderstanding, I was talking about the PIN code of the SIM card you have to use withe the SIM900 Module.

I did a project like yours and I had to use an AT+CPIN command.

agarwalrahul1996 (author)Pifouni2017-03-18

Hey we are using a unlocked Sim Card. It doesn't require PIN code :)

JustinM63 (author)2017-03-08

How much does this cost for the gsm service?

Ashtam55 (author)JustinM632017-03-08

It takes around 200 mb data/ month.

Droxz (author)2017-03-07

Nice one, I really need to create something like this. Keep up the good work and thanks for sharing :)

Ashtam55 (author)Droxz2017-03-07

Thank you. :)

Swansong (author)2017-03-07

Thanks for sharing :)

About This Instructable




More by Ashtam55:Ambient Apparels - Tees Which Love TalkingTrack-O: a Cost Efficient GPS Tracking Device Using NODE-RED & FREEBOARD
Add instructable to: