Shop OBEX P1 Docs P2 Docs Learn Events
GPS Datalogger (Using Google Earth) - Page 2 — Parallax Forums

GPS Datalogger (Using Google Earth)

24

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-07-06 20:12
    Actually it is a little simpler and a little more difficult at the same time when powering down the Datalogger. I too did this in my original experimental teenager logger (mentioned in the article). Using a BS2p is the wise move here because you will need the extra memory (I did) to implement extra features (well, error handling mainly).

    My files were stored as "FILE", DEC4 fileNum, ".KLM" so that every filename was formatted as FILExxxx.KLM where xxxx was a number from 0000 to 9999. What I did was on the first run a specific EEPROM location had not been initialized, so it was set to $00 and then the first file was opened. As I said, at this point I had a lot of error handling routines in place so all of this section was running from slot 1 on the BS2p, but the main code was run from slot 0.

    Once the ignition signal was lost the unit would go into low-power standby mode but first the file was close and the file number stored in EEPROM was incremented. On next ignition the new file was opened with the next sequential file number. I find this to be a faster and more reliable way to handle this. This also makes it easy if the vehicle is frequently started and stopped. You have up to 9999 events to log so...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • dead-eyedead-eye Posts: 2
    edited 2010-09-17 16:10
    Hey there, Chris. I just got the GPS Datalogger Kit and I'm looking forward to building it. I was wondering, though, how different was the original Teenager logger, besides using the BS2P?

    I'd love to see the details on that project sometime. Thanks!

    -Matt.
  • kf4ixmkf4ixm Posts: 529
    edited 2010-09-23 12:00
    Hey Chris, hope all is well with you!
    Got a question...
    I was playing with the gps datalogger, everything went well, stored data like it should, but it would not open in google earth. here is the error it gave me...
    attachment.php?attachmentid=73408&stc=1&d=1285268273

    here is the kml file also if you wanna take a look at it.
    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.2">
    <Document>
    <name>Paths</name>
    <Style id="yellowLineGreenPoly">
    <LineStyle>
    <color>7f00ffff</color>
    <width>4</width>
    </LineStyle>
    <PolyStyle>
    <color>7f00ff00</color>
    </PolyStyle>
    </Style>
    <Placemark>
    <name>Absolute Extruded</name>
    <styleUrl>#yellowLineGreenPoly</styleUrl>
    <LineString>
    <extrude>1</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>clampToGround</altitudeMode>
    <coordinates>
    -081.6203, 035.6970,0410
    -081.6203, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6204, 035.6970,0410
    -081.6203, 035.6970,0410
    -081.6203, 035.6970,0410
    -081.6203, 035.6970,0410
    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.2">
    <Document>
    <name>Paths</name>
    <Style id="yellowLineGreenPoly">
    <LineStyle>
    <color>7f00ffff</color>
    <width>4</width>
    </LineStyle>
    <PolyStyle>
    <color>7f00ff00</color>
    </PolyStyle>
    </Style>
    <Placemark>
    <name>Absolute Extruded</name>
    <styleUrl>#yellowLineGreenPoly</styleUrl>
    <LineString>
    <extrude>1</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>clampToGround</altitudeMode>
    <coordinates>
    -081.6206, 035.6971,0410
    -081.6206, 035.6972,0410
    -081.6206, 035.6972,0410
    -081.6206, 035.6972,0410
    -081.6206, 035.6972,0410
    -081.6205, 035.6971,0410
    -081.6205, 035.6971,0410
    -081.6205, 035.6971,0410
    -081.6205, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    -081.6204, 035.6971,0410
    </coordinates>
    </LineString>
    </Placemark>
    </Document>
    </kml>
    

    the forums would not let me upload the kml file.
    the only thing i have changed in the code was the led output pins from 0,1 to 7,8 respectivly.

    EDIT:
    Amazing what a cup of coffee and another look will do, i took another look at the kml file and noticed that it had actually doubled up the data inside the file. still don't know why, but i took the top part of the file out, from the top to the second <?xml... and it opened correctly.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-09-30 16:30
    Glad you figured it out since I was late getting to your message. Sorry about that...after counting down to line 43 I realized that was supposed to be line 1. Somehow your program had not written the 'footer' data before it restarted. I will be revising this project in a future upgraded project which demonstrates the fleet manegement system I imeplemnted for an old customer. The company is now defunct and those systems were destroyed so I can give the information away. ;) Future SCTV episode I think.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-13 07:55
    Awesome project Chris!

    KK
  • kf4ixmkf4ixm Posts: 529
    edited 2010-10-13 08:02
    Glad you figured it out since I was late getting to your message. Sorry about that...after counting down to line 43 I realized that was supposed to be line 1. Somehow your program had not written the 'footer' data before it restarted. I will be revising this project in a future upgraded project which demonstrates the fleet manegement system I imeplemnted for an old customer. The company is now defunct and those systems were destroyed so I can give the information away. ;) Future SCTV episode I think.

    Cool! i'll be keepin an eye out for that SCTV episode. :)

    I think the problem was (forever what reason) is that i had statred the program a couple of times, i was first trying it inside, but wasn't getting a gps lock. i powered it down then moved outside and powered it up, it seems like to me instead of overwriting the old file it appended to it instead. i've tried to replicate it a couple of times but had no luck, maybe it was a vicilium chip bug or something to do with the usb datalogger. have no idea, but anywho, it does work now as it's supposed to. Great project!
  • SPolySPoly Posts: 20
    edited 2011-09-30 01:21
    HI Chris,

    I have followed all the steps you have given but I am stuck at the GPS Datalogger program. On the debug screen it just kept showing "Waiting for GPS signal". However if I were to run the GPS test prgoram, the signal can be detected but not for the datalogger program. Please help, thank you.
  • RagtopRagtop Posts: 406
    edited 2011-09-30 15:02
    I did a Google Earth data logger with the propeller. It is amazing what you can do with KML. Here I have it move a 3d model along the path I took.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-09-30 15:09
    When you're seeing the waiting for GPS message, is the light on the GPS Module blinking or solid? Also, have you checked to make sure that button 1 is connected properly as per the schematic?

    Also, if the system (bi-color) LED is solid green then the GPS has a lock and you must press Button 1 to start logging data. I did not put a DEBUG message for GPS lock. DEBUG statements take up a lot of memory and this program uses almost every byte, so there was not enough memory to DEBUG all status messages.

    In fact, if you've read the original article about the first logger having more functions, that is how I did it. There are no debug messages in the full version I originally created and it can sense the car's ignition and close the current file as well as appending to it upon restart. I also wrote a version that creates multiple files, though I prefer the single file program. I will try to post that soon.
  • briancarterbriancarter Posts: 2
    edited 2011-10-01 10:53
    Ragtop wrote: »
    I did a Google Earth data logger with the propeller. It is amazing what you can do with KML. Here I have it move a 3d model along the path I took.


    Can you post your propeller code? or email it to me (briancarter@chipsofttech.com). TY!
  • briancarterbriancarter Posts: 2
    edited 2011-10-01 10:57
    I'm looking to do a local hack-a-thon using the GPS Datalogger. I noticed the kit uses a serial board. Would post/send me your latest code? Also, you said the basicp stamp would be better. Would you spec out the parts I'd need for a USB kit using basicp? Thanks! Brian Carter (briancarter@chipsofttech.com)
  • RagtopRagtop Posts: 406
    edited 2011-10-01 11:15
    Ragtop wrote: »
    I did a Google Earth data logger with the propeller. It is amazing what you can do with KML. Here I have it move a 3d model along the path I took.


    Can you post your propeller code? or email it to me (briancarter@chipsofttech.com). TY!

    I am afraid it is not very well documented, but here it is.
    CON
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ = 5_000_000
    
    
    obj
       sdcard: "fsrw"
       gps   : "GPS_Float"
       FS    : "FloatString"
     
    
    var
       long latold, latnew, longold, longnew, distance
       long x, filenum, open, oldelevation, newelevation
       long Stack[32], carpressed, bikepressed, hikepressed, firstloopcheck
       long model
       long year, month, day, hour, minute, second, endhour,endminute,endsecond
       long count 'for counting every 8th icon to fly map over to new position
       long Elcheck,rtcheck 'elevation and rotation changes
    pub main                               '900 coordinate updates an hour / every 4 seconds
           sdcard.mount(1)    ' 1 cog 
           gps.init             ' 4 cogs
           initButtons         ' 1 cog
           
           dira[7]~~         'card writing LED indicator
           outa[7] := 0
           dira[6]~~         'sat fix LED indicator
           outa[6] := 0
           filenum := 1
           open := 0
           model := 0
           carpressed := 0
           bikepressed := 0
           hikepressed := 0
           main2
    Pub main2
           firstloopcheck := 0     
           repeat
              repeat while carpressed == 0 and bikepressed == 0 and hikepressed == 0  'just wait until button pressed first time
                CheckSatFix 
              ShortBlink
    
              if open == 1       'if file open and button pressed, close file.
                 Endfile
                 firstloopcheck := 0
                 carpressed := 0
                 bikepressed := 0
                 hikepressed := 0              
              else
                 distance := 0   'start new file using filenum to increment filenames
                 if carpressed == 1 
                    model := 1
                 if bikepressed == 1
                    model := 2
                 if hikepressed == 1
                    model := 3                          
                 carpressed := 0
                 bikepressed := 0
                 hikepressed := 0 
                 Openfile
    
    Pub Openfile
              case filenum
                 1:   sdcard.popen(string("track1.kml"),"w")
                 2:   sdcard.popen(string("track2.kml"),"w")
                 3:   sdcard.popen(string("track3.kml"),"w")
                 4:   sdcard.popen(string("track4.kml"),"w")
                 5:   sdcard.popen(string("track5.kml"),"w")
                 6:   sdcard.popen(string("track6.kml"),"w")
                 7:   sdcard.popen(string("track7.kml"),"w")
                 8:   sdcard.popen(string("track8.kml"),"w")
                 9:   sdcard.popen(string("track9.kml"),"w")
                 10:  sdcard.popen(string("track10.kml"),"w")
    
              'term1
              WriteFileHeader
              filenum++
              open := 1
              count := 1
              WriteIcons
    Pub EndFile
            Shortblink
            'CheckSatFix
            TakeReading
            sdcard.SDStr(string("<Placemark>",13,10))
            'TimeStamp  
            sdcard.SDStr(string("<name>Finished. Distance traveled is "))
            sdcard.sddec(distance)
            sdcard.SDStr(string(" ft "))
            sdcard.sdstr(fs.floattostring(gps.miles))
            sdcard.SDStr(string(" miles </name>",13,10))    
    
            elcheck := gps.ElevationCheck
            rtcheck := gps.rotation 
            WriteModel
    
            sdcard.SDStr(string("</Placemark>",13,10))
    
            sdcard.SDStr(string(" </Document>",13,10))
     
            sdcard.SDStr(string("</kml>",13,10)) 
            sdcard.pclose
            LongBlink
            open := 0
    
    PUB InitButtons
       cognew(button(@carpressed,@bikepressed,@hikepressed), @stack)
    
    Pub button(cp,bp,hp)             'three buttons to start hike, bike, or car track
       dira[8]~   'car
       dira[11]~   'bike
       dira[10]~  'hike
       long[cp] := 0        'car press
       long[bp] := 0        'bike press
       long[hp] := 0        'hike press
       repeat
     
         if ina[8] == 1       'stores a button press until an action is done in main program to remove timing issues.
            long[cp] := 1
         if ina[11] == 1       
            long[bp] := 1
         if ina[10] == 1       
            long[hp] := 1
            
    Pub CheckSatFix
        repeat while gps.Long_Fix_Quality < 1 or gps.Long_Fix_Quality > 8
           FixIndicatoroff
           if open == 1
              if carpressed == 1 or bikepressed == 1  or hikepressed == 1 
                 endfile
                 main2
        FixIndicatorOn   
        
    Pub FixIndicatorOn
        outa[6] := 1
    Pub FixIndicatorOff
        outa[6] := 0    
    
    Pub WriteFileHeader
                sdcard.SDStr(string("<?xml version='1.0' encoding='UTF-8'?>",13,10))
                sdcard.SDStr(string("<kml xmlns='http://www.opengis.net/kml/2.2'",13,10))
                sdcard.SDStr(string("xmlns:gx='http://www.google.com/kml/ext/2.2'>",13,10))
                'sdcard.SDStr(string("<Feature id='Ragtops path'>",13,10))
                 
                sdcard.SDStr(string("  <Document>",13,10))
                sdcard.SDStr(string("<description>This is track #"))
                sdcard.SDDec(filenum)
                sdcard.SDStr(string(" that was started on "))
                sdcard.sddec(gps.Long_Month)
                sdcard.SDStr(string("/"))
                sdcard.sddec(gps.Long_Day) 
                sdcard.SDStr(string("/"))
                sdcard.sddec(gps.Long_year)
                sdcard.SDStr(string("</description>",13,10))
    
                TakeReading
    
                sdcard.SDStr(string("<Placemark>",13,10))
                'TimeStamp            
                sdcard.SDStr(string("<name>Start</name>",13,10))
    
                WriteModel
                   
                sdcard.SDStr(string("</Placemark>",13,10))
                firstloopcheck := 1              
    
    
        
    
    PUB WriteModel
       case model
           1:  sdcard.SDStr(string("<Model id='car'>",13,10)) 
           2:  sdcard.SDStr(string("<Model id='bike'>",13,10))
           3:  sdcard.SDStr(string("<Model id='hike'>",13,10))
       TimeStamp    
       sdcard.SDStr(string("<altitudeMode>relativeToGround</altitudeMode>",13,10))
       sdcard.SDStr(string("<Location>",13,10))
       sdcard.SDStr(string("<longitude>"))
       sdcard.sdstr(fs.floattostring(longnew))
       sdcard.SDStr(string("</longitude>",13,10)) 
       sdcard.SDStr(string("<latitude>"))
       sdcard.sdstr(fs.floattostring(latnew))
       sdcard.SDStr(string("</latitude>",13,10)) 
       sdcard.SDStr(string("<altitude>0</altitude>",13,10))    
       sdcard.SDStr(string("</Location>",13,10))
       sdcard.SDStr(string("<Orientation>",13,10))
       if model == 2
              case rtcheck
                         1:  sdcard.SDStr(string("<heading>270</heading>",13,10))               'north
                         2:  sdcard.SDStr(string("<heading>315</heading>",13,10))             'north east 
                         3:  sdcard.SDStr(string("<heading>0</heading>",13,10))  'east
                         4:  sdcard.SDStr(string("<heading>45</heading>",13,10)) 'southeast
                         5:  sdcard.SDStr(string("<heading>90</heading>",13,10))   'south
                         6:  sdcard.SDStr(string("<heading>135</heading>",13,10))   ' southwest 
                         7:  sdcard.SDStr(string("<heading>180</heading>",13,10))    'west
                         8:  sdcard.SDStr(string("<heading>225</heading>",13,10))   'northwest
       else
              case rtcheck
                         1:  sdcard.SDStr(string("<heading>180</heading>",13,10))               'north
                         2:  sdcard.SDStr(string("<heading>225</heading>",13,10))             'north east 
                         3:  sdcard.SDStr(string("<heading>270</heading>",13,10))  'east
                         4:  sdcard.SDStr(string("<heading>315</heading>",13,10)) 'southeast
                         5:  sdcard.SDStr(string("<heading>0</heading>",13,10))   'south
                         6:  sdcard.SDStr(string("<heading>45</heading>",13,10))   ' southwest 
                         7:  sdcard.SDStr(string("<heading>90</heading>",13,10))    'west
                         8:  sdcard.SDStr(string("<heading>135</heading>",13,10))   'northwest
                                         
       sdcard.SDStr(string("<tilt>0</tilt>",13,10))  
       sdcard.SDStr(string("<roll>0</roll>",13,10))    
       sdcard.SDStr(string("</Orientation>",13,10))   
       sdcard.SDStr(string("<Scale>",13,10)) 
       sdcard.SDStr(string("<x>1</x>",13,10))  
       sdcard.SDStr(string("<y>1</y>",13,10))
       sdcard.SDStr(string("<z>1</z>",13,10))   
       sdcard.SDStr(string("</Scale>",13,10)) 
       sdcard.SDStr(string("<Link>",13,10))
       case model
         1:  sdcard.SDStr(string("<href>car.dae</href> ",13,10))
         2:  sdcard.SDStr(string("<href>bike.dae</href> ",13,10))
         3:  sdcard.SDStr(string("<href>hike.dae</href> ",13,10))
        
       sdcard.SDStr(string("</Link>",13,10))
    
    
       sdcard.SDStr(string("</Model>",13,10)) 
    
                        
                
    
      
    
    Pub WriteIcons
    
                 repeat while carpressed == 0 and bikepressed == 0 and hikepressed == 0
                    Shortblink
                    CheckSatFix
                    TakeReading            
    
                    count++
                    elcheck := gps.ElevationCheck
                    rtcheck := gps.rotation
     
                    sdcard.SDStr(string("<Placemark>",13,10))  
                    sdcard.SDStr(string("<name>"))
                    'sdcard.sddec(gps.Long_Hour)
                    'sdcard.SDStr(string(":"))
                    'sdcard.sddec(gps.Long_minute)
                    {sdcard.SDStr(string(" *E* "))
                    sdcard.SDDec(Elcheck)
                    sdcard.SDStr(string(" *R* "))
                    sdcard.SDDec(rtcheck)}                  
                    sdcard.SDStr(string("</name>",13,10))
                    ' check for being stopped.  only want one icon, so need to check if still stopped.
                    WriteModel
                    TimeStamp 
                    sdcard.SDStr(string("</Placemark>",13,10))
    
    
                        
                   waitcnt (clkfreq * 4 + cnt)
    
    
    
           
    Pub ShortBlink
           repeat 8
              !outa[7]
              waitcnt(9000_000 + cnt)
          
              
    Pub LongBlink
          outa[7] := 1
          waitcnt(clkfreq * 4 + cnt)
          outa[7] := 0
    
    Pub RecordOn
        outa[7] := 1
    
    Pub RecordOff
        outa[7] := 0               
    
    PUB TakeReading
        CheckSatFix
        longold := longnew
        latold := latnew
        longnew := gps.Float_Longitude_Deg
        latnew :=  gps.Float_Latitude_Deg
        if firstloopcheck <> 0
            gps.distance(latold,longold,latnew,longnew)
            distance := gps.final
        
            
    
    
    Pub TimeStamp
    
         sdcard.SDStr(string("<TimeSpan>",13,10))
         sdcard.SDStr(string("<begin>"))
         year:=gps.Long_year
         month:=gps.long_month
         day:=gps.long_day
         hour:=gps.long_hour - 4
         minute:=gps.long_minute
         second:=gps.long_second
         
         sdcard.sddec(gps.Long_year)
         sdcard.SDStr(string("-"))
         if month < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(month)
         else
            sdcard.sddec(month)    
       
         sdcard.SDStr(string("-"))
         
         if day < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(day)
         else
            sdcard.sddec(day)
            
         sdcard.SDStr(string("T"))
            
         if hour < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(hour)
         else
            sdcard.sddec(hour)
            
         sdcard.SDStr(string(":"))
            
         if minute < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(minute)
         else
            sdcard.sddec(minute)
            
         sdcard.SDStr(string(":"))
            
         if second < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(second)
         else
            sdcard.sddec(second)
    
         sdcard.SDStr(string("Z</begin>"))
    
         sdcard.SDStr(string("<end>"))
         CalculateEndTime
         sdcard.sddec(gps.Long_year)
         sdcard.SDStr(string("-"))
         if month < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(month)
         else
            sdcard.sddec(month)    
       
         sdcard.SDStr(string("-"))
         
         if day < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(day)
         else
            sdcard.sddec(day)
            
         sdcard.SDStr(string("T"))
            
         if endhour < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(endhour)
         else
            sdcard.sddec(endhour)
            
         sdcard.SDStr(string(":"))
            
         if endminute < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(endminute)
         else
            sdcard.sddec(endminute)
            
         sdcard.SDStr(string(":"))
            
         if endsecond < 10
            sdcard.SDStr(string("0"))
            sdcard.sddec(endsecond)
         else
            sdcard.sddec(endsecond)
    
         sdcard.SDStr(string("Z</end>"))
              
         sdcard.SDStr(string("</TimeSpan>",13,10))
    
    Pub CalculateEndTime
         if (second + 10) > 60
             if (minute + 1) > 60
                endhour := hour + 1
                endminute := 0
                endsecond := (second + 10) - 60  
             else
                endhour := hour
                endminute := minute + 1
                endsecond := (second + 10) - 60
         else
           endhour := hour
           endminute := minute
           endsecond := second + 10            
    
  • SailingEricSailingEric Posts: 33
    edited 2011-11-19 13:47
    Hi all!
    As a regatta sailor, I would like to log NMEA data for later analysis to improve my performance, but I have a few questions.

    For this I would like to put together the GPS data logger kit (Item code 910-27937) form its components without the GPS module, as I would like to input NMEA data form my electronic navigation NMEA network. As I don’t have a serial connection on my computer I plan to add the RS232-USB connector (Item code 28031) to the set.

    The TackTick-network on my boat (Garmin GPS and a TackTick windmeter) has a standard NMEA (0183 V2.30) output. Received Sentences: DBT, DPT, GLL, HDG, HDM, MTW, MWV, RMB, RMC, VHW, VLW, VWR. Transmitted Sentences: DPT, GLL, HDG, MTW, MWV, RMB, RMC, VHW, VLW, VWR. The idea is to log timestamp, wind angle and speed, boat speed and course. The GPS also produces a log containing position, speed, course.
    I have not been able to log the output yet (no RS232 on my computers), so I’m not sure of the order of the sentences.
    As the system produces output approximately every second, I think of averaging 10 points which will also stabilize the numbers.

    Possibly I would like to add a live display in a later stage presenting deviation from previous average course to alert for tactical opportunities.
    The questions I have:
    1. Is it possible to add the RS232-USB connector to this kit
    2. Can I connect the Tacktick NMEA output straight to the logger input where the GPS module input originally is (and read its outputJ)?
    3. What Basic Stamp would I need for this task? Bigger leaves more options open, but consumes more power from the battery
    4. Would Chris Savages GPS Datalogger software be a good start for software?
    Although I’m new to the Parallax products, and only have basic experience in programming, I have help from my son who did a Boe-Bot school project recently.
    Thanks for your input and ideas.
    Eric
  • SRLMSRLM Posts: 5,045
    edited 2011-11-20 17:17
    It sounds like the boat system will output the NMEA strings out over RS232?

    1. You can use the Parallax RS232-USB converter only if you want to read the NMEA signals on a PC (via a USB port). It won't work to hook it up to a microcontroller.
    2. I would use one of these (or similar): http://www.pololu.com/catalog/product/126. You should be able to connect the RX line where the GPS line is on the kit sample code, and it will run the same.
    3. I would use one of the faster BS2s just to make sure that you have time to do everything that needs to be done. It would also depend on the baud rate of the NMEA system on your boat. IIRC correctly the BS2 can only go up to 9600 baud. I would use a BS2px. It only draws 55mA, or .275 watts.
    4. You can use the datalogger routines in that code, but you'll need to replace the GPS routines (he used the "smart" mode of the Parallax GPS, not NMEA). If you look around the web I'm sure that there are BS2 routines to read NMEA data.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-11-22 10:55
    Possibly I would like to add a live display in a later stage presenting deviation from previous average course to alert for tactical opportunities.
    The questions I have:
    1. Is it possible to add the RS232-USB connector to this kit
    2. Can I connect the Tacktick NMEA output straight to the logger input where the GPS module input originally is (and read its outputJ)?
    3. What Basic Stamp would I need for this task? Bigger leaves more options open, but consumes more power from the battery
    4. Would Chris Savages GPS Datalogger software be a good start for software?
    Eric
    1. The #28031 adapter you mentioned would work just fine for connecting the Super Carrier Board via USB.
    2. Yes, you can connect your GPS output to the BASIC Stamp Module, but not directly. You will need a 22K resistor and you will need to invert the baud mode used.
    3. The BS2p series all have a provision for capturing the serial data into SPRAM where it can be parsed to extract the fields you need, such as Latitude and Longitude. If needed I can provide a separate program which shows how to use the BS2p to read GPS data.
    4. Once the changes are made for the RS-232 into the datalogger (inverted via 22K resistor) and you have a BS2p with the modified software you could certainly save time on development by using this program as a base. As a note, I will be putting up the original datalogger project soon which did use a BS2p and a standard GPS module and also had more features.
  • SailingEricSailingEric Posts: 33
    edited 2011-12-01 03:36
    Thanks for your reply!
    @SLRM
    1. I need the RS232-USB connector for communication and programming with my PC
    2. It’s clear to me now that I need a RS232 to connect to the NMEA-out from the network. As far as I understand the NMEA output of a marine network would normally be connected to RS232 pin 3 and 5. The Pololu seems to be difficult to get for me in the Netherlands. Doesn’t Parallax have similar products? These I can obtain via a distributor. Also see Chris' answer on this.
    3. Thanks. You’re probably right to choose a faster stamp. Power consumption is low, but I work on board battery, so not endless…
    4. I realize the routines have to be adjusted. I presume that will become more clear when I have the first readings of the output. So far I have not been able to connect to the PC due to the RS232 requirement
    @ Chris:
    1. That helps! Then I presume this would be my shopping list?
    As in the kit, but without the GPS module
    (1) Super Carrier Board
    (1) BASIC Stamp 2 Module (BS2P?)
    (1) Memory Stick Datalogger
    (2) 10K Resistors
    (1) 220 Ohm Resistor
    (2) Tact Switch
    (1) Bi-Color LED
    Extra:
    #28031 USB-RS232 connector
    22K Resistor
    1. This 22K resistor, should it be at pin3? How do you mean: “invert Baud rate?” I tried to search the forum on this but could not get it clear yet :-( Would you have a diagram available maybe?
    2. Thanks for the offer! That would help, although I would like to try myself first….
    3. Interesting! You already mentioned this somewhere else in the forum. That would steepen my learning curve I presume
    Eric
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-12-01 15:09
    Eric, the BASIC Stamp modules use TRUE or INVERTED baud mode. If you are using the resistor and feeding the RS-232 signal into the I/O pin you would use inverted baud mode (see help on SERIN for more information) rather than TRUE baud mode.
  • billykbillyk Posts: 1
    edited 2011-12-04 09:08
    Hi everyone! Im wanting to remove the buttons from the the GPS datalogger program. I removed the first button that starts the logging process and i have it starting the process after it receives a valid signal but Im wanting it to log for 5 mins then stop and write the data to the flashdrive without the aid of the second button. I attached my file if anyone can help me out it would be GREATLY APPRECIATED ! finalprogram3.bs2
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-12-04 20:19
    You could access the UTC time from the GPS and use that to determine when 5 minutes have passed and then close the file. It would be pretty straight foward if you understand what the code is doing. Otherwise you might use a 555 timer or some other simple external timer to output to the pin used by the second button and detect that to stop logging. It would almost like simulating a button press.
  • max72max72 Posts: 1,155
    edited 2011-12-05 07:26
    SailingEric, I'm doing similar thing with the Propeller.
    I'm logging GPS data and wind, but using a dedicated anemometer. I'm checking the possibility to interface to the tacktick NMEA unit, and it has an RS484 data output. I have yet to try it, but an RS485->serial tranceiver should do the job. The ground is common to all the circuits, and the RS485 tranceiver will keep your two instruments worlds connected in a safe way.
    I Also emailed tacktick asking questions about interfaciing their instruments with other, third party hardware, but (strangely) they didn't answer.
    Massimo
  • SailingEricSailingEric Posts: 33
    edited 2011-12-05 13:00
    Thank you Massimo!
    I've been looking for this and couldnt find it 8-$
    Where did you find this info?
    Also baud rates (which I thought I needed), and indeed Tacktick does not help a lot. I managed to get a reply, but they could only refer to the internet for information on NMEA connectivity...
    Which seems to be getting more true every week!
    You realize Tacktick has switched owner from Suunto to Raymarine? They might be very occupied with internal matters for some time.

    Why Propeller? Is it better for this job? Propeller uses different progamming than Basic Stamp? Or could I use/see your programming? I'm a newbee on this...
    I might decide to purchase a Propeller set if it makes my life much easier.

    Eric
  • max72max72 Posts: 1,155
    edited 2011-12-05 14:36
    I think we are hijacking Chris's thread. Probably better starting a new discussion on "general" or "sensors"?
    We can share the infos and hopefully get there faster..
    Massimo

    edit: http://forums.parallax.com/showthread.php?136417-Interfacing-to-the-tacktick-NMEA-unit&p=1057019#post1057019
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-06 02:05
    O.T. For those interested, I have answered Massimo's thread http://forums.parallax.com/showthread.php?136417-Interfacing-to-the-tacktick-NMEA-unit where I describe what I did a few years ago with the propeller and reading the NEMA data.
  • bridger deschampsbridger deschamps Posts: 17
    edited 2012-08-08 23:28
    Hey I am having problems with the code. I do the gps test and it works fine then I load the data logger code and the led turns off cause it can not recognize the gps. can you help me thanks Bridger
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-08-10 10:54
    Which GPS Module are you using?
  • bridger deschampsbridger deschamps Posts: 17
    edited 2012-08-14 23:41
    Which GPS Module are you using?
    I am using vpn1513 gps board. it is the blue gps board parallax sells
  • SRLMSRLM Posts: 5,045
    edited 2012-08-15 00:20
    @ bridger

    Did you try changing the baud to 9600? It looks like the VPN module's smart mode is at 9600, not 4800 like the code has it.

    What is the RAW pin connected to?
  • bridger deschampsbridger deschamps Posts: 17
    edited 2012-08-15 22:20
    SRLM wrote: »
    @ bridger

    Did you try changing the baud to 9600? It looks like the VPN module's smart mode is at 9600, not 4800 like the code has it.

    What is the RAW pin connected to?
    ok I will try that and the raw pin is at 13 like the code specified.
  • bridger deschampsbridger deschamps Posts: 17
    edited 2012-08-15 22:26
    SRLM wrote: »
    @ bridger

    Did you try changing the baud to 9600? It looks like the VPN module's smart mode is at 9600, not 4800 like the code has it.

    What is the RAW pin connected to?

    Hey thanks I would have never thought of that. thanks for your help.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-08-16 13:35
    My apologies, the source code was written originally for the Parallax part # 28146 which has since ben discontinued. I will eventually revise this project to work with any GPS capable of outputting RAW NMEA0813 data.
Sign In or Register to comment.