Dragino LoRa GPS Tracker




We always appreciate your support and advice.

In this project,we'll show how to get GPS data from a remote Arduino via Wireless Lora Protocol and show the track on the GoogleEarth.The construction of this project is similar to my last one:

1) Client Side: Arduino + Lora/GPS Shield (868Mhz).

2) Server Side: Arduino + Lora Shield (868Mhz) + Yun Shield + USB flash.

Client side will get GPS data and keep sending out to the server via Lora wireless. Server side will listen on the Lora wireless frequency, once it get the data from Client side, it will turn on the LED and log the GPS data to a USB flash.

Step 1:

The Dragino Lora/GPS Shield is an expension board for LoRa™/GPS for using with the arduino.This product is intended for those interested in developing LoRa™/GPS solutions.The Lora/GPS Shield is composed of Lora/GPS Shield mother board and Lora BEE.

In the Lora part,the Lora/GPS Shield is based on the SX1276/SX1278 transceiver.The transceiver of the Lora/GPS Shield feature the LoRa™ long range modem that provides ultra-long range spread spectrum communication and high interference immunity whilst minimising current consumption. LoRa™ also provides significant advantages in both blocking and selectivity over conventional modulation techniques, solving the traditional design compromise between range,interference immunity and energy consumption.

In th GPS part,the add on L80 GPS (base on MTK MT3339) is designed for applications that require location or timing info. It connected to the arduino via serial port .

If you want to get more info about the Lora/GPS shield, please click this link:http://wiki.dragino.com/index.php?title=Lora/GPS_Shield

Step 2: Introduction of Lora BEE

The Dragino Lora BEE is a Lora moudule allows the user to send data and provides ultra-long range spread spectrum communication and high interference immunity whilst minimising current consumption.

The Lora BEE is based on the SX1276/SX1278 transceiver.The Lora BEE targets professional wireless sensor network applications such as irrigation systems, smart metering, smart cities, smartphone detection,building automation, and so on.

Step 3: Construction

Step 4: Hardware Preparations:

The project requries below hardwares:

  • Arduino board x 2 (We use an UNO board and a MEGA 2560 here)
  • Dragino Lora/GPS Shield x 1 (We use 868MHZ here)
  • Dragino Lora Shield x 1 (We use 868MHZ here)
  • Yun Shield v1.1.6 x 1
  • USB flash x 1
  • TTL to USB adapter x 1
  • 868MHZ antenna x 2
  • Ethernet cable x 1
  • USB cable x 2
  • LED x 1
  • 12V Batteries x 2
  • Some jump wires

Note: About the Yun Shiled,we must use the Yun Shield v1.1.6/Yun Shield v2.4 or higher version.

Step 5: Other Preparations:

In addition, we have to make the following preparations:

In this project you will use the "SoftareSerial.h" and "Radiohead.h" in the sketch,therefore,put the two libraries into your IDE libraries.

As you can see from the "server sketch" at the next steps,we store the GPS data in the file "/data/datalog.csv" of the USB flash,so we need to create a directory named “data” in the USB flash root.

Step 6: Connections

Connect the client and the server as above pictures.
In the sketch we use the hardware serial to communicate with the GPS and use the software serial(RX /D3,TX/D4) to debug via Arduino serial monitor.So,we connect the client to computer by TTL to USB adapter,the wiring is:

TTL to USB adapter --------------- Arduino UNO

RX ----------------- D4

TX ------------------ D3

GND ------------------ GND

On the Lora/GPS Shield,put the RXD/TXD jumpers on the status as the 3rd picture.(Connect GPS to the hardware serial)

You can get the Lora/GPS Shield hardware resource from:here.


  • The LED is on the D4 (Server).
  • Put the antenna on the boards.
  • Check the wiring carefully.

Step 7: Upload Sketch

Power them by 12v batteries,and connect them to the computer via USB cable or Ethernet cable.

At this step,make sure you have put the "SoftwareSerial.h" and "RadioHead.h" into your IDE libraries folder.


We use UNO+Lora/GPS Shiled as the client here.The GPS was connected to the hardware serial,in order to upload the sketch successfully,we need to press the "RST" button to reset the GPS to release occupation of arduino hardware serial until upload done. Open the IDE(Version 1.6.8 here),choose the correct board and correct port for you arduino,copy the client sketch to IDE,upload it to the board.


Upload the server sketch to the arduino board.

About how to use the Dragino YUN to upload the sketch,click:http://wiki.dragino.com/index.php?title=Yun_Shield

About the "RST" button

The GPS module can be restarted by driving the RESET to a low level voltage for a certain time and then
releasing it. Press the "RST" button will reset the digital part of the GPS receiver.

If you connect the GPS to the arduino by hardware serial,you need to press the "RST" button to release occupation of arduino hardware serial until the upload is complete.

Step 8: Test

We take an outdoor test today.At the beginning of this test,make sure the 3D_FIX(The blue LED) is flashing on the Lora/GPS Shield,it means the GPS get fixed.

As shown in the code: Lora send data after the GPS get fixed.Theoretically, it requires that GPS module has to track at least three satellites for positioning.

Step 9: Running Result

When the GPS get no fixed,the running result of the clients is as the first picture.(We get the running result from the client via software serial here.)
After the GPS module fixed,if the server an client are in the transmission range,you can see the LED flashing on D4 on server,and you can also get the running result as the 2nd picture(Client) and the 3rd picture(Server).

Then you can find a "datalog.csv" file in the data folder of the USB flash,open the csv file and you will see the longitude and latitude data collected by GPS receiver.(4th picture)

You can also edit the code to get more data from the GPS.

Step 10: Data Processing

We need to convert the csv file into kml file ,so we can import the datalog to the GoogleEarth.We use the "KMLCSV Converter" here,complete the following operation:

  1. Open the KMLCSV Converter,click File->Configration
  2. Click 'File Management- Browser' to choose the folder for storing datalog.csv
  3. As the 3rd picture,choose the "datalog.csv" and click the "Create File " button to create a kml file in the same folder.("datalog.kml")

Then you can find "datalog.kml" file in the folder where stores the "datalog.csv".(Picture 4)

Step 11: Import Map

Open "the datalog.kml" by the GoogleEarth,we get above pictures.We can see the GPS track there.

Step 12: Conclusion and Notices

In this project,we get the GPS track successfully.You can get more GPS data that you need from the Lora/GPS Shield,you can also build you own sensor transceiver by the board.It's a good idea if you want to use the Lora/GPS Shield in your LoRaWan construction.

Usage Notice

Make sure what serial you want to use,hardware serial or software serial?
Make sure the serial you use in Sketch reflect the exactly connection, we are using two serial here and easy to get confuse between them.

You have to be aware that Radio link quality and performances are highly dependent of environment. Better performances can be reached with:

  • Outdoor environment.
  • No obstacles.
  • No high level radio interferer in the ISM 868MHz band.
  • At least 1 meter above the ground.

Radio performances are degraded with:

  • Obstacles: buildings, trees...
  • Inner buildings environments.
  • High ISM 868MHz band usage by other technologies.

Radio communication are usually killed with bad topographic conditions. It is usually not possible to communicate through a hill, even very small.

Step 13: Reference



    • Faux-Real Contest

      Faux-Real Contest
    • Remix Contest

      Remix Contest
    • Organization Contest

      Organization Contest

    14 Discussions


    2 years ago

    This is really cool. I really appreciate the Google Maps integration. That could be useful for lots of things. But could you gives us a hint about how "long" long range is. "long" is sort of vague. Order of magnitude is close enough. I followed the "Scarlet Knight" which did the first trans Atlantic crossing by an untended underwater glider and they did daily tracking maps with google maps and I always wondered how they did it. I know they used a satellite phone modem for communications but never understood the Google Maps part. Thanks.

    The following are all long range to someone.

    a) > 100 ft

    b) > 1000 ft

    c) > 1 mile

    d) > 100 miles

    e) > 1,000 miles

    f) > 10,000 miles

    g) > 10 light years gets you out of the local group.

    a) Lo111

    3 replies

    Reply 2 years ago

    Open area max transmission distance ~15km,about 3km in the community.


    Reply 5 weeks ago

    suppose its a city (medium scale) will i get 2-3km range?
    is there a way to get data from multiple lora transmitters and know all of their locations(they all have an id for transmission or something to identify?)


    Reply 2 years ago

    The Local group is 10 MILLION Light years across, so you would probably need >5 MILLION light years to give a chance of leaving it ... ;-)
    (Wikipedia: "The Local Group has a diameter of approximately 10 million light-years")


    Question 4 months ago

    Hi, had tried uploading sketch for client unfortunately its failed. Could someone help me and show how the wiring of client


    1 year ago

    Awesome tutorial! I am working on a similar build and I need some guidance with the server sketch. I do not want to log the data on board the server but would rather serial stream it to my pc where I will capture and log to excel or something like it. If anyone can point me in the right direction I would greatly appreciate it!


    1 year ago

    Ok, so I've been trying to get this to work with exactly the same hardware set up as outlined here (bought the dragino shields) but cannot get the client to transmit anything using the sketches supplied. I can see the GPS sentences but the software serial just keeps reporting "sending to server" but never getting a response, the server just sits idle. I've tested the boards and shields with other examples and everything works as it should, including sending messages to and from client/server over the LoRa (915mhz). Any time I try the GPS Tracker sketches I get nothing.

    Has anyone else replicated this project?


    1 year ago

    I'm trying to set up this same project but have the data stored in a google drive folder, via the dragino lora gateway. I'm having difficulty with the code and how to set up the gateway to do this - can anyone assist?




    1 year ago

    Hello David. You have done a great job, congratulations! I have a doubt, if the Client is connected to PC via TTL/USB adapter, why in the first picture of step 7 does the Arduino Board seem to be connected too by USB? Thanks in advance!



    1 year ago

    Can the client send the gps Position directly to the computer? Or we always need a server? How can the position of the server be known in the google earth file if the server doesn't have a gps module ? thank you !


    2 years ago

    Can anyone advise what to use for a GPS implementation for cat/otter tracking? Gotta be low power, small and light, and I need to be able to see where these cute little creatures are from my secret lair. (The scenario is analogous, but thats the general idea of course)

    1 reply

    Reply 2 years ago

    Yeah,it seems very interesting,we need to choose the smaller MCU,wireless communication module and GPS module,and these components will be integrated into a PCB,I think it also depend on the cats' scope of activity,will you make it?