Emlid Reach to Arduino Uno?

I have just been using Reach-view for most of the configuration, but now I am ready to start using my GPS coordinates. I had another code(attached) from an Arduino sample using the tinyGPS library that I am retrieve and parse the NMEA strings. I figured it would be just as easy as hooking the TX(white?) pin from the Emlid to the rx pin i had set on the Arduino using software serial.

Reach & Arduino are being powered by USB from my computer.

Reach position output settings
UART
57600
NMEA

Reach Firmware: 1.2

I have the TX pin from reach(white?) connect to pin 4 on my arduino.


Could there be something with the logic voltage? Doesn’t Arduino run at 5v logic and reach is at 3.3v? I don’t know if that make a difference or not.

CODE:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
/*
   This sample code demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) 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).
   
LC20031 pinout(Top View *pins down*  L to R 5 to 1 
  GND-5
  GND-4
  TX-3
  RX-2
  3.3V-1


Emlid Reach 
Power Reach Via the USB cable 
White-GPS RX
Blue GPS TX
 
*/
// The TinyGPS++ object
TinyGPSPlus gps;
int i=0;
// The serial connection to the GPS device 
SoftwareSerial ss(3, 4);// GPSTX to 4, GPSRX  to 3  // this part go switched around and may be the issue k

void setup()
{
  Serial.begin(9600);
  ss.begin(57600);//GPS Baud Rate

  Serial.println(F("GPS SatsLatLong"));
  Serial.println(F("Outputs Latitude and longitude"));
  Serial.println(F("Jake Falck"));
  Serial.println();
  

}

void loop()
{
  while (Serial.available() < 1) {} // Wait until a character is received
char val = Serial.read();
Serial.flush();
if (val == 'g'){
   Serial.println(F("Sats Latitude   Longitude"));
  Serial.println(F("     (deg)      (deg)    "));
  Serial.println(F("-------------------------"));
  printInt(gps.satellites.value(), gps.satellites.isValid(), 5);
  printFloat(gps.location.lat(), gps.location.isValid(), 11, 6);
  printFloat(gps.location.lng(), gps.location.isValid(), 12, 6);
  Serial.println();
  Serial.println();
  i++;

}
  if (millis() > 5000 && gps.charsProcessed() < 10)
    Serial.println(F("Error: GPS data received(check wiring)"));
}

// This custom version of delay() ensures that the gps object
// is being "fed".
static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

static void printFloat(float val, bool valid, int len, int prec)
{
  if (!valid)
  {
    while (len-- > 1)
      Serial.print('*');
    Serial.print(' ');
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1); // . and -
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(' ');
  }
  smartDelay(0);
}

static void printInt(unsigned long val, bool valid, int len)
{
  char sz[32] = "*****************";
  if (valid)
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  smartDelay(0);
}

static void printDateTime(TinyGPSDate &d, TinyGPSTime &t)
{
  if (!d.isValid())
  {
    Serial.print(F("********** "));
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d ", d.month(), d.day(), d.year());
    Serial.print(sz);
  }
  
  if (!t.isValid())
  {
    Serial.print(F("******** "));
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d:%02d:%02d ", t.hour(), t.minute(), t.second());
    Serial.print(sz);
  }

  printInt(d.age(), d.isValid(), 5);
  smartDelay(0);
}

static void printStr(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  smartDelay(0);
}

Do not forget to connect GND on Reach to GND on Arduino.

1 Like

I didn’t realize I have to do that. What is the reason for that? I figured since its getting powered by the usb cable I just had to plug in the tx and rx pins.

Tried that, didn’t do anything different.

First up, make sure you don’t dual supply power. If reach is powered via USB, DO NOT put 5V on the GPIO 5V. Ground is ok, and from what I’ve read necessary for serial comms to work.

Second up, TX on reach goes to RX on Uno, and likewise for RX reach to TX Uno, although I just saw you’ve already done that. Pinouts are here, you are correct that white is RX. I’m pretty sure it doesn’t matter about the logic voltage, my Mega works fine with it, and reach is 5V tolerant.

Looking at my UNO and your code, I see you are using software serial. This is because you are connected to PC via USB I guess. Software serial is a pain, but should work. (Have a look at NeoSoftwareSerial and similarly NeoGPS).

On a different note, have you checked your baudrates? I see in your code reach is at 57600, USB Serial is at 9600 and software serial, ss is at 57600. That should be fine I guess.

You haven’t really said what your error is yet. If you are getting the “Error: GPS data received(check wiring)”, does reach have satellites, and is outputting NMEA over Serial out?

Give us some more information on what the problem is and we can we what else we can suggest. Good Luck!

I did the same connections as he showed in the picture and run the same program he mentioned but my emlid reach rtk is not reading any GPS co-ordinates. Already checked the baud rates and reach satellites as well. Please let me know if you have any suggestions. Thanks guys!

Did you try to connect both rx and tx? I think other than hs ss needs both if you do not adapt the library.

i got the co-ordinates some how by using other program but i wanted to connect this emlid reach to raspberry pi CM 3, as I’m not a good programmer in python could you please help me out. Thanks for your response mate! Cheers!

I think you can just copy this:

https://www.electronicwings.com/raspberry-pi/gps-module-interfacing-with-raspberry-pi