Go Down

Topic: [UPDATED] Help Hacking a GPS module named VK16HX (Read 8105 times) previous topic - next topic

AceofSpades

Apr 20, 2014, 07:34 pm Last Edit: Apr 23, 2014, 07:56 pm by AceofSpades Reason: 1
I wasn't sure about where to post my question but this seem as close I can get.

I bought this cheap GPS+Antenna module from ebay. It seemed like the best bet for the money to start learning about GPSs. But as to my surprise, I found no documentation, code, manual or any kind of example.

It came with 6 wires and didn't even mention what is what. But after poking around a bit, I came across a similar device named VK16E which does have similar wiring which seems to be correct.

I have been trying to use TinyGPS++ as it seems all GPSs are encrypted the same standard way? I am using an example with no luck. GPS powers on (red led stays on) and even the led on it blinks but I get nothing in serial monitor. I am not sure if the device is bad or I am approaching it the wrong way?

I will update this question, more and more as needed.

EDIT:

I am using Arduino Leonardo and is using the Serial1 class as suggested.

Here's the link that has information about the VK16HX module (http://www.aliexpress.com/item/5pcs-lot-VK16HX-GPS-wireless-module-with-25-25-4mm-ceramic-antenna-free-shipping/1707909061.html).

Here's the link to the "similar" module to VK16HX, is called VK16E (http://www.aliexpress.com/item/Free-Shipping-1pc-VK16E-GMOUSE-GPS-Module-SIRF3-chip-ceramic-antenna-TTL-signal-9600-baud/1227622444.html).

Currently, i have connected module's VCC, TX, RX, GND to Leonardo's 3.3V, RX(PIN0), TX(PIN1), FIRST GND, respectively.

Here's the code i am using:
Code: [Select]
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

#define RXPIN 0
#define TXPIN 1

SoftwareSerial gpsSerial(RXPIN, TXPIN); // create gps sensor connection
TinyGPSPlus gps; // create gps object

void setup(){
 Serial1.begin(9600); // connect Serial
 gpsSerial.begin(9600); // connect gps sensor
}

void loop(){
 while(gpsSerial.available() > 0) // check for gps data
 gps.encode(gpsSerial.read()); // encode gps data
 if (gps.location.isUpdated())
 {
   // display position
   Serial1.print("LAT=");  Serial1.println(gps.location.lat());
   Serial1.print("LONG="); Serial1.println(gps.location.lng());
   //Serial1.print("ALT=");  Serial1.println(gps.altitude.meters());
 }
}

MAS3

If you google for VK16HX, you'll find a lot of hits.
There's also a bunch of pictures.
One of that is a screenshot of some U-blox tool which states it is connected at 9600 baud.
Did you try a 9600 baud connection yet ?

I know pictures like these can't always be trusted, that particular seller tells you that this VK16HX is a
Quote
VK16E gps module SIRF3: GSM GPRS MODULE
.
Which makes very little sense.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

AceofSpades

#2
Apr 21, 2014, 04:37 am Last Edit: Apr 21, 2014, 04:54 am by AceofSpades Reason: 1
Yes, i have tried 9600 baud rate and even 4800. Led start to flash as soon as i start to "read" but nothing shows up in the Serial Monitor.

I think you may be after a wrong lead which i think is my fault for being generic. I couldn't find anything that said GPRS or GSM, not that those functionality are not possible its just these GPS chips are not fancy/expensive enough to host them.

EDIT: I am adding more information in my main question so it will help us more.

P.S: This forum has serious problems logging in with IE11.

jremington

TinyGPS won't work until you are receiving characters and have the correct baud rate. Try this simple program, which will just echo what is received on the serial port:
Code: [Select]
void loop(){
    if (gpsSerial.available())
        Serial.write(gpsSerial.read());
}

Make sure the ceramic antenna (not the labeled portion of the unit) has a clear view of the sky and you are out of doors. You will get nonsense characters if TX on the GPS is connected to RX on the Arduino, but the baud rate is wrong, but if nothing appears on the serial monitor (and the LED is blinking), the connections are wrong. Fiddle with that until you receive clear messages from the GPS.  Then make sure the messages contain latitude and longitude -- they won't until the GPS has a fix. Then you can use TinyGPS.

Finally, try the GPS unit on 5V instead of 3.3V. The Aliexpress page says (why 3.5V?)
Quote

Wide voltage range: Mains of +3.5 V ~ +5.0 V, owned RTC power
Bottom: 25 * 25 * 4mm ceramic antenna
Output data baud rate 4800bps or 9600bps or customized according to customer requirements

AceofSpades

Thanks, i will make sure i go over all the pointers you listed. When you say clear view of the sky, you literally mean no artificial or natural blockage? That will make testing kindda hard since it rain here a lot.

Regarding the Aliexpress page, i don't trust that source as much. I guess i'm scared to ruin it with more voltage but if i have to, i gotta. Kind of worried about the way they put +5.0V...

Thanks again, i will report back with feedback so it can help someone else in same situation!

AceofSpades

Status update:

1. Used the code jremington gave me.

2. I have tried going outside with perfect clear view of the sky.

3. Fiddle around with RX and TX pins.

4. Also, i tried changing from 3.3V to 5.0V.

5. Made sure the baud rate is 9600 as MAS3 pointed out.

All that with same results, nothing on the Serial Monitor. However, i did find out that Serial class works and Serial1 class doesn't... Maybe a bug or the information is outdated on Leonardo's page?

jremington

If you see nothing at all on the serial monitor, then either the GPS is not transmitting characters (which is unlikely unless it is defective or powered incorrectly), or you have the wrong wire from the GPS attached to RX of the Arduino.

AceofSpades

#7
Apr 23, 2014, 05:23 pm Last Edit: Apr 23, 2014, 05:38 pm by AceofSpades Reason: 1
I poked around a bit and got gibberish to show up on serial monitor.

I have no clue why it worked because all i did was changed the pin 0 and 1 to 10 and 11. That and also i connected PPS to ground (I know that sound sketchy lol) and that seemed to do the trick somehow. I will mess around with it later but my question now is the characters i am receiving does not seem NMEA to me. I will post the output here soon.

jremington

Quote
got gibberish to show up on serial monitor.
The baud rate is probably wrong. Try all possibilities.

azndevil

bump from the dead but let me know if you haven't got it to work yet..

i found the datasheet and pinouts

waldy


I wasn't sure about where to post my question but this seem as close I can get.

I bought this cheap GPS+Antenna module from ebay. It seemed like the best bet for the money to start learning about GPSs. But as to my surprise, I found no documentation, code, manual or any kind of example.

It came with 6 wires and didn't even mention what is what. But after poking around a bit, I came across a similar device named VK16E which does have similar wiring which seems to be correct.

I have been trying to use TinyGPS++ as it seems all GPSs are encrypted the same standard way? I am using an example with no luck. GPS powers on (red led stays on) and even the led on it blinks but I get nothing in serial monitor. I am not sure if the device is bad or I am approaching it the wrong way?

I will update this question, more and more as needed.

EDIT:

I am using Arduino Leonardo and is using the Serial1 class as suggested.

Here's the link that has information about the VK16HX module (http://www.aliexpress.com/item/5pcs-lot-VK16HX-GPS-wireless-module-with-25-25-4mm-ceramic-antenna-free-shipping/1707909061.html).

Here's the link to the "similar" module to VK16HX, is called VK16E (http://www.aliexpress.com/item/Free-Shipping-1pc-VK16E-GMOUSE-GPS-Module-SIRF3-chip-ceramic-antenna-TTL-signal-9600-baud/1227622444.html).

Currently, i have connected module's VCC, TX, RX, GND to Leonardo's 3.3V, RX(PIN0), TX(PIN1), FIRST GND, respectively.

Here's the code i am using:
Code: [Select]
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

#define RXPIN 0
#define TXPIN 1

SoftwareSerial gpsSerial(RXPIN, TXPIN); // create gps sensor connection
TinyGPSPlus gps; // create gps object

void setup(){
 Serial1.begin(9600); // connect Serial
 gpsSerial.begin(9600); // connect gps sensor
}

void loop(){
 while(gpsSerial.available() > 0) // check for gps data
 gps.encode(gpsSerial.read()); // encode gps data
 if (gps.location.isUpdated())
 {
   // display position
   Serial1.print("LAT=");  Serial1.println(gps.location.lat());
   Serial1.print("LONG="); Serial1.println(gps.location.lng());
   //Serial1.print("ALT=");  Serial1.println(gps.altitude.meters());
 }
}



I can tell you that the information from AliBaba regarding the connections for this GPS receiver are correct - see attached video - https://www.youtube.com/watch?v=o5cdIFSfk3g

Richard001

#11
Aug 21, 2016, 05:05 pm Last Edit: Aug 21, 2016, 05:11 pm by Richard001
Hi, I have problem with this script. It work chaotical. I want to know there offset of GPS coordinate. Interupts? Synchronization? Any idea??? Thanks

Code: [Select]

#include <SoftwareSerial.h>
#include <TinyGPS++.h>

#define RXPIN 3
#define TXPIN 2

float latitude1,longitude1,latitude2,longitude2,of_lat,of_lon;

SoftwareSerial gpsSerial(RXPIN, TXPIN); // create gps sensor connection
TinyGPSPlus gps; // create gps object

void setup(){
 Serial.begin(115200); // connect Serial
 gpsSerial.begin(9600); // connect gps sensor
}

void loop(){
 
 while(gpsSerial.available() > 0) // check for gps data
 gps.encode(gpsSerial.read()); // encode gps data
 if (gps.location.isUpdated())
 {
   // display position

   latitude1 = gps.location.lat();
   longitude1 = gps.location.lng();
   Serial.print("LAT=");  Serial.println(latitude1,5);
   Serial.print("LONG="); Serial.println(longitude1,5);
   Serial.println("This is first data from GPS");
   Serial.println("");
   delay(10000);
 }

 while(gpsSerial.available() > 0) // check for gps data
 gps.encode(gpsSerial.read()); // encode gps data
 if (gps.location.isUpdated())
 {
   // display position

   latitude2 = gps.location.lat();
   longitude2 = gps.location.lng();
   Serial.print("LAT=");  Serial.println(latitude2,5);
   Serial.print("LONG="); Serial.println(longitude2,5);
   Serial.println("This is second data from GPS");
   Serial.println("");
   delay(2000);

   of_lat = latitude2-latitude1;
   of_lon = longitude2-longitude1;
   Serial.print("Offset Latitude=");  Serial.println(of_lat,5);
   Serial.print("Offset Longtitude="); Serial.println(of_lon,5);
   Serial.println("");
   Serial.println("");
   delay(8000);

 }

}

Richard001

Done  :D

Code: [Select]


#include <SoftwareSerial.h>
#include <TinyGPS++.h>

#define RXPIN 3
#define TXPIN 2

float latitude1,longitude1,latitude2,longitude2,of_lat,of_lon;

SoftwareSerial gpsSerial(RXPIN, TXPIN); // create gps sensor connection
TinyGPSPlus gps; // create gps object

void setup() {
  Serial.begin(115200); // connect Serial
  gpsSerial.begin(9600); // connect gps sensor
}

void loop() {

    gps.encode(gpsSerial.read()); // encode gps data
    while(gps.location.isUpdated() == 0) {
      while(gpsSerial.available() > 0) { // check for gps data
        gps.encode(gpsSerial.read()); // encode gps data
      }
    }
      // display position
      latitude1 = gps.location.lat();
      longitude1 = gps.location.lng();
      Serial.print("LAT=");  Serial.println(latitude1,19);
      Serial.print("LONG="); Serial.println(longitude1,19);
      Serial.println("This is first data from GPS");
      Serial.println("");
      delay(5000);

    gps.encode(gpsSerial.read()); // encode gps data
    while(gps.location.isUpdated() == 0) {
      while(gpsSerial.available() > 0) { // check for gps data
        gps.encode(gpsSerial.read()); // encode gps data
      }
    }
      // display position
      latitude2 = gps.location.lat();
      longitude2 = gps.location.lng();
      Serial.print("LAT=");  Serial.println(latitude2,19);
      Serial.print("LONG="); Serial.println(longitude2,19);
      Serial.println("This is Second data from GPS");
      Serial.println("");
      delay(2000);

  of_lat = latitude2-latitude1;
  of_lon = longitude2-longitude1;
  Serial.print("Offset Latitude=");  Serial.println(of_lat,19);
  Serial.print("Offset Longtitude="); Serial.println(of_lon,19);
  Serial.println("");
  Serial.println("");
  delay(5000);


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy