Introduction: Arduino GPS Data Logger

About: An Electronics engineer and a hobbyist. I love to keep experimenting with microcontrollers.

Hello guys!!! Welcome a new instructable. Today we will make a data logger. In the past we made a similar project which logged the data into an excel spreadsheet. If you want to check it out - click here.

This project is different. Here we will log the GPS data on a SD card. For GPS I used a Neo 6m GPS Module and to store the data to a SD card I used a SD card module (SPI). Read the complete instructable to understand how to make it.

Step 1: Gather the Supplies

Are you a hobbyist and enjoy making arduino / electronics based projects? Do you need components frequently and worried about the quality? Well then I suggest you buy the components from UTSource.net . They provide high quality components at affordable rates. And these components are delivered right to your door step in excellent condition. They also provide PCB's up to 16 layers. Do check their PCB Services to know more.

Let's take a look at the modules we will be using to make this project -

1. Arduino Uno

2. Neo 6M GPS Module

3. SD Card Module

4. Breadboard

5. Led and 220 ohm Resistor

6. Connecting Header Wires

Step 2: Circuit Diagram

The circuit diagram for this project is given above.

I will explain the connections below as the pin outs are not shown above in the diagram.

First lets take a look at the GPS and Arduino's connections -

Connect the VCC and Gnd pins of the GPS to +5V and Gnd pin of the Arduino. Make sure your module supports 5 V or you have to connect the VCC to 3.3 V.

Now Connect the Tx pin of the GPS to digital pin 4 and Rx pin to digital pin 5.

Once the GPS is connected, its time to connect the SD card module.

Again connect the Vcc and Gnd of the Module to Arduino's 5 V and Gnd.

The MISO pin of the Sd card module is connected to the digital pin 12 and MOSI pin to digital pin 11.

Now connect the SCK pin to digital pin 13.

Connect the CS pin to digital pin 7.

Now connect a led through a 220 ohm resistor to digital pin 8.

Step 3: Code

Now lets upload the code to the Arduino Board. You can copy it from below or directly download the .ino file.

#include "GPS.h"
#include <SD.h>
#include <SPI.h>
GPS gps(4, 5); //tx,rx File myFile; int pinCS = 7; const int led = 8; void setup() { Serial.begin(9600); pinMode(pinCS, OUTPUT); pinMode(led, OUTPUT); while (!gps.begin()); // SD Card Initialization if (SD.begin()) { Serial.println("SD card is ready to use."); } else { Serial.println("SD card initialization failed"); return; } } void loop() { myFile = SD.open("test.txt", FILE_WRITE); if (myFile) { Serial.println(gps.getGeolocation()); myFile.println(gps.getGeolocation()); myFile.close(); // close the file digitalWrite(led,HIGH); delay(200); digitalWrite(led,LOW); } else { Serial.println("error opening test.txt"); } delay(3000); }

In this project I used the GPS library by Helder Rodrigues. So a huge thanks to him for his contribution.

You can download the library by clicking here.

There is one more image I have attached above. It shows the format how the output will be stored in a text file in the SD card.

Attachments

Step 4: Final Project

Above are the images of the final project. I did not attach a video for this project because it was raining and I could not go out to test the project. One more important thing. You need to power this project using a battery so that you can carry it with you and log the locations of your journey. For powering you can use 18650 cells (2 X 18650 in parallel >> Boost converter (5V) >> Arduino Vin). For demo purpose I used those cheap 9V batteries which are available pretty much every where.

If you liked this project, share it with your friends. Also follow me here to get updates about my upcoming projects.

That's it for today. See you guys soon with another diy project.