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