Hi,
I have simple sketch to write GPS data to SD card.
But when I try to power Arduino without USB and GPS module in RX/TX pins, nothing happens.
Am I missing some simple thing, like some kind of handshake between GPS module and Serial?
I can not use any SoftwareSerial library as my GPS module is 10Hz with baud rate 115200 and the libraries does not support it.
Arduino :
BN: Arduino/Genuino Uno
VID: 2341
PID: 0043
I have tested few things that the system should work.
Test 1.
I connect GPS module to RX/TX pins and 5V and Ground.
I upload empty sketch to Arduino.
USB connected.
I open Serial Monitor in Arduino IDE and with the right baud rate (115200) I can see the data flowing just fine.
...
$GPRMC,001534.000,V,,,,,0.00,0.00,060180,,,N*41
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,001534.100,,,,,0,0,,,M,,M,,*4A
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
...
Test 2.
I upload the following sketch.
#include <SPI.h>
#include <SD.h>
String dataString = "";
void setup() {
Serial.begin(115200);
while(!Serial){
;
}
Serial.flush();
SD.begin(4);
}
void loop() {
char c;
if(Serial.available() > 0){
c = Serial.read();
if(c == '
I open Serial Monitor in Arduino IDE and send for example "$TEST$" to Arduino.
The message gets saved ("$TEST") to the file.
Test 3.
With that sketch, I connect GPS module to Arduino TX/RX, 5V and Ground.
I power the Arduino with the 12V. (USB is disconnected)
Everything should work according to my knowledge... but it's not. Nothing happens.
Summary
In Test 1. I clearly see data coming in Serial with baud rate 115200.
In Test 2. I clearly see data moving from Serial to SD card.
Why Test 3. does not work?
ps. I also tried Arduino Nano as Serial writer, no luck so I don't think the GPS module is faulty or anything like that. I also tried to cast the byte from Serial.read() to int, char etc. but it works in Test 2. but not in Test 3.){
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
dataString = c;
}
}
else{
dataString += c;
}
}
}
I open Serial Monitor in Arduino IDE and send for example "$TEST$" to Arduino.
The message gets saved ("$TEST") to the file.
**Test 3.**
With that sketch, I connect GPS module to Arduino TX/RX, 5V and Ground.
I power the Arduino with the 12V. (USB is disconnected)
Everything should work according to my knowledge... but it's not. Nothing happens.
**Summary**
In Test 1. I clearly see data coming in Serial with baud rate 115200.
In Test 2. I clearly see data moving from Serial to SD card.
Why Test 3. does not work?
ps. I also tried Arduino Nano as Serial writer, no luck so I don't think the GPS module is faulty or anything like that. I also tried to cast the byte from Serial.read() to int, char etc. but it works in Test 2. but not in Test 3.