I need your help to connect this chip with the arduino.
I cannot find any tutorial with this chip through the internet.
Can you tell me how to connect the pins of this shield to the arduino (I cannot find Tx, the ground on the chip) ?
I already used an GPS shield, but on this one, I don't understand anything about how to connect it on the arduino i.e. the names of the pins are not written on the shield...
Moreover, the library Arduino_MKRGPS is not working. I found a post related to this. The solution was to use TinyGps instead. I guess it should do the job also.
I connected TX to to D2 (pin 2) and RX to D3 (pin 3). And I use the 3.3V from Arduino to the Vin of the gps shield (is it correct or should I connect to VCC ?).
#include <SoftwareSerial.h>
#include <TinyGPS.h>
TinyGPS gps; // creation objet GPS
float lat = 1,lon = 2; // variable stockage latitude et longitude
SoftwareSerial gpsSerial(2,3);//rx,tx
void setup() {
Serial.begin(9600); // ouverture voie serie
gpsSerial.begin(9600); // ouverture voie serie
}
void loop()
{
if (gpsSerial.available())
{
gps.f_get_position(&lat,&lon); // parse latitude et longitude
Serial.println("Position: ");
Serial.print("lat: ");Serial.print(lat);Serial.println(" ");// print latitude
Serial.print("lon: ");Serial.println(lon); // print longitude
}
String latitude = String(lat,6);
String longitude = String(lon,6);
Serial.println(latitude+";"+longitude);
delay(1000);
}
The problem is that there is no data on this condition 'gpsSerial.available()'
Not sure why you expect that to work, if you have processed all the incoming characters from the GPS (i.e. your waiting for another to arrive) the program goes off and does a heap of String stuff and delays for 1000mS. So you will miss most all sentences.
Replace this;
void loop()
{
if (gpsSerial.available())
{
gps.f_get_position(&lat,&lon); // parse latitude et longitude
Serial.println("Position: ");
Serial.print("lat: ");Serial.print(lat);Serial.println(" ");// print latitude
Serial.print("lon: ");Serial.println(lon); // print longitude
}
String latitude = String(lat,6);
String longitude = String(lon,6);
Serial.println(latitude+";"+longitude);
delay(1000);
}
with this;
void loop()
{
while (gpsSerial.available())
{
Serial.write(gpsSerial.read());
}
}
What do you see on the Serial monitor, and do remember the GPS needs to be outside ...........
Srnet's code will be much simpler to see what is going on, and from there narrow down to just what you want.
drop us what your Serial monitor is outputting.
The other 2 things I would confirm... RX and TX out of GPS need to reverse on the In's on the arduino. Not match.
also I'm not sure what it needs, but 2 is digital and 3 is digtal PWM (~). maybe try 7 and 8 or 12 and 13 so at least youre definitely sending the same type of data.
I'd also say go straight into VCC. if it requires 3.3v and you are giving it 3.3v you shouldn't require vin.
Are you getting leds and such from the GPSshield to show its powered and receiving data?
I put the 3.3V of the arduino on the VCC of the shield. Some people on the french arduino forum say that the problem is coming from the Rx and Tx that should be plugged with 3.3V and not with 5V (i.e. arduino uno provides 5V on Rx and Tx). Maybe the shield is already burnt ?
I presume you tried reversing the TX and RX pins, if so than it looks like the GPS is not putting out any data on the GPS TX pin, I would next check that output on a oscilloscope or logic probe.