Pages: [1]   Go Down
Author Topic: RHT03 Sensor & LS20031 GPS Receiver Trouble  (Read 7012 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello there,

I am building a gps-data-logger which records temperature & humidity.
I am using the RHT03 Temperature & Humidity Sensor (5V / https://www.sparkfun.com/products/10167) and the 66 Channel LS20031 GPS 10Hz Receiver (3.3V / https://www.sparkfun.com/products/8975).

The RHT03 sensor output is corrupted when both components are powered, lots of check sum errors and ACK time outs (i am using this library https://github.com/ringerc/Arduino-DHT22/tree/f1c5b3ab1e6f274ec66ecee09df729224af1cf7d) and no proper values. When i unplug the gps receiver the RHT03-readings suddenly turn good, wenn I power the gps on again the readings turn bad again. RHT03 runs on 5V, GPS Module runs on 3.3V, both share GND.

Any suggestions how to run the GPS-Module and the RHT03 simultaneously and get good readings from the RHT03?

I work with Arduino 1.0.2 (on osx 10.6.8) and an Arduino Uno SMD.
Thanks in advance for any suggestions & answers

cheers, simon

EDIT: I wired the GPS module as descripted here (http://www.sparkfun.com/tutorials/176) so RX pin of the module is not connected to the Arduino
« Last Edit: December 13, 2012, 08:41:10 am by zonkzonk » Logged

0
Offline Offline
Shannon Member
****
Karma: 221
Posts: 12710
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to show us how everything is wired - for instance where's the GPS's 3.3V coming from (what maximum current does it draw - the
datasheet only gives "typical" values?)

How long are the wires connecting the humidity sensor to the Arduino?  Have you added the relevant decoupling capacitor on the supply
rails right at the sensor as recommended?  And the pull-up resistor on its output?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

thanks for your reply.
i drew a rough circuit diagramm (i`m pretty new to electronics and hope you can read it)
and added the Sharp Optical Dust Sensor (https://www.sparkfun.com/products/9689)
which also should be part of my logger. All sensors work perfectly fine standalone.

- The GPS draws about 26mA current max.
- The wires connecting the humidity sensor to the arduino are roughly 80cm/31.5inches long (for 2/3 of the distance i use this ribbon cable https://www.sparkfun.com/products/10647) - same with GPS and Dust Sensor.
- I did not add the capacitor and the pull-up resistor to the humidity sensor - i thought it is not neccesary since the sensor works
fine standalone without them. I should add them.

Any other suggestions?

thanks a lot for helping


* logger_circ.jpg (1251.86 KB, 1667x1136 - viewed 171 times.)
Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might want to try the following  (sorry I had to break it up in chunks) >>

Code:
/*
Purpose of this sketch(program) is to test communications between LS20031 and the Arduino UNO.
 Note: Not sure as to why but sometimes it takes unplugging the Uno from power supply and USB cable to get correct results.
       Also circuit diagram represents what get's grouped together, not actual diagram.
       
       Plus, you need to go into Arduino -> Libraries-> SoftwareSerial-> SoftwareSerial.h and increase buffersize from 64 to 128. >>
       Open the file named "SoftwareSerial.h" in a text editor and scroll down to line 42, where you should see:
            #define _SS_MAX_RX_BUFF 64 // RX buffer size
       Increase the value 64, to a more reasonable 128 and then save the file. See Wayneholder web page for more information>>
       https://sites.google.com/site/wayneholder/self-driving-rc-car/navigating-with-gps
           
The LS20031 circuit:
  • GPS Pin 5 :(left-most when viewed from above) : No connection (or ground)
  • GPS Pin 4 : to Arduino ground (GND) pin
  • GPS Pin 3 TX : to Logic Converter 2L
  • GPS Pin 2 RX : to Logic Converter 1L
  • GPS Pin 1 :(right-most when viewed from above) to Arduino 3.3V pin

The Logic Level Converter: (from DSSCircutis.com -I2C Level Converter- YES! it does UART (Push Pull) communications AND No need for external pullup resistors! -if you use this one!)
 See Text on Logic Level Converter break out board to identify correct pin. Datasheet for TXS0102 >> http://dsscircuits.com/i2c-level-converter.html
  • GND  Pin to : Arduino ground (GND) pin
  • 1H   Pin to : Digital Pin 4 on Arduino
  • 2H   Pin to : Digital Pin 3 on Arduino
  • VccH Pin to : Arduino 5V Pin

  • VccL Pin to : Arduino 3.3V pin
  • 1L   Pin to : LS0031 RX pin 2 (Viewing from right to left see- http://www.sparkfun.com/tutorial/AG_LS20031_GPS/ls20031_annotated_pins_normal.jpg )
  • 2L   Pin to:  LS0021 TX pin 3 (Viewing from right to left)
  • OE   Pin to : Arduino 5V Pin
 
The Pins used on the Arduino UNO:
  • RX is digital pin 4 (connect to TX of other device)
  • TX is digital pin 3 (connect to RX of other device)

 The template for this sketch came from >>
   SoftwareSerialExample by Tom Igoe
   based on Mikal Hart's example
   And modified by Blacklab1 1/08/2013.
 
 Note: Ideas for this sketch comes from Wayneholder - https://sites.google.com/site/wayneholder/
       and LadyAda web Tutorial >> http://learn.adafruit.com/adafruit-ultimate-gps/overview
       Thank you both for your hard work.
 This example code is in the public domain.
 */
//continued in next post

<< the LS20031 from sparkfun.com

<< the I2C Level Converter from dsscircuits.com

See http://dsscircuits.com/images/schematic/I2C%20Logic%20Level%20Converter%20Sample%20Wiring.pdf for Wiring Diagram

Note- I don't own either pictures, they are for reference only.
« Last Edit: January 29, 2013, 10:47:27 am by BlackLab1 » Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
////continued from previous post
#include <TinyGPS.h>
// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
#define PMTK_SET_NMEA_UPDATE_HALF_HZ "$PMTK220,2000*1C\r\n" // Every 2000ms (0.5Hz)
#define PMTK_SET_NMEA_UPDATE_1HZ  "$PMTK220,1000*1F\r\n" // Every 1000ms (1Hz)
#define PMTK_SET_NMEA_UPDATE_2HZ  "$PMTK220,500*2B\r\n>" // Every 500ms (2Hz)
#define PMTK_SET_NMEA_UPDATE_5HZ  "$PMTK220,200*2C\r\n"  // Every 200ms (5Hz)
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F\r\n"  // Every 100ms (10Hz)
/* If the command is correct and executed, GPS module will output message $PMTK001,220,3*30<CR><LF>
   Flag: '0' = Invalid Packet
         '1' = Unsupported packedt type
         '2' = Valid packet, but action failed
         '3' = Valid packet, and action succeeded
*/

#define PMTK_SET_BAUD_115200 "$PMTK251,115200*1F\r\n" // dont mess with any of these unless you know what your doing
#define PMTK_SET_BAUD_57600  "$PMTK251,57600*2C\r\n"  // if you do change these you have to use the last working baud rate
#define PMTK_SET_BAUD_9600   "$PMTK251,9600*17\r\n"   // to communicate with LS20031 then change back to desired setting
#define PMTK_SET_BAUD_4800   "$PMTK251,4800*14\r\n"   //

#define PMTK_Set_NMEA_OUTPUT_GLL       "$PMTK314,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GLL - Geographic position, latitude / longitude
#define PMTK_SET_NMEA_OUTPUT_RMC       "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only RMC - Recommended minimum specific Loran-C data
#define PMTK_SET_NEMA_OUTPUT_VTG       "$PMTK314,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only VTG - Track made good and ground speed
#define PMTK_SET_NEMA_OUTPUT_GGA       "$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GGA - Global Positioning System Fix Data
#define PMTK_SET_NMEA_OUTPUT_RMCGGA    "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on GPRMC and GPGGA ----- TinyGPS only uses these two, all others can be turned off
#define PMTK_SET_NMEA_OUTPUT_GSA       "$PMTK314,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSA - GPS DOP and active satellites
#define PMTK_SET_NMEA_OUTPUT_GSV       "$PMTK314,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSV - GPS Satellites in view
#define PMTK_SET_NEMA_OUTPUT_ZDA       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0*29\r\n" // turn on only ZDA - Date & Time - UTC, day, month, year, and local time zone.
#define PMTK_SET_NEMA_OUTPUT_RMCGAAGSA "$PMTK314,0,1,0,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n" // RMC, GGA, GSA at 1Hz and GSV at 0.2Hz
#define PMTK_SET_NMEA_OUTPUT_ALLDATA   "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on ALL THE DATA for the LS20031- except ZDA
#define PMTK_SET_NMEA_OUTPUT_ALLDATA2  "$PMTK314,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1*29\r\n" //
#define PMTK_SET_NMEA_OUTPUT_OFF       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn off output
/* If the command is correct and executed, GPS module will output message "$PMTK001,314,3*36<CR><LF>" See Flag upabove
  
  LS20031 uses the following Protocall >> GLL, RMC, VTG, GGA, GSA, GSV, ZDA supported NMEA messages
  
  Location:             Decription:
      0  NMEA_SEN_GLL,   // GPGLL interval - Geographic Position - Latitude longitude    
      1  NMEA_SEN_RMC,   // GPRMC interval - Recommended Minimum Specific GNSS Sentence
      2  NMEA_SEN_VTG,   // GPVTG interval - Course Over Ground and Ground Speed
      3  NMEA_SEN_GGA,   // GPGGA interval - GPS Fix Data
      4  NMEA_SEN_GSA,   // GPGSA interval - GNSS DOPS and Active Satellites
      5  NMEA_SEN_GSV,   // GPGSV interval - GNSS Satellites in View
      6  NMEA_SEN_GRS,   // GPGRS interval - GNSS Range Residuals
      7  NMEA_SEN_GST,   // GPGST interval - GNSS Pseudorange Errors Statistics
      13 NMEA_SEN_MALM, // PMTKALM interval - GPS almanac information
      14 NMEA_SEN_MEPH, // PMTKEPH interval - GPS ephmeris information
      15 NMEA_SEN_MDGP, // PMTKDGP interval - GPS differential correction information
      16 NMEA_SEN_MDBG, // PMTKDBG interval – MTK debug information
      17 NMEA_Sen_ZDA,  // ZDA - Date & time -- $GPZDA,hhmmss.ss,xx,xx,xxxx,xx,xx See  http://aprs.gids.nl/nmea/ >> Note: LS20031 seems not to know TimeZones.
                                                hhmmss.ss = UTC
                                                xx = Day, 01 to 31
                                                xx = Month, 01 to 12
                                                xxxx = Year
                                                xx = Local zone description, 00 to +/- 13 hours
                                                xx = Local zone minutes description (same sign as hours)
      18 NMEA_SEN_MCHN, // PMTKCHN interval – GPS channel status ---- info here >> http://snoob-community.wikispaces.com/PMTKCHN
                           decoding >>  $PMTKCHN,aabbc,...*XX\r\n
                                                 aa => SVid: Space Vehicle Id
                                                   bb => SNR: Signal to Noise Ratio
                                                     c => Status:
                                                          • 0 == Idle
                                                          • 1 == Searching
                                                          • 2 == Tracking
                                                          
  Example location:  0,1,2,3,4,5, , , , , , , , , , , ,17,18*??\r\n" for the LS20031
           "$PMTK314,0,1,0,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n" --- MTK NMEA checksum calculator -> http://www.hhhh.org/wiml/proj/nmeaxor.html
          Supported Frequency Setting
                  0 - Disabled or not supported sentence
                  1 - Output once every one position fix
                  2 - Output once every two position fixes
                  3 - Output once every three position fixes
                  4 - Output once every four position fixes
                  5 - Output once every five position fixes
           You can also restore the system default setting via issue: "$PMTK314,-1*04\r\n"
   */

#define PMTK_SET_SABS_INTERGITY_ON   "$PMTK319,1*24\r\n" //
#define PMTK_SET_SBAS_TEST_ON        "$PMTK319,0*25\r\n" //
#define PMTK_SET_WAAS_ENABLE         "$PMTK313,1*2E\r\n" // Enable to search a SBAS satellite--tells the receiver to search for a satellite that supports the Satellite-Based Augmentation System(SBAS)
#define PMTK_SET_WAAS_DISABLE        "$PMTK313,0*2F\r\n" // Disable SBAS satellite
#define PMTK_SET_DGPS_SBAS_ON        "$PMTK301,2*2E\r\n" // Enable WAAS as DGPS Source-- enables the receiver to use this information to correct the GPS fix into a DGPS fix.
                                                         // '0': No DGPS source
                                                         // '1': RTCM
                                                         // '2': 'WAAS'
/*  Note from Wayneholds web site:
    There are some fine points here, too:
      •Some receivers, such as those based on the MediaTek chip set can only make use of the WAAS correction information if the receiver is set to an update rate of 5 Hz, or less.  
          I found this tidbit buried inside a spec sheet after spending countless hours trying to figure out why I could not get a DGPS lock at the 10 Hz rate one of my receivers is capable of working at.
      •Some receivers, such as ones based on the SkyTraq Venus chip set require that commands be send in a binary format rather than a text-based format.
   Therefore, I strongly recommend that you spend some time getting familiar with the specifications and features available for your GPS module and that you experiment with,
   and test your receiver before you dismiss it as defective, as I did initially.  Hopefully, much of what I explaining in this section will be applicable to you, but your mileage may still vary.
*/
#define PMTK_Q_RELEASE "$PMTK605*31\r\n" /* Query FW release information -- MTK-3301s send firmware release name and version - Note: not sure of accuracy of this information */
  /* if the command is correct and executed, GPS module will output message example >> "$PMTK705,AXN_1.30,29BF,MC-1513,*0E"
     Data field >> "$PMTK705,ReleaseStr,Mod eID,,*0E"
     ReleaseSTr: Firmware release name & version
     ModelID: Model ID  
  */
//continued in next post
« Last Edit: January 29, 2013, 10:01:24 am by BlackLab1 » Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Note: if you look at the loop there are two programs in one. I have one REM-ed out. Just unRem out the first, and Rem the second to see first Program's results.  

Code:
//continued from previous post
#include <SoftwareSerial.h>
#define RxPIN 3
#define TxPIN 4
TinyGPS gps;
SoftwareSerial GpsSerial(RxPIN, TxPIN);

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  Serial.println("Start");
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.println("Goodnight moon!");
  
  // set the data rate for the SoftwareSerial port
  // 9600 NMEA is the default baud rate for MTK - some use 4800
  // LS20031 uses 57600
  GpsSerial.begin(57600); //Adafruit- 9600, Sparkfun- 57600
  
  GpsSerial.print(PMTK_SET_NMEA_OUTPUT_ALLDATA2); // $GPxxx Messages
  GpsSerial.print(PMTK_SET_NMEA_UPDATE_1HZ);     // messages 1 times a second
  GpsSerial.print(PMTK_Q_RELEASE);
      
}

void loop(){ // run over and over
     /*while (GpsSerial.available()){
       unsigned char cc = GpsSerial.read();
       if (gps.encode(cc)) {
          float flat, flon;
          unsigned long age;
          gps.f_get_position(&flat, &flon, &age);
          Serial.print("Lat: ");
          Serial.print(flat);
          Serial.print(", Long: ");
          Serial.print(flon);
          Serial.print(", age: ");
          Serial.println(age);
      }
   }*/
  
   if (GpsSerial.available())
    Serial.write(GpsSerial.read());
   if (Serial.available())
    GpsSerial.write(Serial.read());
  
}
--------------------------------------------------------- end of first program --------------------------------------------------------------------------------


If you got that working you might want to try Mikal Hart TinyGPS's modified example for the LS20031 (only).>>
     You STILL have to use the Logic converter between your Arduino and the LS20031- If you don't you could kill your LS20031.
     Also- you can use whatever Logic converter you want- just know I have killed a few of the cheap mosfet converter sitting on my desk.
     The http://dsscircuits.com/i2c-level-converter.html, one has survived my desk for 6 months and I haven't killed it.



NOTE: this can be used with Adafruit's LCD I2C backpack. It will work with out it. I have everything to do with the I2C backpack REM out. If you do you will need to get the LiquidTWI library from Adafruit if you want to try out the LCD- also I am using a 4x16 LCD with this.

(sorry I was forced to have to break up the following code).
« Last Edit: January 29, 2013, 11:21:17 am by BlackLab1 » Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include <SoftwareSerial.h>
#define rxPin 3
#define txPin 4
 
 /*you need to go into Arduino -> Libraries-> SoftwareSerial-> SoftwareSerial.h and increase buffersize from 64 to 128. >>
       Open the file named "SoftwareSerial.h" in a text editor and scroll down to line 42, where you should see:
            #define _SS_MAX_RX_BUFF 64 // RX buffer size
       Increase the value 64, to a more reasonable 128 and then save the file. See Wayneholder web page for more information>>
       https://sites.google.com/site/wayneholder/self-driving-rc-car/navigating-with-gps
  */    
#define PMTK_SET_NMEA_UPDATE_HALF_HZ "$PMTK220,2000*1C\r\n" // Every 2000ms (0.5Hz)
#define PMTK_SET_NMEA_UPDATE_1HZ      "$PMTK220,1000*1F\r\n" // Every 1000ms (1Hz)
#define PMTK_SET_NMEA_UPDATE_2HZ      "$PMTK220,500*2B\r\n>" // Every 500ms (2Hz)
#define PMTK_SET_NMEA_UPDATE_5HZ      "$PMTK220,200*2C\r\n"  // Every 200ms (5Hz)
#define PMTK_SET_NMEA_UPDATE_10HZ     "$PMTK220,100*2F\r\n"  // Every 100ms (10Hz)
/* If the command is correct and executed, GPS module will output message $PMTK001,220,3*30<CR><LF>*/
#define PMTK_Set_NMEA_OUTPUT_GLL       "$PMTK314,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GLL - Geographic position, latitude / longitude
#define PMTK_SET_NMEA_OUTPUT_RMC       "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only RMC - Recommended minimum specific Loran-C data
#define PMTK_SET_NEMA_OUTPUT_VTG       "$PMTK314,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only VTG - Track made good and ground speed
#define PMTK_SET_NEMA_OUTPUT_GGA       "$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GGA - Global Positioning System Fix Data
#define PMTK_SET_NMEA_OUTPUT_RMCGGA    "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on GPRMC and GPGGA ----- TinyGPS only uses these two, all others can be turned off
#define PMTK_SET_NMEA_OUTPUT_GSA       "$PMTK314,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSA - GPS DOP and active satellites
#define PMTK_SET_NMEA_OUTPUT_GSV       "$PMTK314,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSV - GPS Satellites in view
#define PMTK_SET_NEMA_OUTPUT_ZDA       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0*29\r\n" // turn on only ZDA - Date & Time - UTC, day, month, year, and local time zone.
#define PMTK_SET_NEMA_OUTPUT_RMCGAAGSA "$PMTK314,0,1,0,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n" // RMC, GGA, GSA at 1Hz and GSV at 0.2Hz
#define PMTK_SET_NMEA_OUTPUT_ALLDATA   "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on ALL THE DATA for the LS20031- except ZDA
#define PMTK_SET_NMEA_OUTPUT_OFF       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn off output
/* If the command is correct and executed, GPS module will output message "$PMTK001,314,3*36<CR><LF>" See Flag upabove */
#define PMTK_Q_RELEASE "$PMTK605*31\r\n" /* Query FW release information -- MTK-3301s send firmware release name and version - Note: not sure of accuracy of this information */
  /* if the command is correct and executed, GPS module will output message example >> "$PMTK705,AXN_1.30,29BF,MC-1513,*0E"
     Data field >> "$PMTK705,ReleaseStr,Mod eID,,*0E"
     ReleaseSTr: Firmware release name & version
     ModelID: Model ID  
  */  
/*
 Demonstration sketch for Adafruit i2c/SPI LCD backpack
 using MCP23008 I2C expander - NOTE at this time all LCD functions have been REM out
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )

 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * 5V to Arduino 5V pin
 * GND to Arduino GND pin
 * CLK to Analog #5
 * DAT to Analog #4
*/

// include the library code:
#include <Wire.h>
//#include <LiquidTWI.h> // can befound here >> https://github.com/lincomatic/LiquidTWI2/downloads -
// -- used with >> i2c / SPI character LCD backpack - https://www.adafruit.com/products/292
// Note >> "By replacing either of Adafruit’s libraries with LiquidTWI2, memory use will decrease, and writing to the LCD will become blazingly fast."

// Connect via i2c, default address #0 (A0-A2 not jumpered)
// LiquidTWI lcd(0);
#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
   57600-baud serial GPS device hooked up on pins 3(rx) and 4(tx).
*/

TinyGPS gps;
SoftwareSerial nss(rxPin, txPin);

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
  Serial.begin(115200);
  nss.begin(57600); // LS20031 baud- 57600
  while (!nss.available()){}
  nss.print(PMTK_SET_NMEA_OUTPUT_RMCGGA); // $GPxxx Messages
  nss.print(PMTK_SET_NMEA_UPDATE_1HZ);     // messages 1 times a second
  nss.print(PMTK_Q_RELEASE);
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.print("Sizeof(gpsobject) = "); Serial.println(sizeof(TinyGPS));
  Serial.println();
  Serial.println("Sats HDOP Latitude Longitude Fix  Date       Time       Date Alt     Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)    (deg)     Age                        Age  (m)     --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("--------------------------------------------------------------------------------------------------------------------------------------");
 // set up the LCD's number of rows and columns:
  //lcd.begin(16, 2);
  // Print a message to the LCD.
  //lcd.print("hello, world!");
}

void loop()
{
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  // lcd.setCursor(0, 1);
  bool newdata = false;
  unsigned long start = millis();
  // lcd.print(start/1000);
  // Every second we print an update
  while (millis() - start < 1000)
  {
    if (feedgps())
      newdata = true;
  }
  
  gpsdump(gps);
  //lcd.setBacklight(HIGH);
}
« Last Edit: January 29, 2013, 11:15:40 am by BlackLab1 » Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
\\ continued from previous post

static void gpsdump(TinyGPS &gps)
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  
  Serial.print(" ");
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
 //lcd.setCursor(0, 2); lcd.print("Satellites: "); lcd.print(gps.satellites());lcd.print(".");
  feedgps();

  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

  print_date(gps);

  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);
  Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    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);  feedgps();
}

static void print_float(float val, float invalid, int len, int prec)
{
  char sz[32];
  if (val == invalid){
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len > 0)
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("*******    *******    ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz); //lcd.setCursor(0, 1); lcd.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

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

static bool feedgps()
{
  while (nss.available())
  {
    if (gps.encode(nss.read()))
      return true;
  }
  return false;
}

I had this running for over 8 hours with NO check sum errors. And YES- I had it running at 57600 baud rate- as long as you have it only doing GPRMC and GPGGA sentences. Though I am not sure why but when running my I2C LCD backpack it did kick out a check sum error once in a while.
« Last Edit: January 29, 2013, 10:28:12 am by BlackLab1 » Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am confused.  The GPS sensor connects through I2C ??   Every one I ever saw was a serial connection.
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The GPS connects through serial communications.   So if you need a level converter,  you need one
that works for serial lines,  not I2C.   Maybe the same device can be used for either.  Maybe not.
But it is confusing to continually refer to using an I2C level converter, because it is not I2C communication.

For the GPS,  there is no point defining all that stuff in the program,  which is for configuration
codes to send TO  the GPS,  if you are not actually connecting the serial line for communication
from the Arduino to the GPS.    And if you are not actually connecting this line,  you need to be
sure that the default configuration that the GPS powers up with,  is what you actually want.  If you
need to send any configuration commands TO the GPS,  you need to connect the other serial line.

And for serial communication,  you want to be using the appropriate pin on whatever your arduino is,
to get the data.

That humidity chip uses the "one-wire" communication method.   That isn't I2C either...    if in doubt,
read the instructions.

Did you say that the devices work separately, but the system fails, or appears to fail,  when you connect them both ?
If it is wired correctly,  the problem is more likely to be in your program,  than to be some kind of electrical interference.









Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using Serial to talk to the GPS, and using I2C for talking to my 4X20 RGB display via a Adafruit i2c / SPI character LCD backpack. That way I am not using all my Arduino pins just to talk to my RGB LCD.

There are thing that can interfere with SoftwareSerial baud rate that has to do with interrupts timers. Example See >> http://playground.arduino.cc/Main/AVR:
 cli(); and sei(); ... Note that the millis timer, and serial communication will be affected by disabling interrupts. The delayMicroseconds() function disables interrupts while it is running.
Now while I am not using anything like cli() or sei() in my program, I am guessing that some I2C functions can do the same thing in interfering with the interrupts timing for SoftwareSerial resulting in some lost data.

RE: YOU DONT NEED A I2C Logic Voltage converter FOR SERIAL COMMUNICATION. - Well go over to http://www.dsscircuits.com/i2c-level-converter.html and read what Wayne Truchsess has to say about Texas Instruments' TXS0102 2-BIT BIDIRECTIONAL VOLTAGE-LEVEL TRANSLATOR FOR OPEN-DRAIN AND PUSH-PULL APPLICATIONS.

The last part caught my attention and I quote:
Quote
And as a bonus the boards can also be used for your average UART (Push Pull) communications also!

Well you do need a logic converter if you’re going to talk to your 3.3V GPS when your Arduino is talking at 5V. If you understood all the problems that the LS20031 has with working with SoftwareSerial, then you would realize you need to change what the LS20031 is spitting out so it was only sending out what TinyGPS need to do its job. Even Mikal Hart has basically said that. That requires you to not only change how long the buffer is in SoftwareSerial, but also you need to to tell the LS20031 what to do- like only send out the two NMEA sentences that TinyGPS uses. And like I am trying to explain that requires you not frying your LS20031 GPS with 5V while you nicely convince it to only send GPRMC and GPGGA sentences.

Also, one of the problems with using Mosfet discrete parts to do logic voltage conversion is you don't have all the protection against Electrostatic discharge (ESD). Which would require you to have diodes connection from ground to the gate, and from the gate to power so any ESD would not fry the gate- a lot more parts compared to using all in one package like the TXS0102- which has the bonus of not requiring to have pull up resistors on either side of the Voltage logic converter when using it in a 3.3V to 5V serial communication. Also the TXS0102 outputs a better square wave then trying to use just a Mosfet do to the one-shots (see data sheet for the TSX0102). <edit> With out it, If your Arduino power supply is having spikes or dips then the Arduino will have better chance of misinterpret the voltage logic HIGH if your 3.3V GPS voltage logic HIGH is too low- see CIRCUIT Cellar Issue 296 pg 44- Arduino Survival Guide. In English: You use a lot less parts to do the same job if you use the TXS0102.

Heck even Dr Don Peter, Associate Professor of Electrical Engineering, of Seattle Pacific University said: " This is a lot neater than futzing with discrete parts and blowing FETs!".

RE: YOU DONT NEED ALL THAT OTHER STUFF....

Well like a lot of programmers I like to include some of the choices to test the different options that can be used with the program/sketch. A lot of people do not know how to do all those changes and I gave them a way to try it out. If you look at Adafruit LiquidTWI you will see that the programmer also included all the communication options to talk to the I2C backpack. Not all of them are needed; a matter of fact the LiquidTWI only uses three of them. Likewise some of these options I included for the GPS were also included with ladyada sketches that dealt with her GPS that didn't really impact how the sketch worked. They were there so you could try them out. YES, it was more than the normal newbie needed, but it also was a teaching tool to go beyond the one screwdriver approach. How else do you learn if you only sit on your hands and try nothing?

RE: IS IT WIRE CORRECTLY- DOES IT WORK-
It works. And it has nothing to do with wiring. If you wire this up like I have described you will see it works. If you have work with the LS20031 with Software Serial you all ready know there is a problem if you don't turn everything off that that TinyGPS does not use. LadyAda has suggested part of the problem with SoftwareSerial not working with any GPS at high baud rates has to do with the overhead in SoftwareSerial. I think she right, but also I think it has to do with interrupt timing issues (hence talking to an I2C device can mess up Serial communication. ALSO people using the DHT11 or DHT22 will have a problem because their .cpp file does have cli() and sei() in their .cpp program- there is a work around but that's a different thread). I don't think it's really a high baud rate problem sense I got it to work at the rate in the sketch. I do know if /r and /n are not passed correctly in and out of software serial it really screws up TinyGPS- hence you start getting a lot of check sum errors. And I also know that NMEA sentences are longer than the 64 bytes long, so you really need to make the buffer in SoftwereSerial 128 bytes long- or you’re going to miss the check sum and the \r\n – even Wayne holder over at https://sites.google.com/site/wayneholder/self-driving-rc-car/navigating-with-gps point that out. I don't care if the buffer is circler, if it does not dump out what's in the buffer faster then what coming in; you’re going to have problems. If something prevents that from happening, no matter the wiring, you are going to have bad data. The cake is I am not the first person that took this approach to talking to the LS20031. I am just adding some code to go with it and describing a Logic Voltage converter that beyond simple to use. Oh one other thing- SoftwareSerial is interrupted controlled, not polled (that’s Mikal Hart’s own description of his own work). That’s why anything interfering with the timing will cause intermittent errors with the Serial output.  By the way- I am not the one who wrote either SoftwareSerial or TinyGPS- that was Mikal Hart. I just added to his example that comes with TinyGPS by limiting what the GPS spits out. This is a long known issue with the ls20031 GPS- see Sparkfun.com and the LS20031.  As you say if in doubt read the instructions. I add to that go read your dot H files and your dot cpp files too.

Also know that people have by passed Softwareserial by directly going to the hardware UART and got TinyGPS to work. That works, but then you are forced to use a MEGA Arduino, like Wayne Holder did, if you still need to use the on board UART on the Uno to talk to your desk top. 



« Last Edit: January 31, 2013, 04:50:21 am by BlackLab1 » Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It might be a good idea to connect the serial wire from the Arduino  TO the GPS,  and configure
the GPS to only send the NMEA sentences that you want.

That will reduce the amount of busyness of the Arduino,  which may be your problem. 
Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you referring to this >> http://www.dsscircuits.com/images/schematic/I2C%20Logic%20Level%20Converter%20Sample%20Wiring.pdf??? Because it looks connected to me.

RE: ... only send the NMEA sentences that you want
Well... That's why this code is here >>
Code:
////continued from previous post
#include <TinyGPS.h>
// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
#define PMTK_SET_NMEA_UPDATE_HALF_HZ "$PMTK220,2000*1C\r\n" // Every 2000ms (0.5Hz)
#define PMTK_SET_NMEA_UPDATE_1HZ  "$PMTK220,1000*1F\r\n" // Every 1000ms (1Hz)
#define PMTK_SET_NMEA_UPDATE_2HZ  "$PMTK220,500*2B\r\n>" // Every 500ms (2Hz)
#define PMTK_SET_NMEA_UPDATE_5HZ  "$PMTK220,200*2C\r\n"  // Every 200ms (5Hz)
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F\r\n"  // Every 100ms (10Hz)
/* If the command is correct and executed, GPS module will output message $PMTK001,220,3*30<CR><LF>
   Flag: '0' = Invalid Packet
         '1' = Unsupported packedt type
         '2' = Valid packet, but action failed
         '3' = Valid packet, and action succeeded
*/

#define PMTK_SET_BAUD_115200 "$PMTK251,115200*1F\r\n" // dont mess with any of these unless you know what your doing
#define PMTK_SET_BAUD_57600  "$PMTK251,57600*2C\r\n"  // if you do change these you have to use the last working baud rate
#define PMTK_SET_BAUD_9600   "$PMTK251,9600*17\r\n"   // to communicate with LS20031 then change back to desired setting
#define PMTK_SET_BAUD_4800   "$PMTK251,4800*14\r\n"   //

#define PMTK_Set_NMEA_OUTPUT_GLL       "$PMTK314,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GLL - Geographic position, latitude / longitude
#define PMTK_SET_NMEA_OUTPUT_RMC       "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only RMC - Recommended minimum specific Loran-C data
#define PMTK_SET_NEMA_OUTPUT_VTG       "$PMTK314,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only VTG - Track made good and ground speed
#define PMTK_SET_NEMA_OUTPUT_GGA       "$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GGA - Global Positioning System Fix Data
#define PMTK_SET_NMEA_OUTPUT_RMCGGA    "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on GPRMC and GPGGA ----- TinyGPS only uses these two, all others can be turned off
#define PMTK_SET_NMEA_OUTPUT_GSA       "$PMTK314,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSA - GPS DOP and active satellites
#define PMTK_SET_NMEA_OUTPUT_GSV       "$PMTK314,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" // turn on only GSV - GPS Satellites in view
#define PMTK_SET_NEMA_OUTPUT_ZDA       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0*29\r\n" // turn on only ZDA - Date & Time - UTC, day, month, year, and local time zone.
#define PMTK_SET_NEMA_OUTPUT_RMCGAAGSA "$PMTK314,0,1,0,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n" // RMC, GGA, GSA at 1Hz and GSV at 0.2Hz
#define PMTK_SET_NMEA_OUTPUT_ALLDATA   "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn on ALL THE DATA for the LS20031- except ZDA
#define PMTK_SET_NMEA_OUTPUT_ALLDATA2  "$PMTK314,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1*29\r\n" //
#define PMTK_SET_NMEA_OUTPUT_OFF       "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // turn off output
/* If the command is correct and executed, GPS module will output message "$PMTK001,314,3*36<CR><LF>" See Flag upabove
 
  LS20031 uses the following Protocall >> GLL, RMC, VTG, GGA, GSA, GSV, ZDA supported NMEA messages
 
  Location:             Decription:
      0  NMEA_SEN_GLL,   // GPGLL interval - Geographic Position - Latitude longitude   
      1  NMEA_SEN_RMC,   // GPRMC interval - Recommended Minimum Specific GNSS Sentence
      2  NMEA_SEN_VTG,   // GPVTG interval - Course Over Ground and Ground Speed
      3  NMEA_SEN_GGA,   // GPGGA interval - GPS Fix Data
      4  NMEA_SEN_GSA,   // GPGSA interval - GNSS DOPS and Active Satellites
      5  NMEA_SEN_GSV,   // GPGSV interval - GNSS Satellites in View
      6  NMEA_SEN_GRS,   // GPGRS interval - GNSS Range Residuals
      7  NMEA_SEN_GST,   // GPGST interval - GNSS Pseudorange Errors Statistics
      13 NMEA_SEN_MALM, // PMTKALM interval - GPS almanac information
      14 NMEA_SEN_MEPH, // PMTKEPH interval - GPS ephmeris information
      15 NMEA_SEN_MDGP, // PMTKDGP interval - GPS differential correction information
      16 NMEA_SEN_MDBG, // PMTKDBG interval – MTK debug information
      17 NMEA_Sen_ZDA,  // ZDA - Date & time -- $GPZDA,hhmmss.ss,xx,xx,xxxx,xx,xx See  http://aprs.gids.nl/nmea/ >> Note: LS20031 seems not to know TimeZones.
                                                hhmmss.ss = UTC
                                                xx = Day, 01 to 31
                                                xx = Month, 01 to 12
                                                xxxx = Year
                                                xx = Local zone description, 00 to +/- 13 hours
                                                xx = Local zone minutes description (same sign as hours)
      18 NMEA_SEN_MCHN, // PMTKCHN interval – GPS channel status ---- info here >> http://snoob-community.wikispaces.com/PMTKCHN
                           decoding >>  $PMTKCHN,aabbc,...*XX\r\n
                                                 aa => SVid: Space Vehicle Id
                                                   bb => SNR: Signal to Noise Ratio
                                                     c => Status:
                                                          • 0 == Idle
                                                          • 1 == Searching
                                                          • 2 == Tracking
                                                         
  Example location:  0,1,2,3,4,5, , , , , , , , , , , ,17,18*??\r\n" for the LS20031
           "$PMTK314,0,1,0,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0*2C\r\n" --- MTK NMEA checksum calculator -> http://www.hhhh.org/wiml/proj/nmeaxor.html
          Supported Frequency Setting
                  0 - Disabled or not supported sentence
                  1 - Output once every one position fix
                  2 - Output once every two position fixes
                  3 - Output once every three position fixes
                  4 - Output once every four position fixes
                  5 - Output once every five position fixes
           You can also restore the system default setting via issue: "$PMTK314,-1*04\r\n"
   */

#define PMTK_SET_SABS_INTERGITY_ON   "$PMTK319,1*24\r\n" //
#define PMTK_SET_SBAS_TEST_ON        "$PMTK319,0*25\r\n" //
#define PMTK_SET_WAAS_ENABLE         "$PMTK313,1*2E\r\n" // Enable to search a SBAS satellite--tells the receiver to search for a satellite that supports the Satellite-Based Augmentation System(SBAS)
#define PMTK_SET_WAAS_DISABLE        "$PMTK313,0*2F\r\n" // Disable SBAS satellite
#define PMTK_SET_DGPS_SBAS_ON        "$PMTK301,2*2E\r\n" // Enable WAAS as DGPS Source-- enables the receiver to use this information to correct the GPS fix into a DGPS fix.
                                                         // '0': No DGPS source
                                                         // '1': RTCM
                                                         // '2': 'WAAS'
/*  Note from Wayneholds web site:
    There are some fine points here, too:
      •Some receivers, such as those based on the MediaTek chip set can only make use of the WAAS correction information if the receiver is set to an update rate of 5 Hz, or less. 
          I found this tidbit buried inside a spec sheet after spending countless hours trying to figure out why I could not get a DGPS lock at the 10 Hz rate one of my receivers is capable of working at.
      •Some receivers, such as ones based on the SkyTraq Venus chip set require that commands be send in a binary format rather than a text-based format.
   Therefore, I strongly recommend that you spend some time getting familiar with the specifications and features available for your GPS module and that you experiment with,
   and test your receiver before you dismiss it as defective, as I did initially.  Hopefully, much of what I explaining in this section will be applicable to you, but your mileage may still vary.
*/
#define PMTK_Q_RELEASE "$PMTK605*31\r\n" /* Query FW release information -- MTK-3301s send firmware release name and version - Note: not sure of accuracy of this information */
  /* if the command is correct and executed, GPS module will output message example >> "$PMTK705,AXN_1.30,29BF,MC-1513,*0E"
     Data field >> "$PMTK705,ReleaseStr,Mod eID,,*0E"
     ReleaseSTr: Firmware release name & version
     ModelID: Model ID 
  */
« Last Edit: February 05, 2013, 09:26:26 pm by BlackLab1 » Logged

Seattle
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And here is where you make your selection to as what sentences you want tinyGPS to see (in RED). Thought in the real world, TinyGPS only accepts two sentences: $GPRMC and $GPGGA. >>

void setup()
{
  Serial.begin(115200);
  nss.begin(57600); // LS20031 baud- 57600
  while (!nss.available()){}
  nss.print(PMTK_SET_NMEA_OUTPUT_RMCGGA); // $GPxxx Messages
  nss.print(PMTK_SET_NMEA_UPDATE_1HZ);     // messages 1 times a second
  nss.print(PMTK_Q_RELEASE);
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
...
}

What I have done is the homework to get the LS20031 working and more. The extras I have included are things you can look at if you do a dump from the logic voltage converter directly in the Arduino as directed in the first posts. The manufacture of the LS20031 has not done a great job of documenting the part, what I have done here is let you in the back door to see some things that it can output. You can lead a horse to water but you can’t make him program or read... or document it's code.
« Last Edit: February 05, 2013, 09:59:31 pm by BlackLab1 » Logged

Pages: [1]   Go Up
Jump to: