Make Your Own GPS Transmitter with the HC-12 Transceiver




The first article in this two-part series, Understanding and Implementing the HC-12 Wireless Transceiver Module, uses the HC-12 to create long-distance data transmission between two Arduino Unos. This article uses a pair of HC-12 transceivers, a GPS module, an Arduino, and Google Maps to create a very simple tracking device.

GPS Transmitter with the HC-12 Transceiver




ItemCostMore Information
HC-12 transceiver (x2)$4Datasheet
GPS Receiver$16Datasheet
or Adafruit GPS Logger Shield$45Project Guide
Arduino Uno R3 (or compatible)$45Reference

Part one of this two-part series discussed the HC-12 transceiver module and described how to hook it up to an Arduino and a power source.

In this article, we will create a remote GPS receiver that can be used to track nearby items without using a cellular network.

For further information on the transceiver module, please see the HC-12 datasheet (PDF).

Adding and Transmitting GPS

The Global Positioning System (GPS) allows users to accurately determine the location of objects on or above the surface of the Earth. Both of the GPS receivers listed at the top of this article transmit National Marine Electronics Association (NMEA) sentences that provide information that includes latitude and longitude, altitude, time, bearing, speed, and a great many other variables at 9600 baud.

The HC-12s can transmit the information from a GPS receiver with no additional programming or circuitry.

You can transmit GPS coordinates to remote locations with as little as a GPS receiver, an HC-12 transceiver, and a battery. Remotely transmitted coordinates would have to be received by another HC-12 transceiver and then processed with a microcontroller or computer.

GPS Transmitter with the HC-12 Transceiver - diagram

A simple setup such as the one above would allow you to create a small remote object tracker; it will alert you if the object leaves a predefined area, and then you will have a certain amount of time to track the object before the transmitter goes out of range. You could use this with a vehicle, a pet, or even—if you are concerned about theft—the giant pumpkin that you are growing for the state fair.

If you are in an area with clear line of sight, the transmitters will broadcast up to one kilometer, which is a 15-minute walk (or 5-minute run). The maximum range in urban areas will decrease but should remain adequate to alert you if your luggage is leaving the train station without you, or let you know where your dog ventures when he escapes from your yard.

We can refine this project by passing the GPS data to an Arduino instead of directly to the HC-12. Then, only selected strings can be transmitted to the HC-12. This is useful if you want to increase the range of the HC-12 communication by decreasing the over-the-air baud rate.

The $16 SparkFun GPS module has a default transmission rate of 9600 baud, and this corresponds to an over-the-air rate of 15000 baud. Sending the 9600 baud GPS data to the Arduino and then transmitting only selected information to the HC-12 at 2400 baud will reduce the over-the-air rate to 5000 baud. According to the datasheet, this improves receiver sensitivity by at most 5 dB, which provides a modest increase in range.

The SparkFun GPS receiver provides six sentences at 9600 baud: GPRMCGPVTGGPGGAGPGSAGPGSV, and GPGLL.

The GPS shield from Adafruit, which is significantly more expensive, can be programmed to transmit select sentences at all standard baud rates.

This is an example data transmission from the receiver to an Arduino. You can decode your own strings with this online tool.

$GPRMC,210154.00,A,3358.88969,N,11756.33387,W,0.824,,200916,,,A*6F
$GPVTG,,T,,M,0.824,N,1.527,K,A*2C
$GPGGA,210154.00,3358.88969,N,11756.33387,W,1,05,1.67,254.3,M,-32.6,M,,*6E
$GPGSA,A,3,13,05,21,18,29,,,,,,,,3.15,1.67,2.66*01
$GPGSV,3,1,11,05,20,044,23,10,10,223,,13,26,083,22,15,37,120,*70
$GPGSV,3,2,11,16,11,322,,18,45,224,23,20,76,043,,21,55,312,22*76
$GPGSV,3,3,11,25,23,195,17,26,27,298,,29,72,108,17*47
$GPGLL,3358.88969,N,11756.33387,W,210154.00,A,A*74

Arduino libraries exist that enable decoding of NMEA sentences into the latitude & longitude pairs below:

 

TypeUTC TimePositionSpeedAltitudeHDOP, VDOP, PDOPSatellites
RMC2016-09-20T21:01:54Z33°58’53.38”N, 117°56’20.03”W0.824 knots
VTG0.824 knots
GGA2016-09-20T21:01:54Z33°58’53.38”N, 117°56’20.03”W254.35
GSA1.67, 2.66, 3.155
GSV11
GSV11
GSV11
GLL2016-09-20T21:01:54Z33°58’53.38”N, 117°56’20.03”W

RMC (recommended minimum information), GGA (3D location and accuracy), and GLL (latitude and longitude) all include latitude, longitude, and time. GGA provides altitude, and GSA provides the dilution of precision of the reading (lower numbers indicate greater precision).

The following program is backward-compatible with the two programs presented in part one. It reads the NMEA sentences sent by the GPS to the Arduino, discards all but the selected sentence, and transmits the selected sentence to a remote Arduino when requested. It works with either the SparkFun GPS receiver or the Adafruit GPS logger shield, as shown below. This program allows users to remotely “ping” distant transceivers to determine their location.

 

Read More: GPS Transmitter with the HC-12 Transceiver




This Post / Project can also be found using search terms:

  • gps and arduino related projects list
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Simple and small temperature fan controll
Simple and small temperature fan controll

I published this schematic long ago in this article: Adjustable power supply and since then I made some improvements in...

Close
Scroll to top