Setup for External Bluetooth GPS Provider for Android Devices

by paddyding in Circuits > Arduino

4242 Views, 5 Favorites, 0 Comments

Setup for External Bluetooth GPS Provider for Android Devices

Capfghture.JPG

This instructable will explain how to create your own external Bluetooth-enabled GPS for your phone, kindle whatever at just about $10.

Bill of materials:

  1. NEO 6M U-blox GPS
  2. HC-05 bluetooth module
  3. Knowledge of interfacing Blutooth Low energy modules
  4. Arduino
  5. Common sense
  6. Wiring Know-how

Fundamentals

So how does this work, in general?

  1. u-blox is a Swedish company that manufactures GPS. The GPS module provides an array of data under what they call NEMA protocol. It may consist several lines of data in its RAW form, but using the right software you should be able to tell what is what.
  2. The GPS module outputs data in serial and the data is received by the bluetooth module, since they run on UART. (means they have the same mode of transport if you could think of it that way).
  3. Now, the bluetooth module with the right configuration, will transmit all of the raw GPS data to your Android-enabled phone.
  4. The Android phone will use a third-party app to process the GPS RAW data into human-readable form.
  5. The app will then "hack" into your phone's system to "replace" the GPS "library" with the Bluetooth GPS data you have just transmitted and received. This is what commonly known as "mock location". *
  6. Any navigation-app e.g. Google Maps should run parallel with the Bluetooth GPS.
*Disclaimer: I have no affiliation with any of the developers of hardware and software mentioned in this instructable. You do understand that downloading any software posses risks of cybersecurity breach. God knows what those software developers write in these apps, respect them in any ways you can. I am not responsible for any damage done to your phone or to you, and you are fully responsible for any modifications. Do at your own risk.

Gather Your Materials

bluetooth-module-hc-05-500x500.jpg
ublox-neo-6m-ttl-500x500.jpg

You should have the NEO-6M GPS, Arduino, and a HC-05 bluetooth module, though I think you might be able to use HC-06 in some sense. You also need your computer, some basic computer and electronics knowledge.

Connect Your Bluetooth Module to Your Arduino

This step is critical to make sure that your UART on your Arduino runs on 9600 Baud.

Connect your bluetooth module to your Arduino.

Open your Arduino IDE on your computer and connect your Arduino to your computer.

Launch your bluetooth module into AT mode to configure its settings.You should be able to tell what baud rate your bluetooth module runs on. (documentation upon purchase). Otherwise, try to run it in 38400 baud.

Ultimately, use the

AT+ORGL

to reset to your original settings. WARNING: THIS WILL RESET ANY AT MODE CONFIGURED BEFORE.

then, set the UART to 9600 Baud

AT+UART=9600,0,0

You should be able to see the

OK

message to confirm your settings.

Nice.

Those who don't know what I was talking about, allow me to suggest you about a few minutes to a few hours of browsing on instructables to configure your bluetooth module. If you need my help, pat my shoulder by leaving your comments below.

Connect Your GPS Module to Your Computer

This step is critical to check if your GPS works, and also to encourage yourself to move on in this instructable.

The NEO-6M should have 4 pins. Connect accordingly:

NEO6M VCC to 5V Arduino

RX to TX

TX to RX

GND to GND

For those who dont know where the heck is TX and RX on your Arduino, just put them on 11 and 10 respectively. Traditionally, you are supposed to put on 0 and 1 but 4 years of experience got on my nerves that they do not work all the time because of their 3.3V output signal.

Okay.

Now, open the example sketch you may find in your examples folder, or doing it the easy way:

#include

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only }

mySerial.begin(9600);

}

void loop() { // run over and over if (mySerial.available()) { Serial.write(mySerial.read()); } if (Serial.available()) { mySerial.write(Serial.read()); } }

What I am doing here is that I am telling the Arduino that "Hey, the GPS is going to dump some data to you, here are some instructions on how to receive them. Also, they are dumping it at a rate of 9600 Baud."

Ok. Upload the code.

Check Your GPS Status

dfg.JPG

Now, this step is where you check the GPS status.

It is very very important to close every Arduino IDE window, every-single-one-of-them. No exceptions. Unplugging your Arduino is unnecessary.

Go to u-blox's website to find u-center. This is the software that converts NEMA protocol RAW data into the nice GUI form where you can think that you are a cool looking spy for a moment, but basically you are just looking at dots and numbers.

Once you have downloaded u-center and installed it, and also opened it, you should be able to see some flashy images. Otherwise, let me suggest you some settings to play around.

On the menu bar, go to Tools >Port, make sure that your u-center is connected to your Arduino by witnessing any "COM 1" or any number possible. Also, check if your Tools> baud rate is 9600, or you could set it to Tools> autobauding for convenient sake.

You should be getting something at this point.

Connect Your GPS to Your Bluetooth Module

Here you connect your GPS to your bluetooth module.

Using basic electronic knowledge, connect:

NEO6M TX > RX Bluetooth

RX> TX

It is fine to power both module at 5V.

Both modules should be blinking some lights at this point. Do check.

Connect Your Bluetooth to Your Android Device

sdfhg.JPG

This step will tell you how to interface your bluetooth GPS with a third-party app.

There are a few apps that could work with the hardware. Allow me to recommend Bluetooth GPS.

Download the app to your device and run it.

At this point, go to your Settings in your Android enabled device to pair your bluetooth module, Go back to the Bluetooth GPS app and press connect at the top right corner. This will commence the connection between the bluetooth module and your Android device. The data should come pouring in.

A troubleshooting tip I could suggest is swipe left on the app to find View log to see if any data came in. Gibberish data should indicate that your bluetooth connection is okay but your baud rate may be the problem here.

Conclusion and Recommendation

Now that you have a working bluetooth module, should you give yourself a round of applause.