HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jan 30, 2013, 10:12 AM
Stick banger
Ace4's Avatar
USA, AZ, Chandler
Joined Oct 2004
1,031 Posts
The ebay site shows it requires a 115200 baud rate for the GPS. Make sure to update the code to that baudrate, although I'm not sure the Arduino will be able to handle that high of a serial rate. Worth a try, though.
Ace4 is offline Find More Posts by Ace4
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 30, 2013, 04:39 PM
Build to Fly? FLY to BUILD!
Legot's Avatar
United States, AZ, Gilbert
Joined Nov 2009
1,104 Posts
A better option would be to replace this part of the code:
Quote:
// Used to set the GPS update-rate to 5 hz, and GPGGA and GPRMC gps-strings (Only for MKT-GPS).

  Serial.print("$PMTK220,100*2F\r\n");
  Serial.write(13);
  Serial.write(10);

  Serial.print("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 ");
  Serial.write(13);
  Serial.write(10);
with this:
Quote:
// Used to set the GPS update-rate to 5 hz, and GPGGA and GPRMC gps-strings, as well as setting a baudrate of 57600 (O nly for MKT-GPS).

  Serial.print("$PMTK251,57600*2C\r\n") //to change go to http://www.hhhh.org/wiml/proj/nmeaxor.html and create a valid checksum.
  Serial.write(13);
  Serial.write(10); //57600 baud
  
  Serial.print("$PMTK220,200*2C\r\n");
  Serial.write(13);
  Serial.write(10); //5Hz refresh rate

  Serial.print("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 ");
  Serial.write(13);
  Serial.write(10); //Sets GPGGA and GPRMC to update once every fix
It sets the baudrate 57600, which should always work (as opposed to using the gps' stock 115200 baud, which can be flaky with this OSD).

It would be a good improvement to put this into the shipping version of the code, just to remove some of the issues with the occasional stock GPS incompatibility.

It sets the baudrate 57600, which should always work (as opposed to using the gps' stock 115200 baud, which can be flaky with this OSD).

It would be a good improvement to put this into the shipping version of the code, just to remove some of the issues with the occasional stock GPS incompatibility.
Legot is offline Find More Posts by Legot
Reply With Quote
Old Jan 30, 2013, 05:27 PM
Registered User
Joined Mar 2008
10 Posts
thanks for the replies.

I've changed the lines indicated in the file DIY_OSD_v0_18.ino

But the result is the same.

SAT: 00
NO GPS FIX

The GPS blue LED flashes every second. I have checked the connections:

Tx GPS >>>>> Rx OSD (with transistors to increase voltage to 5V)
Tx OSD >>>>> Rx GPS (with diodes 3.3v)

thanks again for your time and help
sokoloko is offline Find More Posts by sokoloko
Last edited by sokoloko; Jan 30, 2013 at 06:02 PM.
Reply With Quote
Old Jan 31, 2013, 12:24 AM
Build to Fly? FLY to BUILD!
Legot's Avatar
United States, AZ, Gilbert
Joined Nov 2009
1,104 Posts
Are you indoors? For me, even though I'm on the highest floor of my house, I don't get gps lock at all. Try the same thing you're doing, but go outside.

Some things that you may want to consider. The arduino doesn't need transistors to increase the voltage to 5v, because the logic high threshold of the Atmega is 3v; if the GPS is supplied with a solid 3.3v, there will be no problem with that.

Another thing is that you should really use a regulator to get the 3.3v for the GPS, its just a more stable voltage. It should never require more than 50ma, so for GPS regulators I like to use the TI TPS77033, but any 3.3v regulator will work well.

And I have to say, that's a really expensive GPS module.
Legot is offline Find More Posts by Legot
Reply With Quote
Old Jan 31, 2013, 08:17 AM
Registered User
Joined Mar 2008
10 Posts
Thanks Legot.

I've been testing for more than an hour on the outside with the new code, but not working.

I tested with a 3.3 V regulator with a diode in series and removing the transistors, but no way.

I tried on the computer with the program MiniGPS_v1.7.1 and everything works fine. I do not know what else I can try.

I'd appreciate if you show me where to buy some GPS economic model that works well with this OSD.

Regards
sokoloko is offline Find More Posts by sokoloko
Reply With Quote
Old Jan 31, 2013, 09:48 AM
Stick banger
Ace4's Avatar
USA, AZ, Chandler
Joined Oct 2004
1,031 Posts
I'm using the Locosys LS20031, it's a MediaTek MT3329-based setup. It's not the cheapest ($50 at polulu.com), but it works well with the OSD. It's 3.3V, so you either have to change the settings external to the OSD (I used my PC with a usb->serial adapter) or have a logic level converter so that you don't write to the GPS serial channel at 5V. It's very sensitive, I get good lock inside my house, and it has a battery backup to keep the ephemeris for quicker acquisition. It's slightly power hungry, but I think most GPS chips are during acquisition.
Ace4 is offline Find More Posts by Ace4
Reply With Quote
Old Jan 31, 2013, 06:51 PM
Registered User
Joined Mar 2008
10 Posts
hello again,

After many changes in the code I can not find the solution, because with the code mentioned in the line:

  Serial.print ("$ PMTK314, 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 * 28");

Crack! and the execution does not continue.

I'll try to set Handmade gps with miniGPS program, but has too many values ​​I do not know how to fill, I have tried many options but not working.

I put a screenshot of my gps with possible options.

Thank you.
sokoloko is offline Find More Posts by sokoloko
Reply With Quote
Old Jan 31, 2013, 07:00 PM
Build to Fly? FLY to BUILD!
Legot's Avatar
United States, AZ, Gilbert
Joined Nov 2009
1,104 Posts
That is so strange. I use a 3329 based module as well, but the 3339 is supposed to be functionally identical. There's no reason to change modules if yours works with the MiniGPS program, I was just making a comment.

Try setting up the module for 57600 baudrate, GGA: 1, RMC:1 (all others:0), DGPS doesn't matter, and 5hz fix update rate through the Mini GPS program. Another possibility, is it at all possible that your RX and TX wires to the GPS are swapped? (I have problems with this all the time.)

That's the best I can come up with at the moment, sorry and best of luck.


Ooohh! something else that may or may not be worth a try is changing that line of code to:
Quote:
  Serial.print("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 \r\n");
Legot is offline Find More Posts by Legot
Last edited by Legot; Jan 31, 2013 at 07:06 PM.
Reply With Quote
Old Feb 01, 2013, 06:02 AM
Registered User
Joined Mar 2008
10 Posts
hello,

First of all, I forgot to mention that the module is cheaper, this is the actual link:
http://www.ebay.es/itm/Very-Small-MT...#ht_1905wt_917

item code, after much reading in various forums, attached what I think would be a correct settings, but for some strange reason, if I put more than two sentences, execution stops and the program crashes.





Code:
  Serial.print("$PMTK251,57600*2C\r\n"); //  // Set NMEA port baud rate 57600 baud
  delay(100);
  Serial.write(13);
  Serial.write(10); //57600 baud

 Serial.print("$PMTK314,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n");
  delay(100);
  Serial.write(13);
  Serial.write(10); //Sets GPGGA and GPRMC to update once every fix
  
  Serial.print("$PMTK220,200*2C\r\n");  // //5Hz refresh rate = 200(millisecond) = 0.2(sec) 1/0.2 = 5 Hz
  delay(100);
  Serial.write(13);
  Serial.write(10); //5Hz refresh rate
  
  Serial.print("$PMTK300,200,0,0,0,0*2F\r\n");
  delay(100);
  Serial.write(13);
  Serial.write(10); 
  
  Serial.print("$PMTK313,0*2F\r\n");     // Disable to search a SBAS satellite. 
  delay(100);
  Serial.write(13);
  Serial.write(10);
 
  Serial.print("$PMTK301,0*2C\r\n");     // Disable to search a SBAS satellite. 
  delay(100);
  Serial.write(13);
  Serial.write(10);
I have put a battery to GPS to save the settings, and I've programmed from MiniGPS as attached image, omitting all configuration lines in the program, but does not work either.

If I set it to hand, how I can I remove the connection that goes from Tx OSD to Rx GPS?

The output signal of the GPS module working properly measured with an oscilloscope. This is the output:

$GPRMC,183242.000,A,4138.0757,N,00445.6716,W,0.38, 246.22,010213,,,A*70
$GPGGA,183243.000,4138.0758,N,00445.6712,W,1,6,1.1 7,748.1,M,51.6,M,,*4B
$GPRMC,183243.000,A,4138.0758,N,00445.6712,W,0.43, 246.22,010213,,,A*76
$GPGGA,183244.000,4138.0758,N,00445.6710,W,1,6,1.1 7,748.1,M,51.6,M,,*4E
$GPRMC,183244.000,A,4138.0758,N,00445.6710,W,0.45, 246.22,010213,,,A*75
$GPGGA,183245.000,4138.0759,N,00445.6708,W,1,6,1.1 7,748.1,M,51.6,M,,*47
$GPRMC,183245.000,A,4138.0759,N,00445.6708,W,0.53, 246.22,010213,,,A*7B
$GPGGA,183246.000,4138.0759,N,00445.6706,W,1,6,1.1 7,748.1,M,51.6,M,,*4A
$GPRMC,183246.000,A,4138.0759,N,00445.6706,W,0.69, 89.76,010213,,,A*4F
$GPGGA,183247.000,4138.0758,N,00445.6702,W,1,6,1.1 7,748.1,M,51.6,M,,*4E
$GPRMC,183247.000,A,4138.0758,N,00445.6702,W,0.68, 103.24,010213,,,A*7E
$GPGGA,183248.000,4138.0755,N,00445.6697,W,1,6,1.1 7,748.1,M,51.6,M,,*41
$GPRMC,183248.000,A,4138.0755,N,00445.6697,W,0.73, 104.27,010213,,,A*7F


This can not be so complicated ....
sokoloko is offline Find More Posts by sokoloko
Last edited by sokoloko; Feb 01, 2013 at 12:35 PM.
Reply With Quote
Old Feb 01, 2013, 10:58 PM
Build to Fly? FLY to BUILD!
Legot's Avatar
United States, AZ, Gilbert
Joined Nov 2009
1,104 Posts
Wait wait wait... Is that the exact code your uploading to the OSD?
Because the entire setup routine for the GPS is commented out...

Before and after the serial.print section that you've been working with, erase the /* and the */

Maybe that's the problem? If it isn't, then I have absolutely nothing left to try.
Legot is offline Find More Posts by Legot
Reply With Quote
Old Feb 02, 2013, 11:56 AM
Registered User
Joined Mar 2008
10 Posts
hello Legot

Thanks for your time to check my code, actually, all code to configure the GPS is commented. If I do not comment, program execution stops and the OSD stops working.

So I manually configure the program MiniGPS GPS (attached image above) and battery backup saved settings.

I have also flashed the GPS to the latest version, but still not working.

I ordered some optocouplers to connect GPS and OSD, I do not know what else to try.

Too bad it does not work, it is a good and cheap GPS ideal for an interesting project like this. : (: (: (

Thank you very much to all for your time
sokoloko is offline Find More Posts by sokoloko
Reply With Quote
Old Feb 02, 2013, 05:13 PM
Build to Fly? FLY to BUILD!
Legot's Avatar
United States, AZ, Gilbert
Joined Nov 2009
1,104 Posts
Sorry I couldn't be more help.

Just know that in your case there is an issue somewhere with the OSD, the GPS seems to be working perfectly.

Good luck my friend.
Legot is offline Find More Posts by Legot
Reply With Quote
Old Feb 03, 2013, 06:59 AM
Registered User
Joined Jun 2010
561 Posts
Hey guys i have a problem here.

I want to use this one without any gps module like one of those "Simple OSDs" showing only time and voltage. So i stripped the "output.ccp" to only show voltage and time. So far so good works as expected. Now the problems starts. As time is calculated my the gps in need to find another way to calculate the time. I guess the best way to do this is using the Arduinos millis() command. So i added this to the calculation part of the output.ccp.

Code:
      flight_timer2[0]=((flight_time2/1000)/600)+3;     
      flight_timer2[1]=(((flight_time2/1000)%600)/60)+3;      
      flight_timer2[2]=(((flight_time2/1000)%600)%60)/10+3; 
      flight_timer2[3]=(((flight_time2/1000)%600)%60)%10+3;
If i declare for testing

Code:
flight_time2 = 1415000;
it shows me the correct time of 23:35 on the osd. Big Problem is i just cant get the time to start.
Code:
flight_time2 = millis();
just does not wok time always shows 00:00. I am quite new to arduino programming so anyone can give me a hind how to fix this ?

Here is what i have done so far
nabazul is offline Find More Posts by nabazul
Reply With Quote
Old Feb 04, 2013, 05:11 AM
Registered User
Joined Mar 2008
10 Posts
Hi all!

I've got some more time to try to solve my problems with gps.

First I changed the setup code for this:

Code:
 #define MTK_SET_NMEA            "$PGCMD,16,1,1,1,1,1*6B\r\n"
 #define MTK_SET_NMEA_SENTENCES  "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"
 #define MTK_OUTPUT_4HZ          "$PMTK220,250*29\r\n"
 #define MTK_OUTPUT_5HZ          "$PMTK220,200*2C\r\n"
 #define MTK_OUTPUT_10HZ         "$PMTK220,100*2F\r\n"
 #define MTK_NAVTHRES_OFF        "$PMTK397,0*23\r\n" // Set Nav Threshold (the minimum speed the GPS must be moving to update the position) to 0 m/s  
 #define SBAS_ON                 "$PMTK313,1*2E\r\n"
 #define WAAS_ON                 "$PMTK301,2*2E\r\n"
 #define SBAS_OFF                "$PMTK313,0*2F\r\n"  
 #define WAAS_OFF                "$PMTK301,0*2C\r\n"
 #define SBAS_TEST_MODE_1        "$PMTK319,0*25\r\n"	//Enable test use of sbas satelite in test mode (usually PRN124 is in test mode)
 #define SBAS_TEST_MODE_0        "$PMTK319,1*24\r\n"

  #define GPS_SERIAL_SPEED 57600
  uint32_t init_speed[5] = {9600,19200,38400,57600,115200};

      for(uint8_t i=0;i<5;i++){
        
        Serial.begin(init_speed[i]);					   // switch UART speed for sending SET BAUDRATE command
        #if (GPS_SERIAL_SPEED==19200)
          Serial.write("$PMTK251,19200*22\r\n");     // 19200 baud - minimal speed for 5Hz update rate
        #endif  
        #if (GPS_SERIAL_SPEED==38400)
          Serial.write("$PMTK251,38400*27\r\n");     // 38400 baud
        #endif  
        #if (GPS_SERIAL_SPEED==57600)
          Serial.write("$PMTK251,57600*2C\r\n");     // 57600 baud
        #endif  
        #if (GPS_SERIAL_SPEED==115200)
          Serial.write("$PMTK251,115200*1F\r\n");    // 115200 baud
        #endif  
        delay(300);
      }
      
          
      // at this point we have GPS working at selected (via #define GPS_BAUD) baudrate
      Serial.begin(GPS_SERIAL_SPEED);
            
      Serial.write(MTK_NAVTHRES_OFF);
      while (Serial.available() != 0) {Serial.read();}
      
      Serial.write(SBAS_OFF);
      while (Serial.available() != 0) {Serial.read();}

      Serial.write(WAAS_OFF);
      while (Serial.available() != 0) {Serial.read();}
      
      Serial.write(SBAS_TEST_MODE_0);
      while (Serial.available() != 0) {Serial.read();}
      
      Serial.write(MTK_OUTPUT_5HZ);           // 5 Hz update rate
      while (Serial.available() != 0) {Serial.read();}  

      Serial.write(MTK_SET_NMEA_SENTENCES); // only GGA and RMC sentence
      while (Serial.available() != 0) {Serial.read();}   

      Serial.write(MTK_SET_NMEA); // Si no lo pongo no continua
And finally the execution is not stopped.

Now looking at the code, I have a couple of questions, I would like to see on screen data received by arduino, but I can not find this function in your code, there is no (Serial.read)

On the other hand I have doubts with external button, there are several lines of code like this:
Code:
  if (CONTROLLER ==1 | Usebutton == 1) {
  if (digitalRead(Buttonpin)==LOW) {
that use an external button, I would like some information on this subject.

Thank you very much.
sokoloko is offline Find More Posts by sokoloko
Reply With Quote
Old Feb 13, 2013, 11:47 AM
Registered User
Joined Jun 2010
561 Posts
Hey,

thanks to a tip from Dennis i could fix my problem. I did myself a power distribution board for small quads with an onboard diy osd which shows only time and voltage. The OSD is also able to control the quads leds to make them blink when battery is low:

DIY OSD Power Distribution Board (0 min 57 sec)
nabazul is offline Find More Posts by nabazul
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Diy osd karl k FPV Talk 2 May 03, 2011 12:31 AM
Idea New DIY OSD? atari7202 FPV Talk 1 Mar 25, 2011 12:08 AM
Discussion see my own diy OSD video Passion Aerial Photography 7 May 27, 2010 01:28 AM
Discussion REAL homebrew DIY OSD - Check it out! jafoca FPV Talk 8 Jun 29, 2009 06:52 PM
Discussion picoOSD DIY PIC12F683 based OSD in C kbosak FPV Talk 6 Jan 31, 2008 07:47 AM