0

members

Easy Basics: Project 053c NEO-6M GY-GPS6MV2 GPS module, SD card module

of Lex C. in UNO

Basics: Project 053c

Project name: NEO-6M GY-GPS6MV2 GPS module, SD card module - GPS data logger

Tags: Arduino Uno, NEO-6M GPS module, GY-NEO6MV2 GPS Module, GY-GPS6MV2, NEO6MV2, TinyGPS library, TinyGPSPlus library, TinyGPS++ library, NeoGPS library, SD Card Module, Micro SD card, u center, UBOX, terminal, GPS DATA logging with Neo 6M

Attachments: serialsketch; TinyGPSPlus_sketch and libraryTinyGPS_minsketch, TinyGPSmaxsketch and library; NeoGPS_sketch and librarysketchforucenter

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1.Arduino Uno R3 (you can also use the other version of Arduino)

2. NEO-6M GY-GPS6MV2 GPS module (it comes with an external antenna, and does’t come with header pins. So, you’ll need to get and solder some) 1pc

3.Arduino IDE ( you can download it from here  )

4.Jumper cables F-M, M-M

5.Resistor 2 pcs (10 KOhm 1pc and 4.7KOhm 1 pc)

6.Breadboard half size or small size 1 pc

7. Micro SD card with adapter 1 pc

8. SD card or Micro SD card module 1 pc

 or 

9. USB to TTL/Serial adaptor/converter 1 pc

General

We will learn how to connect NEO-6M GY-GPS6MV2 GPS module and SD card or Micro SD card module ; NEO-6M GY-GPS6MV2 GPS module and USB to TTL converter to Arduino board and use them as GPS data logger.

Understanding the USB to TTL converter

You can read more about them here.

Understanding the NEO-6M GY-GPS6MV2 GPS module

You can read more about it here.

Understanding the SD card or Micro SD card module

You can read more about it here.

Signals and connections of the USB to TTL converter

You can read more about them here.

 

Signals and connections of the NEO-6M GY-GPS6MV2 GPS module

The NEO6MV2 GPS module comes with 4 connections: RX, TX, VCC and GND, which is quite easy to incorporate with using SoftwareSerial on an Arduino Uno or a serial interface on an Arduino Mega. The power supply of the NEO6M should be 3.6V at max according to the datasheet. The typical China-produced breakout-boards contain a voltage regulator so that 3-5V VCC so it does not harm the board. Since the digital pins also produce 5V, the voltage divider is used on the receivers RX channel since this is not regulated.

RX (or RXD) - receive pin. Connected to Arduino board TX pin.

TX (or TXD) - transmit pin. Connected to Arduino board RX pin.

VCC - power supply. Can be connected to +5VDC or +3.3VDC pin of Arduino board.

GND - ground. Connected to Arduino board GND pin.

PPS - Pulse per second. This is an output pin on some GPS modules. Generally, when this pin toggles, once a second, you can synchronize your system clock to the GPS clock.

Signals and connections of the SD card or Micro SD card module

 or 

Note: depending on the module you’re using, the pins may be in a different order.

VCC (5V)  - connect to 5V pin Arduino Uno. If it is just VCC pin and no 3V3 pin connect VCC to 3.3V pin of Arduino Board

3V3 (or 3.3V) - connect to 3.3V pin Arduino Uno
CS (or SS or D3) (Chip Select or Slave Select) - the pin on each device that the master can use to enable and disable specific devices
MOSI (or DI or SI or CMD) (Master Out Slave In) - The Master line for sending data to the peripherals
CLK (or SCK) (Serial Clock) - The clock pulses which synchronize data transmission generated by the master
MISO (or DO or SO) (Master In Slave Out) - The Slave line for sending data to the master
GND (or G) - ground
CD - this is the Card Detect pin. It shorts to ground when a card is inserted. You should connect a pull up resistor (10K or so) and wire this to another pin if you want to detect when a card is inserted. 

Wiring

Note: different Arduino boards have different SPI pins. If you’re using another Arduino board, check the Arduino SPI documentation.

 

Step by Step instruction

1.Using Arduino board

  1. Most SD cards work right out of the box, but it's possible you have one that was used in a computer or camera and it cannot be read by the SD library. Formatting the card will create a file system that the Arduino can read and write to. It's not desirable to format SD cards frequently, as it shortens their life span. You’ll need a SD reader and computer to format your card. The library supports the FAT16 and FAT32 filesystems, but use FAT16 when possible. See additional info here.
  2. Format the SD card as FAT16 or FAT32. Insert the SD card in your computer. Go to My Computer and right click on the SD card. Select Format...  
  3. A new window pops up. Select FAT32, press Start to initialize the formatting process and follow the onscreen instructions.
  4. Insert the formatted SD card in the SD card module.
  5. Connect the SD card module to the Arduino Uno board.
  6. Do wiring.
  7. Open Arduino IDE.
  8. Plug your Adruino Uno board into your PC and select the correct board and com port
  9. Verify and upload the sketch to your Adruino Uno
  10. Open the Serial Monitor at a baud rate of 9600.
  11. You will receive a lot of information in the GPS standard language, NMEA (National Marine Electronics Association) data format. Each line you get int the serial monitor is an NMEA sentence.
  12. Let this project run for a few hours to gather a decent amount of data, and when you’re happy with the data logging period, shut down the Arduino and remove the SD from the SD card module.
  13. Insert the SD card to a SD card reader connected to your computer (PC), open it, and you should have a GPS.txt file or GPSdata.csv file with the collected data.
  14. You can open the data with a text editor, or use a spreadsheet to analyse and process your data.

 

2. Using USB to TTL converter

  1. Do wiring.
  2. Plug your USB to TTL converter into your PC USB port
  3. For using this USB to UART Converter you need a software tool. Most of the development tools like MikroC Pro, Arduino has a UART Tool along with it. Here we are going to use a freeware called Terminal. You can download UART Terminal here. Unzip the downloaded zip file to get Terminal.exe. Terminal.exe is a portable tool, ie no need to install it.
  4. Specify the port or just press ReScan button (our port is COM3).
  5. Specify the baud rate (we use 9600).
  6. Press Connect button. You will see the GPS data comming in Receive section. 
  7. Press Startlog button and specify the location for the file. You file name will be generated automatically, for example 20180109235131.log.
  8. Press Stoplog button to stop logging GPS data.
  9. You can also do logging of GPS data with u‑center GNSS evaluation software for Windows. You need to use this sketch in Arduino Uno and download the u center program here. You need to specify port and baud rate in Receiver section.
  10. Press recording button.
  11. Specify the location and name of the file (COM3_180109_231240.ubx).
Summary

We learnt how to connect NEO-6M GY-GPS6MV2 GPS module and SD card or Micro SD card module ; NEO-6M GY-GPS6MV2 GPS module and USB to TTL converter to Arduino board and use them as GPS data logger.

Notes:

  • It takes for about half a minute or one to read the data by the GPS module initially when you run it, so do not panic for this it’s very usual.
  • It happens in some case that it is unable to detect the data that might be the issue with antenna, so unplug the antenna( if it is detachable) and attach it again.
  • If, code says “Check Connection”, then you should definitely check it twice, before giving up. Also, sometimes interchanging the TX and RX pins is preferable and surprisingly works.

 

GPS Visualizer: Do-It-Yourself Mapping

You can check the GPS data logged with GPS Visualizer, an online utility that creates maps and profiles from geographic data. It is free and easy to use, yet powerful and extremely customizable. Input can be in the form of GPS data (tracks and waypoints), driving routes, street addresses, or simple coordinates. Use it to see where you've been, plan where you're going, or quickly visualize geographic data (scientific observations, events, business locations, customers, real estate, geotagged photos, etc.).

GPS Visualizer can read data files from many different sources, including but not limited to: GPX (a standard format used with many devices and programs, including Garmin's eTrex, GPSMAP, Oregon, Dakota, Colorado, & Nüvi series), Google Earth (.kml/.kmz), Google Maps routes (URLs), FAI/IGC glider logs, Fugawi (.trk/.wpt), Furuno, Garmin Fitness (.fit), Garmin Forerunner (.xml/.hst/.tcx), Garmin MapSource/BaseCamp/HomePort (.gdb), Geocaching.com (.loc), Google Spreadsheets, IGN Rando (.rdn), iGO (.trk), Lowrance (.usr), Microsoft Excel, NMEA 0183 data, OziExplorer (.plt/.wpt), Suunto X9/X9i (.sdf), Timex Trainer, TomTom (.pgl), U-blox (.ubx), XML feeds, and of course tab-delimited or comma-separated text.

Code

1. TinyGPS++ library.

The TinyGPS++ library allows you to get way more information than just the location, and in a simple way. Besides the location, you can get: date, time, speed, course, altitude, satellites, hdop and so on. You can read more  about the TinyGPS++ library here.

2. TinyGPS library.

TinyGPS library provides most of the NMEA GPS functionality – position, date, time, altitude, speed and course – without the large size that seems to accompany similar bodies of code.  To keep resource consumption low, the library avoids any mandatory floating point dependency and ignores all but a few key GPS fields.You can read more about it here.

3. NeoGPS library.

This fully-configurable Arduino library uses minimal RAM, PROGMEM and CPU time, requiring as few as 10 bytes of RAM, 866 bytes of PROGMEM, and less than 1mS of CPU time per sentence. You can read more about that library here. Some sketches from examples require additional libraries: AltSoftSerial and NeoTee. You also need to check that the configuration files setup done properly in subfolder SRC of NeoGPS library folder: NMEAGPS_cfg.h, GPSfix_cfg.h, GPSport.h, NeoGPS_cfg.h.

We have used AltSoftSerial library as using the SoftwareSerial library is NOT RECOMMENDED. The Rx/Tx configuration for this library is different:

The GPS module RX pin is connected to Arduino pin 9

The GPS module TX pin is connected to Arduino pin 8

GND/VCC is the same.

Library

  • All libraries attached on the begining of the project description
  • NeoGPS library. Download, unzip  and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. 
  • TinyGPS library. Download, unzip  and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. 
  • TinyGPS++ library. Download, unzip  and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. 
  • SD library included in Arduino IDE
  • SPI library included in Arduino IDE
  • SoftwareSerial library included in Arduino IDE.  
    The library has the following known limitations:
    If using multiple software serial ports, only one can receive data at a time.
    Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).
    Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
    On Arduino or Genuino 101 the current maximum RX speed is 57600bps
    On Arduino or Genuino 101 RX doesn't work on Pin 13
    The library has the following known limitations: If using multiple software serial ports, only one can receive data at a time;Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69);Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI);On Arduino or Genuino 101 the current maximum RX speed is 57600bps; On Arduino or Genuino 101 RX doesn't work on Pin 13

Sketch

  • See attachments on the begining of this project


Other projects of Lex C.

Published at 09-01-2018
Viewed: 4838 times