Introduction: Arduino Ublox GPS

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.

Comments

author
CristianS105 (author)2017-03-11
author
WillieM28 (author)2017-02-02

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,

author
FatCorp (author)WillieM282017-02-19

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

author
msuzuki777 (author)WillieM282017-02-02

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

LOG

author
WillieM28 (author)WillieM282017-02-02

cant seem to attach images here:

https://goo.gl/photos/yUoUJjKRZe2XvA2t6

author
TECH644 (author)2017-01-07

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.

author
msuzuki777 (author)TECH6442017-01-11

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

author
TECH644 (author)msuzuki7772017-01-11

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.

author
rocketride (author)2017-01-11

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.

author
rocketride (author)rocketride2017-01-11

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.

author
msuzuki777 (author)rocketride2017-01-11

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

author
rocketride (author)msuzuki7772017-01-11

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.

author
VishalP103 (author)2016-12-16

I want to read latitude and longitude from gps module but it's not working.The light on the module blinks but still no luck.I used the code from following source https://github.com/LessonStudio/Arduino_GPS/blob/master/Arduino_GPS.ino.And i have attached the image Serial monitor output too. Did i solder the pins on wrong side of the PCB?

IMG_20161216_173109950[1].jpgIMG_20161216_173122673[1].jpgIMG_20161216_173133957[1].jpg
author
msuzuki777 (author)VishalP1032016-12-16

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

author
BWMike made it! (author)2016-11-26

Nice tutorial! Thanks!

I also found handy u-center user guide at:

https://www.u-blox.com/sites/default/files/u-cente...

There is a lot of basic information about the u-center you need to know at the beginning (receiver connecting and settings).

BWMike

IMG_20161127_003541.jpg
author
Radionics (author)2016-11-06

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!

author
Radionics (author)Radionics2016-11-06

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!!

author
msuzuki777 (author)Radionics2016-11-06

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

author
Radionics (author)msuzuki7772016-11-06

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!

author
hugovanleeuwen (author)2016-09-01

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
author

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

author

Thanks! I have tried that and given the fact that I can see its version, I assume that the connection between the Arduino and de GPS sensor works.

Today when I tried it in the train home it was giving the time again like yesterday.

TinyGPS++ 3.png
author

Serial monitor shows:

TinyGPS++ 2.png
author

When I swap wires Serial Monitor gives this:

TinyGPS++ 4.png
author
BillyM71 (author)hugovanleeuwen2016-10-27

I had a similar problem. Even when it was connected to satellites (4) it said INVALID. I went through the code and commented out the check on location, so it looked like this, and it gave me the correct coordinates, so I guess that for me it was a problem with gps.location.isValid()

//if (!gps.location.isValid())

{

Serial.print(gps.location.lat(), 6);

Serial.print(F(","));

Serial.print(gps.location.lng(), 6);

}

/*else

{

Serial.print(F("INVALID"));

}*/

author

The version 0.92 is coming from the TinyGPS software library and doesn't have anything to do with the GPS.

However, I think you're right that the time is coming from the module. It looks like you're not seeing any satellites. You might try wiggling the antenna connection and trying it outside. I'm not sure about your location but you should probably see 3 or more satellites.

The only other thing I can think of is maybe you have a defective GPS.

LOG

author

It works now! I did wiggle the antenna connection but I don't know if that was the problem. I notice that when I start the program outside it works even when I take it inside while it is already working, it keeps working. When I start de program inside it doen't work even when I take it outside. So I have to start it outside.

Thanks a lot for your help!

author

Not quite sure what's going on but glad you got it working. If I remember correctly you need a minimum of three satellites to get a lock but 4-5 is better. Anyway, sounds like it's working for you.

LOG

author

As soon as I go insite gps.satellites.value() becomes 0. It keeps giving information dough, which can not be recent information. Well, I'm planning to use it outside anyway.

author
nidane (author)2016-09-15

My project graduation is robot can go to the place I specify him by the GPS. Can you help through your experience Choose type of GPS can implement in my project. The other question Should I use a compass and what benefit? Thank you.

author
msuzuki777 (author)nidane2016-09-16

Just about any GPS should work. Yes, you will need a compass.

Basically, as I see it, you must find the current location of the robot (longitude and latitude), then calculate the direction and distance to the desired location. The compass is necessary to point the robot in the correct direction.

You might find another of my Instructables helpful:
https://www.instructables.com/id/CarTracker/

LOG

author
nidane (author)msuzuki7772016-09-19

Hi again.

My problem is unavailable type of gps that you used . Can I use other types u-blox Neo Or Leo?

Example SKM35 GPS module , SR-87 GPS module, Raspberry pi GPS, GPS module breakout board with SD interface.

Or I will need to add other devices to implement my project.

Thank you for your help.

author
msuzuki777 (author)nidane2016-09-20

Just about any GPS with serial interface should work. I haven't used any other type tho.

LOG

author
GiannisT5 made it! (author)2016-08-05

Hello I have a problem with arduino ublox 6M. I have this code and this are the results from arduino monitor.But sometimes screen is white or have ** . I need a code which give only latitude and longitude. Is anyone who know from code ? and can you help me ? Thank you . I am new from arduino and i know little things.

13872479_1279965075355343_165327342_n.jpg13590292_1264869553531562_6961506195003007542_n.jpg
author
CalebB39 (author)GiannisT52016-08-16

The serial monitor is set to 9600b/s while the code is transmitting 115200b/s. On the right of the serial monitor is is a drop down, choose 115200 baud.

author
msuzuki777 (author)GiannisT52016-08-05

Sorry, I can't read your code. Latitude and Longitude are present in your first picture

Latitude: 40 degrees 36.45545 minutes, N

Longitude: 22 degrees 58.81618 minutes, E

I use an Arduino library called TinyGPS++

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

There is an example of how to get Latitude and Longitude.

I used it in this Instructable:

https://www.instructables.com/id/MonkeyDogTracker/

LOG

author
GiannisT5 made it! (author)msuzuki7772016-08-05

Thank you my friend. This is my code. The problem is : i must put one IF in my code. Example

If lat=36.45545 and lon=58.81618

Serial.Print (" Car coming " )

else

Serial.Print ( " Car no coming")

How can i do this ? Can you help me ? Because i dont know how can use only latitude and longtitube from information (first picture) . Thank you very much

Χωρίς τίτλο.png
author
msuzuki777 (author)GiannisT52016-08-05

Using TinyGPS++ the latitude is

gps.location.lat() and longitude is

gps.location.lng()

so you could say

if ( (gps.location.lat()==36.45545) && (gps.location.lng()==58.81618) )

Serial.Print (" Car coming " )

else

Serial.Print ( " Car no coming")

however, I don't think this will work because the GPS would have to be at that exact location. You would need something like this

if ( (gps.location.lat()<36.45550) && (gps.location.lat()>36.45540) && ...(similar for longitude)

There are two issues, one is that a GPS won't read exactly the same latitude and longitude every time and two, your GPS won't be at exactly the same location anyway. You have to put in a range of values to adjust for this. I have no idea how big arrange you will need. What I would do is try different ranges until you find one that works for your needs.

LOG

author
GiannisT5 made it! (author)msuzuki7772016-08-07

I use TinyGPS.h . Must i downloading TinyGPS++.h ? This is my code with your tips. I download TinyGPS++.h 94b from this site http://arduiniana.org/libraries/tinygpsplus/ . What can i do to you use it ? because i add winzip library and code cant start.

Screenshot 2016-08-07 12.49.36.pngScreenshot 2016-08-07 12.49.48.png
author
msuzuki777 (author)GiannisT52016-08-09

You are probably using a newer version of Arduino. It's ,more complicating than it used to be.

The way I do it is to download the zip file. (Leave it as a zip file)

Open Arduino

Under
<Sketch><Include Libraries><Add .zip library…>

then find where you download the zip file and click on TinyGPSPlus-0,94b.zip

It should install to your Arduino.

LOG

author
jerry.ericsson2 (author)2016-07-15

One thing about those pins that I discovered long ago. I used to just solder them in right off when I received the product so the device would be ready for me when ever I wanted to pick it up and play with it. Then I discovered that you don't need to solder them in at all. Most of the time now days when I decide to make a project it is going to stay that way for the rest of it's life, so I simply solder wires in and hook the device directly to the holes in the arduino's (I like to buy the Uno's that have the empty rows where you can solder in the male headers if you wish.) Just a suggestion, works great for me then the Arduino is still able to be hooked to shields or what ever as well as running the device in question.

author
usmanshahid86 (author)2016-06-24

Thanks for the detailed instructions. They were of great help while setting up my project. I have having a weird on-board battery draining issue with my NEO-6M module. When the module is powered off at night, the on board battery gets drained and when reconnected with arduino in the morning, the module recharges itself for a couple of hours and then locks the GPS. I am using Arduino Uno and have set-up the project exactly as instructed. Can you point to the mistake I am making here?

Thanks.

author
msuzuki777 (author)usmanshahid862016-06-25

That is a strange problem. I don't know for sure but my guess is you have a bad NEO-6M module. I would think the when you powered it on in the morning it would take very long at all to recharge so maybe the battery is dead. Another possibility is the charging circuit. There is a diode that prevents the module from discharging when power is off so the diode may be backwards or defective.

Anyway I would first suspect a bad module as I can't imaging anything in your circuitry that could cause the battery to discharge.

LOG

author
Ido Ran made it! (author)2016-06-19

Thanks to this Instructables it was literally minutes to connect the NEO-6M GPS module to Arduino and get GPS readings.

The only thing I'll improve is explain that the readings are best done out-door and that the first "cold-boot" can take several minutes to find the satellite.

IMG_6989.JPG
author
msuzuki777 (author)Ido Ran2016-06-19

Glad it worked!

LOG

author
Ido Ran (author)msuzuki7772016-06-20

There was another issue actually - the baud rate of the NEO-6M I got was 9600 and not 4800 like TinyGPS++ come with.

Also the RX and TX were "reversed". I'm not sure but maybe they are marked wrong on the board itself. Anyway, flip them seem to do the job.

author
msuzuki777 (author)Ido Ran2016-06-21

I think my GPS was 9600 baud also.

As to Tx and Rx, the 'standard' is that the Tx from one device connects to the Rx of the other device. Unfortunately, in the Arduino world this is not always true. I usually try it one ways and if it doesn't work, swap it.

LOG

author
gregoryfenton (author)2016-04-30

I have done this on my quadcopter (an XK Detect x380) which has the UBlox 8 module built in.

I wanted some way of tapping into the GPS so I could find the quadcopter should it become lost.

Combining this with a MediaTek LinkIt ONE means that I can send a SMS text message and find the quadcopter should it become lost.

Powering the LinkIt ONE from a separate battery to the quadcopter means that should a crash cause a power failure the LinkIt ONE will still be able to report the last position, and as the GPS unit updates 5 times per second it will be extremely close to the reported position.

I will do a full instructable in the near future once my quadcopter rebuild is complete.

#ublox #mediatek #linkit #linkitone #gps #quadcopter #multirotor #frankencopter #s500 #XKDetect #x380

author
msuzuki777 (author)gregoryfenton2016-04-30

Wow, sounds pretty cool. That LinkIt ONE looks pretty amazing.

I think in the U.S. we are supposed to fly quadcopters only within line of site, so this feature wouldn't be of much use, but still like it.

LOG

author
msuzuki777 (author)gregoryfenton2016-04-30

Wow, sounds pretty cool. That LinkIt ONE looks pretty amazing.

I think in the U.S. we are supposed to fly quadcopters only within line of site, so this feature wouldn't be of much use, but still like it.

LOG

About This Instructable

252,607views

141favorites

License:

Bio: Lazy Old Geek
More by msuzuki777:Senior MomentsWeather Station 5IP Time Clock Part 2
Add instructable to: