This tutorial will guide you through building a simple GPS tracking system using the ATGM336H GPS+BDS Module with an antenna and an Arduino Uno. By the end of this project, you will have a working system that can track your location and display it in the serial monitor, complete with a link to open the location in Google Maps.
You will learn how to connect the ATGM336H GPS+BDS Module to the Arduino Uno, how to write code to read the GPS data, and how to display the location in the serial monitor. This project is perfect for beginners who want to learn about GPS technology and its applications in various fields such as agriculture, security, and smart-home solutions. For example, in Rwanda, GPS technology can be used to track the location of livestock or to monitor soil moisture levels in farms.
The skills you will learn in this tutorial are essential for building more complex projects such as GPS-based navigation systems, tracking devices, and IoT-based monitoring systems. You will also learn how to source the necessary components locally in Kigali, Rwanda, and how to troubleshoot common issues that may arise during the project. Some of the key concepts you will learn include:
This project is a great starting point for anyone interested in learning about GPS technology and its applications, and it can be completed with minimal equipment and expertise. By the end of this tutorial, you will have a working GPS tracking system and a solid understanding of the concepts and skills required to build more complex projects.
The ATGM336H GPS+BDS Module is a compact and powerful navigation module that provides location information using both GPS and BeiDou Satellite Systems. This module is ideal for various applications, including tracking systems, navigation devices, and IoT projects. In this tutorial, we will explore how to use the ATGM336H GPS+BDS Module with an Arduino Uno to track location and display it in the serial monitor.
To start, you will need the following hardware components: ATGM336H GPS+BDS Module with Antenna, Arduino UNO, Jumpers, and a Breadboard. You can source these components from SoftTech Supply in Kigali, Rwanda. Make sure to handle the components with care, as they are sensitive electronic devices.
A safety note: when working with electronic components, make sure to avoid touching the pins or electrical paths to prevent damage or short circuits.
Now, let's connect the ATGM336H GPS+BDS Module to the Arduino UNO. The wiring is straightforward:
gpsRx)gpsTx)Use the jumpers to connect the module to the Arduino UNO, and the breadboard to organize the connections.
Next, you need to upload the firmware to the Arduino UNO. You can use the Arduino IDE to upload the code. Create a new project, and include the following libraries: SoftwareSerial.h. Then, create a SoftwareSerial object to communicate with the ATGM336H GPS+BDS Module.
Use the following code snippet to configure the serial communication: SoftwareSerial mySerial(2, 3). Replace the pins with the actual pins you used to connect the module.
Now, let's write the code to read the GPS data from the ATGM336H GPS+BDS Module. You can use the following code as an example:
The code will read the GPS data, parse the NMEA sentences, and extract the location information. You can then print the location information to the serial monitor.
Once you have uploaded the code, open the serial monitor to see the location information. The serial monitor will display the latitude and longitude coordinates, as well as a link to open Google Maps with the location. The link will be in the format: https://maps.google.com/?q=-1.94536,30.05970
Make sure to place the GPS module near a window or outside to get a clear view of the sky, as this will improve the GPS signal reception.
If you encounter any issues during the project, here are some troubleshooting tips:
By following these tips, you should be able to resolve any issues and get the project working as expected.
// ATGM336H GPS+BDS Module with Arduino Uno
#include <SoftwareSerial.h>
const int gpsRx = 2; // Arduino RX (connect to GPS TX)
const int gpsTx = 3; // Arduino TX (connect to GPS RX)
SoftwareSerial gps(gpsRx, gpsTx);
void setup() {
Serial.begin(9600);
gps.begin(9600);
Serial.println("GPS Starting...");
}
void loop() {
if (gps.available()) {
String gpsData = gps.readStringUntil('\n');
// Look for GGA sentence
if (gpsData.startsWith("$GPGGA")) {
Serial.println(gpsData);
int comma[14];
int index = 0;
comma[index++] = -1;
for (int i = 0; i < gpsData.length(); i++) {
if (gpsData.charAt(i) == ',') {
comma[index++] = i;
}
}
// Extract latitude and longitude
String latitude = gpsData.substring(comma[1] + 1, comma[2]);
String latDirection = gpsData.substring(comma[2] + 1, comma[3]);
String longitude = gpsData.substring(comma[3] + 1, comma[4]);
String lonDirection = gpsData.substring(comma[4] + 1, comma[5]);
Serial.print("Latitude: ");
Serial.print(latitude);
Serial.println(latDirection);
Serial.print("Longitude: ");
Serial.print(longitude);
Serial.println(lonDirection);
Serial.print("Google Maps: https://maps.google.com/?q=");
Serial.print(latitude);
Serial.print(latDirection);
Serial.print(",");
Serial.print(longitude);
Serial.println(lonDirection);
}
}
}
1. What is the primary function of the ATGM336H GPS+BDS Module with an antenna in the context of this tutorial? a) To provide internet connectivity to the Arduino Uno b) To track the location and provide GPS coordinates c) To control the Arduino Uno's power supply d) To display the location on a map Answer: b 2. How do you connect the ATGM336H GPS+BDS Module to the Arduino Uno for serial communication in this project? a) Using I2C protocol through SDA and SCL pins b) Using SPI protocol through MOSI, MISO, and SCK pins c) Using UART protocol through TX and RX pins d) Using USB connection directly to the Arduino Uno Answer: c 3. What is the purpose of the jumpers and breadboard in the setup of the ATGM336H GPS+BDS Module with the Arduino Uno? a) To increase the voltage supply to the GPS module b) To reduce the current consumption of the system c) To facilitate easy connection and prototyping of the circuit d) To connect the system to the internet Answer: c 4. What can be observed in the serial monitor after successfully uploading the code to the Arduino Uno in this tutorial? a) A list of available GPS satellites b) The current weather conditions c) The link to open Google Maps with the current location d) The system's IP address Answer: c 5. What safety precaution should be taken when working with electronic components like the ATGM336H GPS+BDS Module and the Arduino Uno? a) Always touch the components with bare hands to discharge static electricity b) Use the components near water or in humid environments c) Avoid touching the components to prevent static electricity damage d) Connect the system directly to mains voltage without a regulator Answer: c
If you don't already have the parts listed above, you can buy genuine Arduino, ESP32, Raspberry Pi, sensors, and other electronic components from SoftTech Supply Shop, with fast delivery across Kigali and other parts of Rwanda.
← Browse more Arduino & IoT tutorials