A GPS Tracker Using Arduino UNO, SIM800C, and Neo-6M-GPS Modules

by small-academy in Circuits > Arduino

1979 Views, 6 Favorites, 0 Comments

A GPS Tracker Using Arduino UNO, SIM800C, and Neo-6M-GPS Modules

IMG_0804.jpg
IMG_0805.jpg

This tutorial is part of the Internet of Tricks Erasmus+ Project. By the end of the tutorial, you will create a GPS Monitoring Device that can track users in almost real-time. The device has pedagogical purposes and is designed to increase user awareness of the dangers of connecting devices in an IoT (Internet of Things) ecosystem. You will learn what supplies and tools you need, how to assemble all the pieces, and the code needed for this device.

Warning! Always be careful while you work with electricity! The device will only work outdoors without being obstructed by buildings or other tall structures.

Supplies

Parts:

  • 1 × Arduino UNO R3 Board (or compatible)
  • 1 × SIM800C Module
  • 1 × Neo-6M-GPS Module
  • 1 × Half+ Breadboard
  • 20 × breadboard wires (various colors)
  • 1 × SIM Card with GPRS access


Optional Parts and Accessories for Tracking:

These parts are needed to test the device in real-life scenarios, as you will need extra power for the Arduino and the two modules.

  • 1 × USB Power Bank
  • 1 × Breadboard Power Supply Module

Tools:

If your modules don't already have soldered pins, you must solder them first. In this case, you will need the tools below. Otherwise, you're good to go, and you can skip the first step.

  • Soldering Station if your modules don't have the pins attached.
  • Rosin-Core Solder
  • Safety Equipment for soldering (glasses, fume extractor etc.)

Soldering Your Modules

Solder all pins if your modules don't have the pins already soldered. Here are some soldering tips to help you get started:

  • Safety First — Work in a well-ventilated area, wear safety glasses to protect your eyes from solder splatters, avoid inhaling solder fumes, and use a fume extractor if possible.
  • Clean the Tip — Keep your soldering iron tip clean by regularly wiping it on a damp sponge or brass wire cleaner. A clean tip ensures good heat transfer.
  • Proper Heating — Allow the soldering iron to heat up properly before use. Touch the iron's tip to the pad and the lead/wire to be soldered. Heat both components evenly to achieve a good solder joint.
  • Use the Right Temperature — Different soldering tasks may require different temperatures. Generally, 300-350°C (572-662°F) is suitable for most electronics work. Delicate components may require lower temperatures to avoid damage.
  • Quality Solder — Use a good-quality rosin-core solder for electronics work. 60/40 or 63/37 solder alloys are common choices. Thinner solder (around 0.8mm) is usually easier to work with.
  • Tinning — Apply a small amount of solder to the tip of the iron (tinning) before soldering. This helps with heat transfer and improves soldering efficiency.
  • Avoid Excessive Heat — Prolonged exposure to heat can damage components. Try to complete each solder joint quickly and move on.
  • Soldering Joints — Hold the soldering iron tip against the joint to be soldered. Touch the solder to the joint, not the iron. The heat from the joint will melt the solder.
  • Minimal Solder — Use just enough solder to make a good connection. Excessive solder can create bridges between pads or components.
  • Cooling — Allow the solder joint to cool naturally. Don't blow on it or touch it immediately, as this can create weak joints.
  • Avoid Movement — Hold the components steady during soldering to avoid creating "cold joints" due to movement.
  • Practice — If you're new to soldering, practice on some scrap components or wires before working on your actual project.
  • Third-Hand Tool — A "third hand" tool with alligator clips can be incredibly helpful for holding components in place while you solder.
  • Patience — Take your time. Soldering is a skill that improves with practice.
  • Inspect and Test — After soldering, visually inspect your joints. They should be shiny and smooth. Dull, grainy joints may indicate issues. Test your connections to ensure they're electrically sound before moving on.

Remember, soldering is a skill that becomes easier with experience. Don't be discouraged by initial difficulties; always prioritize safety and quality.

Assemble the Modules

iot_bb-v3.png

Put all your modules together, following the above schematics. Pay attention to your modules. The order of the pins might differ from those we used based on the manufacturer. Now is a good time to add the SIM card to your SIM800C module.

Connecting the SIM800C Module

  • 5V pin from the module to 5V pin from the Arduino
  • first GND pin (the left one) from the module to any GND pin from the Arduino
  • TX pin from the module to pin 11 on the Arduino
  • RX pin from the module to pin 10 on the Arduino
  • second GND pin (the right one) from the module to any GND pin from the Arduino

Connecting the Neo-6M-GPS Module

  • GND pin from the module to any GND pin from the Arduino
  • VCC pin from the module to 5V pin from the Arduino
  • TX pin from the module to pin 0 on the Arduino
  • RX pin from the module to pin 1 on the Arduino

Warning! This is for learning purposes only. Read the documentation before powering up the device. Some modules might require less (or more) power to start functioning properly.

The SIM800 modules need 3.7V, a common standard for most cellular modules. Using the 5V or 3.3V pins from Arduino is not advisable because the specified power supply for the SIM800 modules is from 3.4V to 4.3V. So, using 5V could damage the SIM800 module, while 3.3V is insufficient to power it. An external 3.7V Li-ion Polymer battery can be used as the power source for the module.

⚠️ Activity: Find a solution to the above issue (change the wiring to provide proper voltage to your module).


Testing the SIM800C Module

We used GitHub to upload a basic script to help you debug the SIM800C module. You can see and download it here. Once you have your Arduino and your module connected to your Arduino IDE, you can use the following AT commands to check the status of your module (you should write one command at a time and then press the Enter key):

  • AT — Once the handshake is successful, it should return the text "OK" (without quotes).
  • AT+CSQ — Signal quality test. The value range is from 0 to 31, where 31 is the best.
  • AT+CCID — Read SIM information to confirm whether the SIM is plugged in. Get the SIM card number. This command tests if the SIM card is found to be OK, and you can also verify the number written on the card.
  • AT+CREG? — Check that you're registered on the network. The second number should be 1 or 5, where 1 indicates you are registered to a home network and 5 indicates a roaming network. Other values indicate you are not registered to any network.
  • ATI — Get the module name and revision.

⚠️ Activity: Check the SIM800C datasheet for more AT commands. For example, it can be useful to find out if the card has GPRS capabilities and if they are set up correctly.


Testing the Neo-6M-GPS Module

To test the NEO-6M-GPS Module, we need more complex calculations and communications. This is why we will use a library, to ease things in.

⚠️ Activity: Use Arduino IDE to install the most recent version of the NeoGPS library by SlashDevin.

Once the library is installed, go to File > Examples > (Examples from custom libraries) > NeoGPS > NMEA to test that everything is wired up correctly.

If all looks good, go to File > Examples > (Examples from custom libraries) > NeoGPS > NMEAsimple to open a simple example. You should get the Latitude, the Longitude and the altitude in the Serial Monitor.

Assembling All the Scripts

⚠️ Activity: Based on what you've learned from the previous scripts and activities, create a new script that will get the Latitude and Longitude from the GPS module and send them to a server using the GSM module via GPRS every 60 seconds.


Remember! The device will only work outside without being obstructed by buildings or other tall structures. 


Final Notes

This tutorial was developed as part of the Internet of Tricks project, co-financed by the Erasmus+ program of the European Union. Project n°: 2021-1-SE02-KA220-YOU-000028971. The content of this publication does not reflect the official opinion of the European Union. Responsibility for the information and views expressed therein lies entirely with the authors. For more details, contact Small Academy.