GPS & GLCD help

Ok, I am fairly new to Arduino, but have been researching and have learned a LOT. I am not new to electornics, just to programing.

I have a project that I am trying to do, and can’t for the life of me get the sketch figured out. What I am trying to do is gather GPS data, parse it, and display it on a GLCD. This has been done a lot with 16x2 LCDs, but I want more data on the screen so I opted to use a larger screen (Serial GLCD) to show everything at once. I have got the GPS working with the example, and have got the GLCD working with an example as well. Now I am trying to combine them, and can’t get anything to show on the Serial GLCD at all!

Hardware is as follows:

Arduino Uno R3
Copernicus ll GPS module (connected to pin 2 on Uno)
Sainsmart 128x64 Serial GLCD (connected to pins 7,8,9 on Uno)

I am using TinyGPS and U8Glib libraries along with Software Serial.

I am a smart guy, and can usually figure things out pretty easily, but this issue completely eludes me.

I have attached the sketch for the Serial GLCD that I used to test it, and to set the locations of all the data I am wishing to display in hopes that it will help paint a picture of what I am trying to do.

Thanks in advance for any help.

Nate

GLCD_TEST.ino (603 Bytes)

If you remove the reference to the GPS library does the screen start working?

i.e the code you posted doesnt seem to use the GPS at the moment

The only think I can think causes these issues if when 2 different libraries both use the same internal timer, but it seems odd that either would use the a hardware timer

No, the sketch I posted is just for the GLCD. that is what I used to test the display, and set up where I wanted everything to print to.
I tried to combine it with a GPS sketch, and nothing.

Here is the sketch I started to write for reference.

GPS_Telemetry_in_progress.ino (1.94 KB)

anyone else??

Can you detail the pin configuration of the GPS and GLCD ..

GPS (Copernicus ll) is pinned as follows:
vcc on module to 3.3v on Arduino,
GND on module to GND on Arduino,
D1(TX) on module to pin 2 on Arduino

GLCD (Sainsmart 128x64 serial GLCD) is pinned as follows:
VCC on GLCD to 5V on Arduino,
Gnd on GLCD to GND on Arduino,
Sck on GLCD to pin 7 on Arduino,
CS on GLCD to pin 8 on Arduino,
SID on GLCD to pin 9 on Arduino

The SCK, CS, and SID may be switched around, but it wirks with my GLCD Test sketch, so I don’t think it will matter as long as the sketch matches it.

You have Serial.begin() in the setup() function, but never print anything in loop(). Why not? How do you expect to know what you are getting from the GPS? How do you expect to know if you are getting anything from the GPS?

Ok, I have made some progress,

I now have all my static data printing perfectly.

I also have my variables(GPS Data) printing, but it is all comming out as 0’s???

I have attached an updated sketch.
Any ideas???

Thanks

GPS_Telemetry_in_progress08_26_14.ino (1.85 KB)

I still don't see any Serial.print() statements. Maybe your GPS is outputting data that is all *s because it can't see any satellites.

Add a Serial.print() statement to show the character read from the GPS. Make sure that the GPS is spitting out meaningful data BEFORE you try to use the data.

Ok, good news, I have almost everything working. Right now, the only thing I can’t get to work is the date. All I get on both the GLCD and the Serial Monitor is “0/0/2000”.

I have a few things to do yet, such as ad leading 0’s to days, months, hours, minutes, and seconds <10, but other than that, If I can get the date to show, I think I will be in good shape.

I attached the sketch for you guys to look at,

Thanks

GPS_working.ino (2.86 KB)

ok, well I thought the speed and heading were not reading because It was not moving, but just took it on a road test, and still shows -1.00 for speed and 1000.00 for heading. I am not sure why???

I intailly recommend before doing all. Make ensure your GPs and Basic GLCD code working.

Gps code as below:

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(4, 3);

void setup()
{
  Serial.begin(9600);
  ss.begin(4800);
  
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
}

void loop()
{
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      // Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a new valid sentence come in?
        newData = true;
    }
  }

  if (newData)
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Serial.print("LAT=");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" LON=");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    Serial.print(" SAT=");
    Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
    Serial.print(" PREC=");
    Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
  }
  
  gps.stats(&chars, &sentences, &failed);
  Serial.print(" CHARS=");
  Serial.print(chars);
  Serial.print(" SENTENCES=");
  Serial.print(sentences);
  Serial.print(" CSUM ERR=");
  Serial.println(failed);
  if (chars == 0)
    Serial.println("** No characters received from GPS: check wiring **");
}

Library you get here for GCLD
http://playground.arduino.cc/Code/GLCDks0108
https://code.google.com/p/glcd-arduino/downloads/list

try to put snap shot of your serial monitor this time

My libraries are working fine, all the other data prints perfect in both the serial monitor and on the GLCD. Here is an updated sketch with the preceeding 0’s added (in the GLCD).

GPS_working.ino (3.2 KB)

And here is a pic of the results on the GLCD.

20140828_001819[1].jpg

Ok, I attached an updated sketch (I just moved the placement around and added direction).

I have come up with a theory, I think (and I will have to confirm this when I get to the house tonight) the GPS is configured to output in $GPGGA only. Thinking about it, that would justify the “0” readings in both the serial monitor and the GLCD, for date, heading, and speed - as those are not contained in the NMEA $GPGGA string. If that is the case, I should be able to reconfigure it to output both NMEA $GPGGA and NMEA $GPRMC, and that should get my missing fields populated.

What I gather from what I have read, is that I can remove the EEPROM from my Arduino Uno R3 and use it as an FTDI interface to reconfigure the copernicus II GPS module. Is this correct, or will I have to order an FTDI-USB board to do it?

Thanks

GPS_with_spacing.ino (4.83 KB)

Ok, well I got it all figured out. The problem was that the GPS module was configured to output GGA and VTG, but not RMC (which I needed for date, speed, and heading.
YAY!!