I am trying to link my Arduiono Pro Micro to my Ublox SAM-M8Q GPS module.
The GPS is a 3V-5V device from Drotek with an UART and 4 pins (Pow Gnd Rx Tx).
I hooked it up to the Pro Micro serial Tx and Rx pins (1 & 0).
I use the Serial1 function because Serial is reserved to the USB.
I am just trying to communicate with the GPS. I will use a parser later on. I want to check that the GPS module spits out some bytes. So I wrote the very simple following code.
int inByte = 0 ; // For incoming serial data void setup() {
** Serial.begin(9600) ; // This pipes to the serial monitor**
** delay(1000) ; // wait for a second**
** Serial1.begin(9600) ; // This is the UART, pipes to GPS**
** delay(1000) ; // wait for a second**
** if (Serial1)**
** {**
** Serial.println("Serial1 OK") ;**
** }** } void loop() {
** if (Serial1.available() > 0) // Reply only when you receive data:**
** {**
** Serial.println("Serial1 available") ;**
** inByte = Serial1.read() ; // Read the incoming byte**
** Serial.println(inByte) ; // Print byte to the monitor**
** }** }
But nothing happens.
Could it be that I the GPS is not locked? I have checked the connections.
What connections? You only told us about tx and rx. The power and ground can affect whether it can get a fix.
BTW, you should level shift the Arduino transmit pin down to 3v. The typical 4.7V is too high, and could damage The device, draw too much power or affect its ability to get a fix.
And the transmit pin should be shifted up to meet the Arduino spec. Level shifting modules are best. They're cheap and can also be used for high speed interfaces, like SPI to an SD card.
The "3v to 5v" claim by drotek is dubious. It probably needs a 5v Vcc and level-shifted rx and tx. Cant see a schematic to know for sure, but the ublox devices are 3.3v. I doubt there are level shifting components on the board.
You will not have a lot of success reading characters at 9600 baud, then printing a lot of text and the GPS character at 9600baud. You should print to the serial monitor at 115200baud, so the program can keep up.
There is an example of a simple serial GPS echo program here;
You may be right but I think that if some byte had been received then the program would have written to the serial monitor "Serial1 available" at least once.
I will have a look at your code and let you know if it works for me.
I got the same module some days ago. Hooked it up to a USB-serial converter -> no data coming out. Turns out that the RX TX pins labels are switched on the Drotek breakout board. Correct sequence of the pins should read
GND TX RX 5V
and then of course cross the cables to your serial host. Default port speed is 9600 bit/s, the device sends out some messages every 1 second.
I also tested running it at both 5V and 3.3V... works well with my Silabs CP2102 based USB-serial converter.
I got the same module some days ago. Hooked it up to a USB-serial converter -> no data coming out. Turns out that the RX TX pins labels are switched on the Drotek breakout board. Correct sequence of the pins should read
GND TX RX 5V
and then of course cross the cables to your serial host. Default port speed is 9600 bit/s, the device sends out some messages every 1 second.
I also tested running it at both 5V and 3.3V... works well with my Silabs CP2102 based USB-serial converter.
HTH
Werner
Werner you the man!!!
Thank you very much. It works. I had not tried this, I just couldn't imagine Drotek could be so unprofessional.
Drotek should be ashamed… They didn't even help me out. I suppose this was a French joke or what they call the French touch.