LS20031 and Arduino Mini Pro 3.3v problems

Tips and questions relating to the GPS modules from SFE

Moderator: phalanx

LS20031 and Arduino Mini Pro 3.3v problems

Postby josepilove » Wed Mar 09, 2011 5:58 am

I am very new to arduino.

I got everything that needed mocked up and planned out on a Arduino Uno, one of the major things was the LS20031 GPS.

I used NSS to print out what i needed to Serial using the following code:
Code: Select all
#include <NewSoftSerial.h>
#include <TinyGPS.h>

TinyGPS gps;
NewSoftSerial nss(2, 3);
int year, month, day, hour, minutes, second, hundredths;
unsigned long fix_age;
void gpsdump(TinyGPS &gps);
bool feedgps();
void printFloat(double f, int digits = 2);

void setup()

void loop(){
  bool newdata = false;
  unsigned long start = millis();
  // Every 5 seconds we print an update
  while (millis() - start < 1000){
    if (feedgps())
      newdata = true;
  if (newdata){
void printFloat(double number, int digits){
  // Handle negative numbers
  if (number < 0.0){
     number = -number;
  // Round correctly so that print(1.999, 2) prints as "2.00"
  double rounding = 0.5;
  for (uint8_t i=0; i<digits; ++i)
    rounding /= 10.0;
  number += rounding;
  // Extract the integer part of the number and print it
  unsigned long int_part = (unsigned long)number;
  double remainder = number - (double)int_part;
  // Print the decimal point, but only if there are digits beyond
  if (digits > 0)
  // Extract digits from the remainder one at a time
  while (digits-- > 0){
    remainder *= 10.0;
    int toPrint = int(remainder);
    remainder -= toPrint;
void gpsdump(TinyGPS &gps){
  long lat, lon;
  float flat, flon;
  unsigned long age, date, time, chars;
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned short sentences, failed;
  feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors
  gps.f_get_position(&flat, &flon, &age);
  Serial.print("Lat/Long(float): "); printFloat(flat, 5); Serial.print(", "); printFloat(flon, 5);
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
    Serial.print("Date: "); Serial.print(static_cast<int>(month)); Serial.print("/");
    Serial.print(static_cast<int>(day)); Serial.print("/");
  Serial.print("  Time: "); Serial.print(static_cast<int>(hour)); Serial.print(":");
  Serial.print(static_cast<int>(minute)); Serial.print(":");
bool feedgps(){
  while (nss.available()){
    if (gps.encode(
      return true;
  return false;

I also changed the line in NewSoftSerial.h _NewSS_MAX_RX_BUFF to 128.

So i get just what i need with the Arduino Uno, but i would like a smaller package, so i got the arduino Mini Pro 3.3v 328.

I hook everything up the exact same as i did with the Uno and upload the same code. GPS powers on, gets a fix (red blinking light) but I am getting no Serial output.

I am stumped...anyone? Is there something about the Mini Pro that I am missing?

Thanks in advance!
Posts: 2
Joined: Wed Mar 09, 2011 5:51 am

Re: LS20031 and Arduino Mini Pro 3.3v problems

Postby borelmfg » Thu Mar 24, 2011 11:55 am

The Uno runs at 16Mhz the 3.3V mini runs at 8Mhz. This maybe screwing up the timing for serial port.
Don't have a good solution. Option, purchase mini pro a 5V, that one runs at 16Mhz
Posts: 1
Joined: Thu Mar 24, 2011 11:50 am

Re: LS20031 and Arduino Mini Pro 3.3v problems

Postby josepilove » Thu Mar 24, 2011 12:57 pm

i don't really know much about things, but back in highschool i liked to overclock my computer by increasing the voltage to the chip, making it run faster. I thought that the 16Mhz vs 8Mhz difference only affected the speed of code execution. i said, the only experience i had was primitive and exploratory..and i lit that computer on fire :)
Posts: 2
Joined: Wed Mar 09, 2011 5:51 am

Re: LS20031 and Arduino Mini Pro 3.3v problems

Postby trementina » Thu Apr 28, 2011 2:46 pm

I have the same problem. All works fine with UNO, but the serial port doen not work win Mini Pro 3.3.
Simply, i think it's an hardware bug, or a bug in the serial Library.

Posts: 2
Joined: Thu Apr 14, 2011 1:15 pm

Return to GPS

Who is online

Users browsing this forum: No registered users and 1 guest