Components and supplies
Level Shifter Board
Arduino MKR GPS Shield
Wire, Wrapping Wire
MicroSD Card with Adapter
Arduino Nano Every
Power Bank Electronics
Li-Ion Battery 1000mAh
Slide Switch
Tools and machines
Soldering iron (generic)
3D Printer (generic)
Project description
Code
Gnome Tracker
arduino
Load this sketch and compile it after you have downloaded TinyGPSPlus library from http://arduiniana.org/libraries/tinygpsplus/
1#include <TinyGPS++.h> 2#include <SPI.h> 3#include <SD.h> 4 5TinyGPSPlus gps; 6 7int chipSelect = 4; // digital pin 4 for the SD cs line 8File logfile;// the logging file 9 10//data logger timing and other 11long logPace=10000; // 10 seconds between entries 12long readTime = 0; // time of last read() 13#define DEBUG 1 // echo GPS data to serial port for debug purposes 14 15void setup() { 16 Serial.begin(115200); 17 Serial1.begin(9600); // our module communicates at 9600 18 delay(1000); 19 Serial.println("Basic Initialization"); // we sen something to the consolle 20 21 // initialize the SD card 22 Serial.print("Initialising SD card..."); 23 24 // see if the card is present and can be initialized: 25 if (!SD.begin(chipSelect)) { 26 Serial.println("Card read failed, or not present"); 27 // Stop the sketch 28 return; 29 } 30 Serial.println("card initialized."); 31 32 // create a new file 33 char filename[] = "GnomeT00.CSV"; 34 for (byte i = 0; i < 100; i++) { 35 filename[6] = i / 10 + '0'; 36 filename[7] = i % 10 + '0'; 37 if (! SD.exists(filename)) { 38 // open the next file in the numbered sequence 39 logfile = SD.open(filename, FILE_WRITE); 40 break; // leave the loop! 41 } 42 } 43 44 Serial.print("Logging to: "); 45 Serial.println(filename); 46 47 logfile.println("latitude, longitude, altitude, date, time"); 48 49#if DEBUG //serial debug active? 50 Serial.println("Serial Debug Active"); 51 Serial.println(); 52 Serial.println("latitude, longitude, date, time, altitude"); 53#endif// we show the columns for the data sent to console 54 55#if !DEBUG //serial debug deactivated 56 Serial.println("No Serial Debug"); 57#endif 58} 59 60void loop() { 61 62 while (Serial1.available() > 0) 63 { 64 gps.encode(Serial1.read()); 65 if (gps.location.isValid()) 66 { 67 if ((millis() - readTime) < logPace) return; 68 readTime = millis(); 69 logfile.print(gps.location.lat(), 6); 70 logfile.print(", "); 71 logfile.print(gps.location.lng(), 6); 72 logfile.print(", "); 73 logfile.print(gps.altitude.meters(), 0); 74 logfile.print(", "); 75 logfile.print(gps.date.day()); 76 logfile.print(F("/")); 77 logfile.print(gps.date.month()); 78 logfile.print(F("/")); 79 logfile.print(gps.date.year()); 80 logfile.print(", "); 81 if (gps.time.hour() < 10) logfile.print(F("0")); 82 logfile.print(gps.time.hour()); 83 logfile.print(F(":")); 84 if (gps.time.minute() < 10) logfile.print(F("0")); 85 logfile.print(gps.time.minute()); 86 logfile.print(F(":")); 87 if (gps.time.second() < 10) logfile.print(F("0")); 88 logfile.print(gps.time.second()); 89 logfile.println(""); 90#if DEBUG //serial debug active? 91 Serial.print(gps.location.lat(), 6); 92 Serial.print(", "); 93 Serial.print(gps.location.lng(), 6); 94 Serial.print(", "); 95 Serial.print(gps.date.day()); 96 Serial.print(F("/")); 97 Serial.print(gps.date.month()); 98 Serial.print(F("/")); 99 Serial.print(gps.date.year()); 100 Serial.print(", "); 101 if (gps.time.hour() < 10) Serial.print(F("0")); 102 Serial.print(gps.time.hour()); 103 Serial.print(F(":")); 104 if (gps.time.minute() < 10) Serial.print(F("0")); 105 Serial.print(gps.time.minute()); 106 Serial.print(F(":")); 107 if (gps.time.second() < 10) Serial.print(F("0")); 108 Serial.print(gps.time.second()); 109 Serial.print(", "); 110 Serial.print(gps.altitude.meters(), 0); 111 Serial.println(" "); 112#endif 113 logfile.flush(); //write data to disk 114 } 115 } 116} 117
Gnome Tracker
arduino
Load this sketch and compile it after you have downloaded TinyGPSPlus library from http://arduiniana.org/libraries/tinygpsplus/
1#include <TinyGPS++.h> 2#include <SPI.h> 3#include <SD.h> 4 5TinyGPSPlus gps; 6 7int chipSelect = 4; // digital pin 4 for the SD cs line 8File logfile;// the logging file 9 10//data logger timing and other 11long logPace=10000; // 10 seconds between entries 12long readTime = 0; // time of last read() 13#define DEBUG 1 // echo GPS data to serial port for debug purposes 14 15void setup() { 16 Serial.begin(115200); 17 Serial1.begin(9600); // our module communicates at 9600 18 delay(1000); 19 Serial.println("Basic Initialization"); // we sen something to the consolle 20 21 // initialize the SD card 22 Serial.print("Initialising SD card..."); 23 24 // see if the card is present and can be initialized: 25 if (!SD.begin(chipSelect)) { 26 Serial.println("Card read failed, or not present"); 27 // Stop the sketch 28 return; 29 } 30 Serial.println("card initialized."); 31 32 // create a new file 33 char filename[] = "GnomeT00.CSV"; 34 for (byte i = 0; i < 100; i++) { 35 filename[6] = i / 10 + '0'; 36 filename[7] = i % 10 + '0'; 37 if (! SD.exists(filename)) { 38 // open the next file in the numbered sequence 39 logfile = SD.open(filename, FILE_WRITE); 40 break; // leave the loop! 41 } 42 } 43 44 Serial.print("Logging to: "); 45 Serial.println(filename); 46 47 logfile.println("latitude, longitude, altitude, date, time"); 48 49#if DEBUG //serial debug active? 50 Serial.println("Serial Debug Active"); 51 Serial.println(); 52 Serial.println("latitude, longitude, date, time, altitude"); 53#endif// we show the columns for the data sent to console 54 55#if !DEBUG //serial debug deactivated 56 Serial.println("No Serial Debug"); 57#endif 58} 59 60void loop() { 61 62 while (Serial1.available() > 0) 63 { 64 gps.encode(Serial1.read()); 65 if (gps.location.isValid()) 66 { 67 if ((millis() - readTime) < logPace) return; 68 readTime = millis(); 69 logfile.print(gps.location.lat(), 6); 70 logfile.print(", "); 71 logfile.print(gps.location.lng(), 6); 72 logfile.print(", "); 73 logfile.print(gps.altitude.meters(), 0); 74 logfile.print(", "); 75 logfile.print(gps.date.day()); 76 logfile.print(F("/")); 77 logfile.print(gps.date.month()); 78 logfile.print(F("/")); 79 logfile.print(gps.date.year()); 80 logfile.print(", "); 81 if (gps.time.hour() < 10) logfile.print(F("0")); 82 logfile.print(gps.time.hour()); 83 logfile.print(F(":")); 84 if (gps.time.minute() < 10) logfile.print(F("0")); 85 logfile.print(gps.time.minute()); 86 logfile.print(F(":")); 87 if (gps.time.second() < 10) logfile.print(F("0")); 88 logfile.print(gps.time.second()); 89 logfile.println(""); 90#if DEBUG //serial debug active? 91 Serial.print(gps.location.lat(), 6); 92 Serial.print(", "); 93 Serial.print(gps.location.lng(), 6); 94 Serial.print(", "); 95 Serial.print(gps.date.day()); 96 Serial.print(F("/")); 97 Serial.print(gps.date.month()); 98 Serial.print(F("/")); 99 Serial.print(gps.date.year()); 100 Serial.print(", "); 101 if (gps.time.hour() < 10) Serial.print(F("0")); 102 Serial.print(gps.time.hour()); 103 Serial.print(F(":")); 104 if (gps.time.minute() < 10) Serial.print(F("0")); 105 Serial.print(gps.time.minute()); 106 Serial.print(F(":")); 107 if (gps.time.second() < 10) Serial.print(F("0")); 108 Serial.print(gps.time.second()); 109 Serial.print(", "); 110 Serial.print(gps.altitude.meters(), 0); 111 Serial.println(" "); 112#endif 113 logfile.flush(); //write data to disk 114 } 115 } 116} 117
Documentation
Gnome lower part
3D print it to create the Gnome lower part
Gnome lower part
Gnome lower part
3D print it to create the Gnome lower part
Gnome lower part
Gnome upper part
3D print this to create a full gnome joining it with the lower part
Gnome upper part
Comments
Only logged in users can leave comments