Arduino Ublox GPS

284,272

155

97

Published

Introduction: Arduino Ublox GPS

About: Lazy Old Geek

So this Lazy Old Geek (L.O.G.) was looking for a GPS for an Arduino project. Well, I found this UBLOX-NEO-6M GPS on ebay:

http://www.ebay.com/itm/Ublox-NEO-6M-GPS-Module-with-EEPROM-and-Built-in-Active-Atenna-APM2-5-APM2-0-Com-/251548034492?pt=LH_DefaultDomain_0&hash=item3a916e65bc

WARNING: I think I actually ordered this one but the one I got was slightly different. The connectors were not as shown but centered on the PCB.

The antenna is attached to the PCB with a little snap on coax connector. It can be carefully lifted off to disconnect.

The metal shield on the antenna should be pointed down. You can buy cases for the antenna. You can also use double sticky tape to stick the antenna to the bottom of the GPS pcb.

Step 1: Arduino

The Ublox NEO-6M GPS is fairly easy to use with Arduino.

There are a few options for Arduino GPS libraries. I chose TinyGPSPlus:

http://arduiniana.org/libraries/tinygpsplus/

There is also a TinyGPS, I believe written by the same person.

You also need to include SoftwareSerial.h to use this library.

Hardware: Some of the UBLOX NEO-6M modules come with a loose 4pin header. These can be soldered in with pins going in either direction. Unfortunately, I put some on the wrong side for another project and had to unsolder them and put some new ones on the other side.

TIP: I saw a picture of someone using these types of clips (see picture) so that you don’t have to decide ahead of time.

Connect the four pins from UBLOX to an Arduino as follows:

Ublox - Arduino

GND - GND

TX - Digital pin (D4 in the DeviceExample)

RX - Digital pin (D3 in the DeviceExample)

Vcc - 5Vdc or 3.3Vdc

Now you can start up your Arduino environment and run the TinyGPSPlus example called DeviceExample.

In the sketch, change GPSBaud = 9600

Should work fine.

TIP: Here is one thing you need to remember, the TX pin from the UBLOX goes to the RX pin of the Arduino and vice versa.

TECHNOBABBLE: The explanation for this is not so bad. TX stands for Transmit where data is sent out. RX stands for Receive where data comes in.

So the UBLOX-TX sends data to the Arduino-RX

And the UBLOX-RX receives data from the Arduino-TX

HINT: While the standard is to label pins from the perspective of the device, this is not always the case.

Step 2: U-center

So this works pretty good.

But I’m a Geek and the UBLOX-NEO-6M supports something called WAAS, Wide Area Augmentation System.

So standard commercial GPS are not really precise. A particular reading may be several meters off. Using WAAS is supposed to improve the precision.

Ublox is a Swiss company. Here’s their website:

http://www.u-blox.com

Documentation for this product is a little hard to find:

http://www.u-blox.com/en/download/documents-a-resources/u-blox-6-gps-modules-resources.html

but everything under NEO-6 series should be applicable.

Okay, now I’m a Geek, but most of this stuff is over my head. So I did a lot of Internet searching and guessing.

Most GPSs are basically serial devices. Most are set for a baud rate of 4800 (these Ubloxs are set for 9600). They use a standard called NMEA 0183:

http://en.wikipedia.org/wiki/NMEA_0183

I think most GPSs when powered up will automatically start sending out data typically every two second.

Okay, according to the U-blox6_ReceiverDescriptionProtocolSpec, the Ublox supports both NMEA 0183 (that’s why it works with TinyGPS) and their own UBX protocol.

NOTE: I think WAAS is only used in the U.S. I think Europe has or will have something similar.

I haven’t found any standard way of activating WAAS or even determining if it is activated. But Ublox has some PC software called: u-center

http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html

This is really nice free software and even has a manual but for this Lazy Old Geek it’s still very confusing.

Well, the first thing I had to figure out was how to hook it up to the Ublox-Neo-6M GPS.

So PCs and laptops no longer have serial ports (besides the Ublox is not RS-232 compatible) but they have USB ports and I have several PL2303 USB modules that convert serial to USB. I hooked mine up as follows:

PL2303 - Ublox

Gnd - Gnd

Rxd - Tx

Txd - Rx

3.3V - Vcc

NOTE: Notice that RXD connects to TX and Txd connects to RX as previously discussed.

HINT: You can alternately connect the Ublox Vcc to 5V.

Step 3: Using U Center

PROBLEM: So I connected my Ublox-neo-6m to my PL2303, plugged the PL2303 into a USB port on my laptop and powered it up. Well, Windows started up fine, but my mouse movement was erratic and I couldn’t control it. Well, (I’m pretty sure), the laptop thinks I have a serial mouse connected.

SOLUTION: Well, first, I tried disconnecting the PL2303 until after the laptop loaded up Windows. Still did the same thing.

So what I have to do is leave the PL2303 connected but disconnect power to the Ublox. Then power up laptop to Windows, then connect power to the Ublox.

Hopefully, you won’t have this problem.

Okay, so once the Ublox has power it takes a minute or two for it to get started. (I guess this is called a cold start). The green LED on the Ublox will start flashing.

Click on the Ucenter icon.

Click on ReceiverPort Select the COM # that your PL2303 comes up as. Mine is COM 5.

Click on Receiver Baudrate Select 9600.

You should see some activity on the right side of the screen(see picture)

Note: on the bottom, it shows Com5 9600 ublox 6 and NMEA

The screens in the middle show satellite information.

The screen on the right shows latitude, longitude and altitude.

Note: FixMode is 3D/DGPS.

Differential Global Positioning System (DGPS) means WAAS is working.

HINT: Especially indoors, this may just say 3D. Also the DGPS may take several minutes before it displays.

Configuring the Ublox Neo-6M. The way I did it is:

view -configuration view(see next picture)

NAV5

Nav Mode

Dynamic Model: Pedestrian

Fix Mode: Auto 2D/3D

UTC Standard: USNO(GPS) {Doesn’t save??}

Click on send lower left corner

NOTE: Pedestrian mode probably won’t make much difference but for my application it is more accurate. See ProductSpec

view-configuration view (see next picture)

Subsystem: Enabled

Services: Ranging

Apply SBAS Correction data

Number: 3

PRN Codes: WAAS

Click on send lower left corner

NOTE: This forces WAAS. The more general term is SBAS(Space Based Augmentation Systems)

NOTE: There are other configurations you can change like Baud rate and sampling rate.

Okay, the two sends above send it to the Ublox GPS but it doesn’t save it. To save, do the following.

(see next picture)

Main menu

Receiver

Action

Save config

This saves it to (I believe) the EEPROM on the Ublox-neo-6m pcb.

WARNING: Close ‘u-center’ before disconnecting GPS. Otherwise u-center will lock up and you will get a Blue screen.

The next picture shows the Deviation Map. Each GPS sampling shows in yellow, which changes to green when the next sampling occurs. This shows the readings have drifted about two meters.

U-center has a lot of other features, one I like it Google Earth. It will show the GPS location on Google Earth.

So that’s what I’ve learned about the Ublox-neo-6m so far.

5 People Made This Project!

Recommendations

  • Water Contest

    Water Contest
  • Creative Misuse Contest

    Creative Misuse Contest
  • Oil Contest

    Oil Contest

97 Discussions

hello all,

i have this ublox neo7 gps/compass unit. it gave me issues on my copter so i benched it last summer... i removed the wiring harness for troubleshooting, gave up and never replaced it...

now i have this unit i want to play with but i dont know the pinout of the board...

it has marked L, A, V, R, T, & G.... i can GUESS that T=Tx, R=Rx, maybe V=Vcc (voltage) and maybe G=Grnd?? the other for compass maybe??

any help would be great, this is just for fun, no project waiting or anything..

here is the link i bought itfrom last year:

https://www.amazon.com/gp/product/B017BAYNYA/ref=o...

and here are some pictures of the unit,

3 replies

Most probably, L stands for SCL(clock) and A stands for SDA(data) of the compass. The I2C pins :)

Sorry I've never worked with this one but your guesses sound good.

LOG

cant seem to attach images here:

https://goo.gl/photos/yUoUJjKRZe2XvA2t6

Does anyone know where I can find a coaxial connector that will mate the antenna input on the NEO-6M? I want to connect an antenna farther away with a longer cable. I think the connector is made by HiRose but was unsuccessful in finding one.

2 replies

I think those connectors are called u.fl. Ebay has some cables with u.fl primarily for laptop wifi cards but I think they'll work with GPS.

LOG

Thanks for the tip. I searched eBay and found listings for the connector jacks from Taiwan, very reasonable even with shipping. I also found the plugs on Mouser's website for $1.53 ea. Coax for these is a little pricey at $2.70/ft. Digikey has complete cable assemblies, also pricey at $9.00 for a 1 meter length. Several options to choose from.

The standard NMEA sentences don't seem to yield any altitude information. Is there a way to coax altitude info out of the chipset on this or any Ublox module? I don't need any of the waypoint or ETA- related stuff, just UT time and date, latitude, longitude, and altitude.

3 replies

Never mind. I found the TinyGPS++/Arduiniana site and its functions include one for pulling altitude data. (f anyone knows of any modules tha it specificaIly won't work with, please LMK. I just didn't want to buy a module and then discover that there was some weird and arcane barrier to getting the altitude info from it.

I would think any GPS that supports NMEA would have altitude.

Warning: From what I've read you need lots of satellites to get good altitude. I think five is the minimum.

LOG

And, it turns out that you are right. I was looking at the NMEA specs way too late last night and just didn't notice that the GGA sentence, among others, does have an Altitude field. That's what I get for putting off the hobby stuff off until bedtime-- after the important stuff is done.

It's not clear in the picture but do you have Ground connected on your Arduino? If so, then my best guess is that you have Tx and Rx reversed so I would try switching 10 and 11. Hope this works.

LOG

Hi

I have an issue maybe you guys can help me with.

I have a total of 20 units here for a project.

- All units connect to u-center at 9600baud using FTDI adapter.

- All units allow me to change NMEA,UBX and configuration messages and save correctly. Namely NAV POSLLH, pedestrian, rate etc

- 17 of the units are showing GPS position updating and satellite numbers

and the LED flashes to show its getting fix/positional info. Pass.

- 3 of the units are not showing GPS position updating and no satellite numbers.

In those fact you can see the satellite blue boxes light up for a fraction of a second then go to gray. The led that flashes usually when you get data is not lit.

Are the 3 units faulty? I have tried swapping an antenna off a working one to no avail. There is obviously power going in and its working as expected on the serial end as I can update and save...

Units are

Board Part number GY-GPS6MV2

UBLOX IC

NEO-6M-0-001

1510

0300 22

Any help appreciated! Thanks!

3 replies

Hi

Just an update. It turns out the 3 antennas ARE fault.

I retested using a replacement antenna and they work now!

I desoldered the sheilding on the back of the faulty antennas to check the continuity of the coax...and yep the center core is open circuit.

I am hoping I can reterminate this tiny connection!!

Hey, great job on figuring that out. I wonder if the seller will send you replacements. I'd also keep an eye on the other antennas as it sounds like they're not very good quality.

LOG

Look I guess its not the seller's fault...just shotty chinese cr8p lol. I think the issue is also dont put too small a radius on the bend on the cable....I've replaced the leads from old laptop wireless modules (the connector and wire and resoldered onto the antenna....now I get 3D fix!! yay!

My GPS sensor doesn't work. Yesterday I got the time, which was correct, but no location. Most of the time it just gives INVALID and 0.

Serial.println(TinyGPSPlus::libraryVersion()); gives 0.92 so I guess the SoftwareSerial does work.

Any idea what could be wrong? Thanks!

TinyGPS++.png20160901_094523.jpg
1 reply

I'm not really sure but I would try a couple of things. First swap the TX and RX pins, see if that makes a difference.

Second, I would try GPSBAUD =4800

I think some devices may default to 4800.

LOG