I have been working on a project for some time and trying to connect my arduino to an adafruit featherwing GPS module. I've been reading a lot of articles but they all connect to an M4 Express. I'm pretty new to all this and try to do a lot of self learning. However, I couldn't figure out if it is also possible to circumvent using the M4 Express and attach the adafruit featherwing gps module directly to my arduino.
Can we assume that you are using a Uno R3 Arduino board as that is the forum category in which you posted ? If so then it looks like you should be able to use SoftwareSerial to create a second serial port on the Uno. However, as pointed out by @J-M-L you will need to use use a voltage level shifter between the two boards
As to a sketch, try this
#include <SoftwareSerial.h>
SoftwareSerial GPSSerial(9, 10); //Rx pin, Tx pin
void setup()
{
// make this baud rate fast enough to we aren't waiting on it
Serial.begin(115200);
// wait for hardware serial to appear
while (!Serial) delay(10);
// 9600 baud is the default rate for the Ultimate GPS
GPSSerial.begin(9600);
}
void loop()
{
if (Serial.available())
{
char c = Serial.read();
GPSSerial.write(c);
}
if (GPSSerial.available())
{
char c = GPSSerial.read();
Serial.write(c);
}
}
The Ultimate GPS Featherwing is not different than any other 3.3V GPS. To use it with a 5V Arduino, power it from the 3.3V output, and connect RX and TX to pins on the Arduino using logic level shifters like this one.
If you don't use level shifters, you may damage both the Arduino and the GPS.
Yes indeed, I wrote that in my last paragraph that I'm using an R3 Uno. I will clarify more in the future.
The arduino Uno R3 does have a 3V power pin. I thought that using this powerpin and the groundpin I could use the RX and TX pin without problem. But you are saying I should use a voltage level shifter for the RX and TX pins?
Do I also need this for the power pins given that I can use the 3V pin?
how would it damage the Arduino ? I always thought the voltage adaptor was really required for the 5V Tx to the 3.3V Rx and not really needed on the 3.3V Tx to the 5V Rx since the 5V MCU will be fine receiving 3.3V and will likely detect that as a HIGH
Yes, but all such inputs have a protective diode to the GPS Vdd, which conducts when 5V is applied, applying 4.3 V to the GPS circuitry causing unpredictable damage to the GPS.
That damage quite possibly extends to the Arduino TX pin circuitry as well.
I haven't been working on it for a while. I just started working on it and saw that the arduino also has a 3.3V pin. So I was wondering how it could be that a logic level shifter is required?