{"id":3949,"date":"2024-06-10T09:11:14","date_gmt":"2024-06-10T16:11:14","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3949"},"modified":"2024-06-10T09:11:14","modified_gmt":"2024-06-10T16:11:14","slug":"project-29-dfrobot-gps-receiver-mk15","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3949","title":{"rendered":"Project #29 &#8211; DFRobot &#8211; GPS Receiver &#8211; Mk15"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3949-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #DFRobot #GPS #BME280 #CCS811 #FireBeetle2ESP32E #EEPROM #RTC #SD #Display #Adafruit #SparkFun #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02a.png\" alt=\"GPS Receiver\" width=\"720\" height=\"549\" class=\"alignnone size-full wp-image-3951\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02a-300x229.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02b.png\" alt=\"GPS Receiver\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3952\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02c.png\" alt=\"GPS Receiver\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3953\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/06\/DL2406Mk02c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Global Positioning System (GPS)<\/strong><\/p>\n<p>The Global Positioning System (GPS) is a satellite-based radionavigation system owned by the United States government and operated by the United States Space Force. It is one of the global navigation satellite systems (GNSS) that provides geolocation and time information to a GPS receiver anywhere on or near the Earth where there is an unobstructed line of sight to four or more GPS satellites. Obstacles such as mountains and buildings block the relatively weak GPS signals.<\/p>\n<p><strong>GPS Receiver &#8211; GP-20U7<\/strong><\/p>\n<p>The GP-20U7 is a compact GPS receiver with a built-in high performances All-In-One GPS chipset. The GP-20U7 accurately provides position, velocity, and time readings as well possessing high sensitivity and tracking capabilities. Thanks to the low power consumption this receiver requires, the GP-20U7 is ideal for portable applications such as tablet PCs, smart phones, and other devices requiring positioning capability.<\/p>\n<p><strong>DL2406Mk02<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Adafruit SHARP Memory Display<br \/>\n1 x Adafruit MicroSD card breakout board+<br \/>\n1 x MicroSD 16 GB<br \/>\n1 x Adafruit DS3231 Precision RTC FeatherWing &#8211; RTC<br \/>\n1 x Battery CR1220<br \/>\n1 x SparkFun Environmental Combo CCS811\/BME280<br \/>\n1 x GPS Receiver &#8211; GP-20U7<br \/>\n3 x Switch<br \/>\n2 x 1K Ohm<br \/>\n1 x 1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x Green LED<br \/>\n1 x USB 3.1 Cable A to C<\/p>\n<p><strong>DFRobot FireBeetle 2 ESP32-E<\/strong><\/p>\n<p>LED &#8211; 2<br \/>\nDSCK &#8211; 4<br \/>\nDMOSI &#8211; 16<br \/>\nDSS &#8211; 17<br \/>\nSCK &#8211; 22<br \/>\nMOSI &#8211; 23<br \/>\nMISO &#8211; 19<br \/>\nCS &#8211; 13<br \/>\nGPR &#8211; 26<br \/>\nGPT &#8211; 25<br \/>\nSCL &#8211; 21<br \/>\nSDA &#8211; 22<br \/>\nLED &#8211; 14<br \/>\nSWI &#8211; 3<br \/>\nSWG &#8211; 1<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2406Mk02p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #29 - DFRobot - GPS Receiver - Mk15\r\n29-15\r\nDL2406Mk02p.ino\r\nDL2406Mk02\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Adafruit SHARP Memory Display\r\n1 x Adafruit MicroSD card breakout board+\r\n1 x MicroSD 16 GB\r\n1 x Adafruit DS3231 Precision RTC FeatherWing - RTC\r\n1 x Battery CR1220\r\n1 x SparkFun Environmental Combo CCS811\/BME280\r\n1 x GPS Receiver - GP-20U7\r\n3 x Switch\r\n2 x 1K Ohm\r\n1 x 1 x Lithium Ion Battery - 1000mAh\r\n1 x Green LED\r\n1 x USB 3.1 Cable A to C\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ EEPROM Library to Read and Write EEPROM\r\n\/\/ with Unique ID for Unit\r\n#include &quot;EEPROM.h&quot;\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ DS3231 RTC Date and Time\r\n#include &lt;RTClib.h&gt;\r\n\/\/ SD Card\r\n#include &quot;FS.h&quot;\r\n#include &quot;SD.h&quot;\r\n#include &quot;SPI.h&quot;\r\n\/\/ SHARP Memory Display\r\n#include &lt;Adafruit_SharpMem.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n\/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n#include &lt;SparkFunBME280.h&gt;\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n#include &lt;SparkFunCCS811.h&gt;\r\n\/\/ GPS Receiver\r\n#include &lt;TinyGPS++.h&gt;\r\n\/\/ ESP32 Hardware Serial\r\n#include &lt;HardwareSerial.h&gt;\r\n\r\n\/\/ ESP32 HardwareSerial\r\nHardwareSerial tGPS(2);\r\n\r\n\/\/ GPS Receiver\r\n#define gpsRXPIN 26\r\n\/\/ This one is unused and doesnt have a conection\r\n#define gpsTXPIN 25\r\n\/\/ The TinyGPS++ object\r\nTinyGPSPlus gps;\r\n\/\/ Latitude\r\nfloat TargetLat;\r\n\/\/ Longitude\r\nfloat TargetLon;\r\n\/\/ GPS Date, Time, Speed, Altitude\r\n\/\/ GPS Date\r\nString TargetDat;\r\n\/\/ GPS Time\r\nString TargetTim;\r\n\/\/ GPS Speeds M\/S\r\nString TargetSMS;\r\n\/\/ GPS Speeds Km\/h\r\nString TargetSKH;\r\n\/\/ GPS Altitude Meters\r\nString TargetALT;\r\n\/\/ GPS Status\r\nString GPSSt = &quot;&quot;;\r\n\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\nBME280 myBME280;\r\n\/\/ Temperature Celsius\r\nfloat BMEtempC = 0;\r\n\/\/ Humidity\r\nfloat BMEhumid = 0;\r\n\/\/ Altitude Meters\r\nfloat BMEaltitudeM = 0;\r\n\/\/ Barometric Pressure\r\nfloat BMEpressure = 0;\r\n\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n\/\/ Default I2C Address\r\n#define CCS811_ADDR 0x5B \r\nCCS811 myCCS811(CCS811_ADDR);\r\n\/\/ eCO2\r\nfloat CCS811CO2 = 0;\r\n\/\/ TVOC\r\nfloat CCS811TVOC = 0;\r\n\r\n\/\/ DS3231 RTC Date and Time\r\nRTC_DS3231 rtc;\r\nString sDate;\r\nString sTime;\r\n\r\n\/\/ MicroSD Card\r\nconst int chipSelect = 13;\r\nString zzzzzz = &quot;&quot;;\r\n\r\n\/\/ SHARP Memory Display\r\n#define SHARP_SCK  4\r\n#define SHARP_MOSI 16\r\n#define SHARP_SS   17\r\n\/\/ Set the size of the display here, e.g. 144x168!\r\nAdafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168);\r\n\/\/ The currently-available SHARP Memory Display (144x168 pixels)\r\n\/\/ requires &gt; 4K of microcontroller RAM; it WILL NOT WORK on Arduino Uno\r\n\/\/ or other &lt;4K &quot;classic&quot; devices.\r\n#define BLACK 0\r\n#define WHITE 1\r\n\r\n\/\/ LED Green\r\nint iLEDGreen = 2;\r\n\r\n\/\/ Define LED\r\nint iLED = 14;\r\n\r\n\/\/ Switch\r\nint iSwitch = 3;\r\n\/\/ Variable for reading the Switch status\r\nint iSwitchState = 0;\r\n\r\n\/\/ Switch GPS\r\nint iSwitchGPS = 1;\r\n\/\/ Variable for reading the Switch GPS status\r\nint iSwitchGPSState = 0;\r\n\r\n\/\/ EEPROM Unique ID Information\r\n#define EEPROM_SIZE 64\r\nString uid = &quot;&quot;;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;29-15&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ DS3231 RTC Date and Time\r\n  isRTC();\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n  isBME280();\r\n\r\n  \/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n  isCCS811();\r\n\r\n  \/\/ isGPS\r\n  isGPS();\r\n\r\n  \/\/ Read the state of the Switch value\r\n  iSwitchState = digitalRead(iSwitch);\r\n  \r\n  \/\/ The Switch is HIGH:\r\n  if (iSwitchState == HIGH) {\r\n\r\n    \/\/ Display Date, Time, Temperature, Humidity\r\n    isDisplayDTTH();\r\n  \r\n  } else {\r\n    \r\n    \/\/ Read the state of the Switch value\r\n    iSwitchGPSState = digitalRead(iSwitchGPS);\r\n    \r\n    if (iSwitchGPSState == HIGH) {\r\n\r\n      \/\/ Display GPS\r\n      isDisplayGPS();\r\n      \r\n    } else {\r\n      \r\n      \/\/ Display Date, Time, eCO2 Concentration, tVOC Concentration\r\n      isDisplayDTCOVO();\r\n\r\n    }  \r\n\r\n  }\r\n  \r\n  \/\/ MicroSD Card\r\n  isSD();\r\n\r\n  \/\/ iLED HIGH\r\n  digitalWrite(iLED, HIGH );\r\n\r\n  \/\/ Delay 5 Second\r\n  delay(5000);\r\n\r\n}\r\n<\/pre>\n<p><strong>getBME280.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n\/\/ isBME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\nvoid isBME280(){\r\n\r\n  \/\/ Temperature Celsius\r\n  BMEtempC = myBME280.readTempC();\r\n  \/\/ Humidity\r\n  BMEhumid = myBME280.readFloatHumidity() ;\r\n  \/\/ Altitude Meters\r\n  BMEaltitudeM = myBME280.readFloatAltitudeMeters();\r\n  \/\/ Barometric Pressure\r\n  BMEpressure = myBME280.readFloatPressure();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getCCS811.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ CCS811 - eCO2 &amp; tVOC\r\n\/\/ isCCS811 - eCO2 &amp; tVOC\r\nvoid isCCS811(){\r\n\r\n  \/\/ This sends the temperature &amp; humidity data to the CCS811\r\n  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);\r\n\r\n  \/\/ Calling this function updates the global tVOC and eCO2 variables\r\n  myCCS811.readAlgorithmResults();\r\n\r\n  \/\/ eCO2 Concentration\r\n  CCS811CO2 = myCCS811.getCO2();\r\n  \r\n  \/\/ tVOC Concentration\r\n  CCS811TVOC = myCCS811.getTVOC();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SHARP Memory Display\r\n\/\/ SHARP Memory Display - UID\r\nvoid isDisplayUID() {\r\n\r\n    \/\/ Text Display \r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(3);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Don Luc Electronics\r\n    display.setCursor(0,10);\r\n    display.println( &quot;Don Luc&quot; );\r\n    display.setTextSize(2);\r\n    display.setCursor(0,40);\r\n    display.println( &quot;Electronics&quot; );\r\n    \/\/ Version\r\n    \/\/display.setTextSize(3);\r\n    display.setCursor(0,70);\r\n    display.println( &quot;Version&quot; );\r\n    \/\/display.setTextSize(2);\r\n    display.setCursor(0,95);   \r\n    display.println( sver );\r\n    \/\/ EEPROM\r\n    display.setCursor(0,120);\r\n    display.println( &quot;EEPROM&quot; );\r\n    display.setCursor(0,140);   \r\n    display.println( uid );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n    \r\n}\r\n\/\/ Display Date, Time, Temperature, Humidity, Altitude and Barometric Pressure\r\nvoid isDisplayDTTH() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Date\r\n    display.setCursor(0,5);\r\n    display.println( sDate );\r\n    \/\/ Time\r\n    display.setCursor(0,30);\r\n    display.println( sTime );\r\n    \/\/ Temperature\r\n    display.setCursor(0,55);\r\n    display.print( BMEtempC );\r\n    display.println( &quot;C&quot; );\r\n    \/\/ Humidity\r\n    display.setCursor(0,80);\r\n    display.print( BMEhumid );\r\n    display.println( &quot;%&quot; );\r\n    \/\/ Altitude Meters\r\n    display.setCursor(0,105);\r\n    display.print( BMEaltitudeM );\r\n    display.println( &quot;M&quot; );\r\n    \/\/ Barometric Pressure\r\n    display.setCursor(0,130);\r\n    display.println( BMEpressure );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display Display Date, Time, eCO2 Concentration, tVOC Concentration\r\nvoid isDisplayDTCOVO() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Date\r\n    display.setCursor(0,5);\r\n    display.println( sDate );\r\n    \/\/ Time\r\n    display.setCursor(0,30);\r\n    display.println( sTime );\r\n    \/\/ eCO2 Concentration\r\n    display.setCursor(0,55);\r\n    display.println( &quot;eCO2&quot; );\r\n    display.setCursor(0,80);\r\n    display.println( CCS811CO2 );\r\n    \/\/ tVOC Concentration\r\n    display.setCursor(0,105);\r\n    display.println( &quot;tVOC&quot; );\r\n    display.setCursor(0,130);\r\n    display.println( CCS811TVOC );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display GPS\r\nvoid isDisplayGPS() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Latitude\r\n    display.setCursor(0,5);\r\n    display.print( &quot;Lat: &quot; );\r\n    display.println( TargetLat );\r\n    \/\/ Longitude\r\n    display.setCursor(0,30);\r\n    display.print( &quot;Lon: &quot; );\r\n    display.println( TargetLon );\r\n    \/\/ GPS Date\r\n    display.setCursor(0,55);\r\n    display.println( TargetDat );\r\n    \/\/ GPS Time\r\n    display.setCursor(0,80);\r\n    display.println( TargetTim );\r\n    \/\/ GPS Speed M\/S\r\n    display.setCursor(0,105);\r\n    display.print( TargetSMS );\r\n    display.println( &quot; M\/S&quot; );\r\n    \/\/ GPS Altitude Meters\r\n    display.setCursor(0,130);\r\n    display.print( TargetALT );\r\n    display.println( &quot; M&quot; );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n<\/pre>\n<p><strong>getEEPROM.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ EEPROM\r\n\/\/ isUID EEPROM Unique ID\r\nvoid isUID()\r\n{\r\n  \r\n  \/\/ Is Unit ID\r\n  uid = &quot;&quot;;\r\n  for (int x = 0; x &lt; 7; x++)\r\n  {\r\n    uid = uid + char(EEPROM.read(x));\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getGPS.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ GPS Receiver\r\n\/\/ Setup GPS\r\nvoid isSetupGPS() {\r\n\r\n  \/\/ Setup GPS\r\n  tGPS.begin(  9600 , SERIAL_8N1 , gpsRXPIN , gpsTXPIN );\r\n  \r\n}\r\n\/\/ isGPS\r\nvoid isGPS(){\r\n\r\n  \/\/ Receives NEMA data from GPS receiver\r\n  \/\/ This sketch displays information every time a new sentence is correctly encoded\r\n  while ( tGPS.available() &gt; 0)\r\n    \r\n    if (gps.encode( tGPS.read() ))\r\n    {\r\n     \r\n       \/\/ GPS Vector Pointer Target\r\n       displayInfo();\r\n       \/\/ GPS Date, Time, Speed, Altitude\r\n       displayDTS();\r\n       \r\n    }\r\n  \r\n  if (millis() &gt; 5000 &amp;&amp; gps.charsProcessed() &lt; 10)\r\n  {\r\n   \r\n     while(true);\r\n    \r\n  }\r\n\r\n}\r\n\/\/ GPS Vector Pointer Target\r\nvoid displayInfo(){\r\n\r\n  \/\/ Location\r\n  if (gps.location.isValid())\r\n  {\r\n    \r\n     \/\/ Latitude\r\n     TargetLat = gps.location.lat();\r\n     \/\/ Longitude\r\n     TargetLon = gps.location.lng();\r\n     \/\/ GPS Status 2\r\n     GPSSt = &quot;Yes&quot;;\r\n    \r\n  }\r\n  else\r\n  {\r\n\r\n     \/\/ GPS Status 0\r\n     GPSSt = &quot;No&quot;;\r\n    \r\n  }\r\n\r\n}\r\n\/\/ GPS Date, Time, Speed, Altitude\r\nvoid displayDTS(){\r\n\r\n  \/\/ Date\r\n  TargetDat = &quot;&quot;; \r\n  if (gps.date.isValid())\r\n  {\r\n    \r\n     \/\/ Date\r\n     \/\/ Year\r\n     TargetDat += String(gps.date.year(), DEC);\r\n     TargetDat += &quot;\/&quot;;\r\n     \/\/ Month\r\n     TargetDat += String(gps.date.month(), DEC);\r\n     TargetDat += &quot;\/&quot;;\r\n     \/\/ Day\r\n     TargetDat += String(gps.date.day(), DEC);\r\n    \r\n  }\r\n\r\n  \/\/ Time\r\n  TargetTim = &quot;&quot;;\r\n  if (gps.time.isValid())\r\n  {\r\n    \r\n     \/\/ Time\r\n     \/\/ Hour\r\n     TargetTim += String(gps.time.hour(), DEC);\r\n     TargetTim += &quot;:&quot;;\r\n     \/\/ Minute\r\n     TargetTim += String(gps.time.minute(), DEC);\r\n     TargetTim += &quot;:&quot;;\r\n     \/\/ Secound\r\n     TargetTim += String(gps.time.second(), DEC);\r\n    \r\n  }\r\n\r\n  \/\/ Speed\r\n  TargetSMS = &quot;&quot;;\r\n  TargetSKH = &quot;&quot;;\r\n  if (gps.speed.isValid())\r\n  {\r\n    \r\n     \/\/ Speed\r\n     \/\/ M\/S\r\n     int x = gps.speed.mps();\r\n     TargetSMS = String( x, DEC);\r\n     \/\/ Km\/h\r\n     int y = gps.speed.kmph();\r\n     TargetSKH = String( y, DEC);\r\n\r\n  }\r\n\r\n  \/\/ Altitude\r\n  TargetALT = &quot;&quot;;\r\n  if (gps.altitude.isValid())\r\n  {\r\n    \r\n     \/\/ Altitude\r\n     \/\/ Meters\r\n     int z = gps.altitude.meters();\r\n     TargetALT = String( z, DEC);\r\n\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRTC.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ DS3231 RTC Date and Time\r\n\/\/ Setup DS3231 RTC\r\nvoid isSetupRTC() {\r\n\r\n  if (! rtc.begin()) {\r\n    while (1);\r\n  }\r\n\r\n  if (rtc.lostPower()) {\r\n    \/\/ Following line sets the RTC to the date &amp; time this sketch was compiled\r\n    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\r\n    \/\/ This line sets the RTC with an explicit date &amp; time, for example to set\r\n    \/\/ January 21, 2014 at 3am you would call:\r\n    \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\r\n  }\r\n  \r\n}\r\n\/\/ DS3231 RTC Date and Time\r\nvoid isRTC(){\r\n \r\n    \/\/ Date and Time\r\n    sDate = &quot;&quot;;\r\n    sTime = &quot;&quot;;\r\n    \/\/ Date Time\r\n    DateTime now = rtc.now();\r\n\r\n    \/\/ sData\r\n    sDate += String(now.year(), DEC);\r\n    sDate += &quot;\/&quot;;\r\n    sDate += String(now.month(), DEC);\r\n    sDate += &quot;\/&quot;;\r\n    sDate += String(now.day(), DEC);\r\n\r\n    \/\/ sTime\r\n    sTime += String(now.hour(), DEC);\r\n    sTime += &quot;:&quot;;\r\n    sTime += String(now.minute(), DEC);\r\n    sTime += &quot;:&quot;;\r\n    sTime += String(now.second(), DEC);\r\n\r\n}\r\n<\/pre>\n<p><strong>getSD.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ MicroSD Card\r\n\/\/ MicroSD Setup\r\nvoid isSetupSD() {\r\n\r\n    \/\/ MicroSD Card\r\n    pinMode( chipSelect , OUTPUT );\r\n    if(!SD.begin( chipSelect )){\r\n        ;  \r\n        return;\r\n    }\r\n    \r\n    uint8_t cardType = SD.cardType();\r\n\r\n    \/\/ CARD NONE\r\n    if(cardType == CARD_NONE){\r\n        ; \r\n        return;\r\n    }\r\n\r\n    \/\/ SD Card Type\r\n    if(cardType == CARD_MMC){\r\n        ; \r\n    } else if(cardType == CARD_SD){\r\n        ; \r\n    } else if(cardType == CARD_SDHC){\r\n        ; \r\n    } else {\r\n        ; \r\n    } \r\n\r\n    \/\/ Size\r\n    uint64_t cardSize = SD.cardSize() \/ (1024 * 1024);\r\n \r\n}\r\n\/\/ MicroSD Card\r\nvoid isSD() {\r\n\r\n  zzzzzz = &quot;&quot;;\r\n\r\n  \/\/ DFR|EEPROM Unique ID|Version|Date|Time|Temperature Celsius|Humidity\r\n  \/\/|Altitude Meters|Barometric Pressure|eCO2 Concentration|tVOC Concentration\r\n  \/\/|GPS|Latitude|Longitude|GPS Date|GPS Time|GPS Speed M\/S|GPS Altitude|*\\r\r\n  zzzzzz = &quot;DFR|&quot; + uid + &quot;|&quot; + sver + &quot;|&quot; + sDate + &quot;|&quot; + sTime + &quot;|&quot; \r\n  + String(BMEtempC) + &quot;C|&quot; + String(BMEhumid) + &quot;%|&quot; \r\n  + String(BMEaltitudeM) + &quot; M|&quot; + String(BMEpressure) + &quot;|&quot; + String(CCS811CO2) + &quot;|&quot; \r\n  + String(CCS811TVOC) + &quot;|&quot; + String(GPSSt) + &quot;|&quot; + String(TargetLat) + &quot;|&quot; \r\n  + String(TargetLon) + &quot;|&quot; + String(TargetDat) + &quot;|&quot; + String(TargetTim) + &quot;|&quot; \r\n  + String(TargetSMS) + &quot;|&quot; + String(TargetALT)+ &quot;|*\\r&quot;;\r\n\r\n  \/\/ msg + 1\r\n  char msg[zzzzzz.length() + 1];\r\n\r\n  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);\r\n\r\n  \/\/ Append File\r\n  appendFile(SD, &quot;\/dfrdata.txt&quot;, msg );\r\n  \r\n}\r\n\/\/ List Dir\r\nvoid listDir(fs::FS &amp;fs, const char * dirname, uint8_t levels){\r\n    \r\n    \/\/ List Dir\r\n    dirname;\r\n    \r\n    File root = fs.open(dirname);\r\n    \r\n    if(!root){\r\n        return;\r\n    }\r\n    \r\n    if(!root.isDirectory()){\r\n        return;\r\n    }\r\n\r\n    File file = root.openNextFile();\r\n    \r\n    while(file){\r\n        if(file.isDirectory()){\r\n            file.name();\r\n            if(levels){\r\n                listDir(fs, file.name(), levels -1);\r\n            }\r\n        } else {\r\n            file.name();\r\n            file.size();\r\n        }\r\n        file = root.openNextFile();\r\n    }\r\n    \r\n}\r\n\/\/ Write File\r\nvoid writeFile(fs::FS &amp;fs, const char * path, const char * message){\r\n    \r\n    \/\/ Write File\r\n    path;\r\n    \r\n    File file = fs.open(path, FILE_WRITE);\r\n    \r\n    if(!file){\r\n        return;\r\n    }\r\n    \r\n    if(file.print(message)){\r\n        ;  \r\n    } else {\r\n        ;  \r\n    }\r\n    \r\n    file.close();\r\n    \r\n}\r\n\/\/ Append File\r\nvoid appendFile(fs::FS &amp;fs, const char * path, const char * message){\r\n    \r\n    \/\/ Append File\r\n    path;\r\n    \r\n    File file = fs.open(path, FILE_APPEND);\r\n    \r\n    if(!file){\r\n        return;\r\n    }\r\n    \r\n    if(file.print(message)){\r\n        ;  \r\n    } else {\r\n        ;  \r\n    }\r\n    \r\n    file.close();\r\n    \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n  \r\n  \/\/ Give display time to power on\r\n  delay(100);\r\n\r\n  \/\/ EEPROM Size\r\n  EEPROM.begin(EEPROM_SIZE);\r\n  \r\n  \/\/ EEPROM Unique ID\r\n  isUID();\r\n\r\n  \/\/ Give display\r\n  delay(100);\r\n\r\n  \/\/ Set up I2C bus\r\n  Wire.begin();\r\n\r\n  \/\/ Give display\r\n  delay(100);\r\n\r\n  \/\/ Setup DS3231 RTC\r\n  isSetupRTC();\r\n\r\n  \/\/MicroSD Card\r\n  isSetupSD();\r\n\r\n  \/\/ SHARP Display Start &amp; Clear the Display\r\n  display.begin();\r\n  \/\/ Clear Display\r\n  display.clearDisplay();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n  myBME280.begin();\r\n\r\n  \/\/ CCS811 - eCO2 &amp; tVOC\r\n  myCCS811.begin();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ GPS Receiver\r\n  \/\/ Setup GPS\r\n  isSetupGPS();\r\n\r\n  \/\/ Initialize digital pin iLED as an output\r\n  pinMode(iLED, OUTPUT);\r\n\r\n  \/\/ Outputting high, the LED turns on\r\n  digitalWrite(iLED, HIGH);\r\n\r\n  \/\/ Initialize the LED Green\r\n  pinMode(iLEDGreen, OUTPUT);\r\n\r\n  \/\/ iLEDGreen HIGH\r\n  digitalWrite(iLEDGreen, HIGH );\r\n\r\n  \/\/ Initialize the Switch\r\n  pinMode(iSwitch, INPUT);\r\n\r\n  \/\/ Initialize the Switch GPS\r\n  pinMode(iSwitchGPS, INPUT);\r\n\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Version\r\n  \/\/ EEPROM\r\n  isDisplayUID();\r\n  \r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Teacher, Instructor, E-Mentor, R&#038;D and Consulting<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2024<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #DFRobot #GPS #BME280 #CCS811 #FireBeetle2ESP32E #EEPROM #RTC #SD #Display #Adafruit #SparkFun #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Global Positioning System (GPS) The Global Positioning System (GPS) is a satellite-based radionavigation system owned by the United States government and operated by the United States Space Force. &#8230; <a title=\"Project #29 &#8211; DFRobot &#8211; GPS Receiver &#8211; Mk15\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3949\" aria-label=\"Read more about Project #29 &#8211; DFRobot &#8211; GPS Receiver &#8211; Mk15\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[318,47,50,49,317,38,80,59,115,5,287,58,82,10,43],"tags":[86,6,92,102,4,320,87,19,83,85,89,24,9,84,27,109,33,34,108],"class_list":["post-3949","post","type-post","status-publish","format-standard","hentry","category-ddfrobot","category-adafruit","category-arduino","category-consultant","category-dfrobot","category-digitalelectronics","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-program","category-arduino-programming","category-program-esp32","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-battery","tag-components","tag-consultant","tag-dfrobot","tag-display","tag-electronics","tag-esp32","tag-fritzing","tag-gps-receiver","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-sparkfun","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3949"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3949\/revisions"}],"predecessor-version":[{"id":4296,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3949\/revisions\/4296"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}