{"id":4007,"date":"2024-07-08T08:57:05","date_gmt":"2024-07-08T15:57:05","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4007"},"modified":"2024-07-08T08:57:05","modified_gmt":"2024-07-08T15:57:05","slug":"project-29-dfrobot-altimu-10-mk19","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4007","title":{"rendered":"Project #29 &#8211; DFRobot &#8211; AltIMU-10 &#8211; Mk19"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4007-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #DFRobot #AltIMU10 #9DOF #GPS #FireBeetle2ESP32E #EEPROM #RTC #SD #Display #Pololu #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\/07\/DL2406Mk06a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06a.png\" alt=\"AltIMU-10\" width=\"720\" height=\"526\" class=\"alignnone size-full wp-image-4009\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06a-300x219.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\/07\/DL2406Mk06b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06b.png\" alt=\"AltIMU-10\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4010\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06b-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\/07\/DL2406Mk06c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06c.png\" alt=\"AltIMU-10\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4011\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2024\/07\/DL2406Mk06c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Pololu AltIMU-10 v5 Gyro, Accelerometer, Compass, and Altimeter<\/strong><\/p>\n<p>The Pololu AltIMU-10 v5 is a compact board that combines ST\u2019s LSM6DS33 3-axis gyroscope and 3-axis accelerometer, LIS3MDL 3-axis magnetometer, and LPS25H digital barometer to form an inertial measurement unit (IMU) and altimeter. These sensors are great ICs, but their small packages make them difficult for the typical student or hobbyist to use. They also operate at voltages below 3.6 Volt, which can make interfacing difficult for microcontrollers operating at 5 Volt. The AltIMU-10 v5 addresses these issues by incorporating additional electronics, including a voltage regulator and a level-shifting circuit, while keeping the overall size as compact as possible. The board ships fully populated with its SMD components, including the LSM6DS33, LIS3MDL, and LPS25H.<\/p>\n<p><strong>Attitude and Heading Reference System (AHRS)<\/strong><\/p>\n<p>An attitude and heading reference system (AHRS) uses an inertial measurement unit (IMU) consisting of microelectromechanical system (MEMS) inertial sensors to measure the angular rate, acceleration, and Earth&#8217;s magnetic field. These measurements can then be used to derive an estimate of the object&#8217;s attitude. An AHRS typically includes a 3-axis gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer to determine an estimate of a system&#8217;s orientation. Each of these sensors contribute different measurements to the combined system and each exhibit unique limitations.<\/p>\n<p><strong>DL2406Mk06<\/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 Pololu AltIMU-10 v5<br \/>\n1 x GPS Receiver &#8211; GP-20U7<br \/>\n2 x Switch<br \/>\n1 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 \/>\nXAC &#8211; A0<br \/>\nYAC &#8211; A1<br \/>\nZAC &#8211; A2<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2406Mk06p.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 - AltIMU-10 - Mk19\r\n29-19\r\nDL2406Mk06p.ino\r\nDL2406Mk06\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 Pololu AltIMU-10 v5\r\n1 x GPS Receiver - GP-20U7\r\n2 x Switch\r\n1 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\/\/ 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\/\/ GPS Receiver\r\n#include &lt;TinyGPS++.h&gt;\r\n\/\/ ESP32 Hardware Serial\r\n#include &lt;HardwareSerial.h&gt;\r\n\/\/ Includes and variables for IMU integration\r\n\/\/ STMicroelectronics LSM6DS33 Gyroscope and Accelerometer\r\n#include &lt;LSM6.h&gt;\r\n\/\/ STMicroelectronics LIS3MDL Magnetometer\r\n#include &lt;LIS3MDL.h&gt;\r\n\/\/ STMicroelectronics LPS25H digital Barometer\r\n#include &lt;LPS.h&gt;\r\n\r\n\/\/ Earth&#039;s magnetic field varies by location. Add or subtract\r\n\/\/ a declination to get a more accurate heading. Calculate\r\n\/\/ your&#039;s here: http:\/\/www.ngdc.noaa.gov\/geomag-web\/#declination\r\n\/\/ Declination (degrees) in Mexicali\r\n#define DECLINATION 10.31\r\n\r\n\/\/ 9DoF IMU\r\n\/\/ STMicroelectronics LSM6DS33 Gyroscope and Accelerometer\r\nLSM6 imu;\r\n\/\/ Accelerometer and Gyroscopes\r\n\/\/ Accelerometer\r\nint imuAX;\r\nint imuAY;\r\nint imuAZ;\r\n\/\/String FullStringB = &quot;&quot;;\r\n\/\/ Gyroscopes \r\nint imuGX;\r\nint imuGY;\r\nint imuGZ;\r\n\/\/ STMicroelectronics LIS3MDL magnetometer\r\nLIS3MDL mag;\r\n\/\/ Magnetometer\r\nint magX;\r\nint magY;\r\nint magZ;\r\n\/\/ STMicroelectronics LPS25H digital barometer\r\nLPS ps;\r\n\/\/ Digital Barometer\r\nfloat pressure;\r\nfloat altitude;\r\nfloat temperature;\r\n\/\/ Attitude Calculate Pitch, Roll, and Headind\r\nfloat r;\r\nfloat p;\r\nfloat h;\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\/\/ 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\/\/ 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-19&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Accelerometer and Gyroscopes\r\n  isIMU();\r\n\r\n  \/\/ Magnetometer\r\n  isMag();\r\n\r\n  \/\/ Barometer\r\n  isBarometer();\r\n\r\n  \/\/ Attitude Calculate Pitch, Roll, and Heading\r\n  isAttitude(imuAX, imuAY, imuAZ, -imuGY, -imuGX, imuGZ);\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    \/\/ Attitude Calculate Pitch, Roll, and Heading and Barometer\r\n    isDisplayAttitude();\r\n  \r\n  } else {\r\n\r\n    \/\/ Display GPS\r\n    isDisplayGPS();\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>getAccelGyro.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Accelerometer and Gyroscopes\r\n\/\/ Setup IMU\r\nvoid isSetupIMU() {\r\n\r\n  \/\/ Setup IMU\r\n  imu.init();\r\n  \/\/ Default\r\n  imu.enableDefault();\r\n  \r\n}\r\n\/\/ Accelerometer and Gyroscopes\r\nvoid isIMU() {\r\n\r\n  \/\/ Accelerometer and Gyroscopes\r\n  imu.read();\r\n  \/\/ Accelerometer x, y, z\r\n  imuAX = imu.a.x;\r\n  imuAY = imu.a.y;\r\n  imuAZ = imu.a.z;\r\n  \/\/ Gyroscopes x, y, z\r\n  imuGX = imu.g.x;\r\n  imuGY = imu.g.y;\r\n  imuGZ = imu.g.z;\r\n\r\n}\r\n<\/pre>\n<p><strong>getAttitude.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Attitude Calculate Pitch, Roll, and Heading\r\nvoid isAttitude(float ax, float ay, float az, float mx, float my, float mz) {\r\n\r\n  \/\/ Attitude Calculate Pitch, Roll, and Heading\r\n  float roll = atan2(ay, az);\r\n  float pitch = atan2(-ax, sqrt(ay * ay + az * az));\r\n\r\n  float heading;\r\n  if (my == 0)\r\n    heading = (mx &lt; 0) ? PI : 0;\r\n  else\r\n    heading = atan2(mx, my);\r\n\r\n  heading -= DECLINATION * PI \/ 180;\r\n\r\n  if (heading &gt; PI) heading -= (2 * PI);\r\n  else if (heading &lt; -PI) heading += (2 * PI);\r\n\r\n  \/\/ Convert everything from radians to degrees:\r\n  heading *= 180.0 \/ PI;\r\n  pitch *= 180.0 \/ PI;\r\n  roll  *= 180.0 \/ PI;\r\n\r\n  h = heading;\r\n  p = pitch;\r\n  r = roll;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getBarometer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ STMicroelectronics LPS25H digital barometer\r\n\/\/ Setup Barometer\r\nvoid isSetupBarometer(){\r\n\r\n  \/\/ Setup Barometer\r\n  ps.init();\r\n  \/\/ Default\r\n  ps.enableDefault();\r\n  \r\n}\r\n\/\/ Barometer\r\nvoid isBarometer(){\r\n\r\n  \/\/ Barometer\r\n  pressure = ps.readPressureMillibars();\r\n  \/\/ Altitude Meters\r\n  altitude = ps.pressureToAltitudeMeters(pressure);\r\n  \/\/ Temperature Celsius\r\n  temperature = ps.readTemperatureC();\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\/\/ Attitude Calculate Pitch, Roll, and Heading\r\nvoid isDisplayAttitude() {\r\n\r\n    \/\/ Text Display\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    \/\/ Pitch\r\n    display.setCursor(0,5);\r\n    display.print( &quot;Pi: &quot; );\r\n    display.println( p );\r\n    \/\/ Roll\r\n    display.setCursor(0,25);\r\n    display.print( &quot;Ro: &quot; );\r\n    display.println( r );\r\n    \/\/ Heading\r\n    display.setCursor(0,45);\r\n    display.print( &quot;He: &quot; );\r\n    display.println( h );\r\n    \/\/ Temperature Celsius\r\n    display.setCursor(0,65);\r\n    display.print( &quot;Te: &quot; );\r\n    display.println( temperature );\r\n    \/\/ Barometer\r\n    display.setCursor(0,85);\r\n    display.print( &quot;Ba: &quot; );\r\n    display.println( pressure );\r\n    \/\/ Altitude Meters\r\n    display.setCursor(0,105);\r\n    display.print( &quot;Al: &quot; );\r\n    display.println( altitude );\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  \/\/ 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>getMagnetometer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Magnetometer\r\n\/\/ Setup Magnetometer\r\nvoid isSetupMag() {\r\n\r\n  \/\/ Setup Magnetometer\r\n  mag.init();\r\n  \/\/ Default\r\n  mag.enableDefault();\r\n  \r\n}\r\n\/\/ Magnetometer\r\nvoid isMag() {\r\n\r\n  \/\/ Magnetometer\r\n  mag.read();\r\n  \/\/ Magnetometer x, y, z\r\n  magX = mag.m.x;\r\n  magY = mag.m.y;\r\n  magZ = mag.m.z;\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|\r\n  \/\/Accelerometer X|Accelerometer Y|Accelerometer Z|\r\n  \/\/Gyroscope X|Gyroscope Y|Gyroscope Z|\r\n  \/\/Magnetometer X|Magnetometer Y|Magnetometer Z|\r\n  \/\/Pitch|Roll|Heading|\r\n  \/\/Temperature C|Pressure Millibars|Altitude Meters|\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;\r\n  + String(imuAX) + &quot;|&quot; + String(imuAY) + &quot;|&quot; + String(imuAZ) + &quot;|&quot;\r\n  + String(imuGX) + &quot;|&quot; + String(imuGY) + &quot;|&quot; + String(imuGZ) + &quot;|&quot;\r\n  + String(magX) + &quot;|&quot; + String(magY) + &quot;|&quot; + String(magZ) + &quot;|&quot;\r\n  + String(p) + &quot;|&quot; + String(r) + &quot;|&quot; + String(h) + &quot;|&quot;\r\n  + String(temperature) + &quot;|&quot; + String(pressure) + &quot;|&quot; + String(altitude) + &quot;|&quot;\r\n  + 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  \/\/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  \/\/ GPS Receiver\r\n  \/\/ Setup GPS\r\n  isSetupGPS();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ Setup IMU\r\n  isSetupIMU();\r\n\r\n  \/\/ Setup Magnetometer\r\n  isSetupMag();\r\n\r\n  \/\/ Setup Barometer\r\n  isSetupBarometer();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\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  \/\/ 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 #AltIMU10 #9DOF #GPS #FireBeetle2ESP32E #EEPROM #RTC #SD #Display #Pololu #ESP32 #IoT #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Pololu AltIMU-10 v5 Gyro, Accelerometer, Compass, and Altimeter The Pololu AltIMU-10 v5 is a compact board that combines ST\u2019s LSM6DS33 3-axis gyroscope and 3-axis accelerometer, LIS3MDL 3-axis magnetometer, and &#8230; <a title=\"Project #29 &#8211; DFRobot &#8211; AltIMU-10 &#8211; Mk19\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4007\" aria-label=\"Read more about Project #29 &#8211; DFRobot &#8211; AltIMU-10 &#8211; Mk19\">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,317,38,80,59,115,5,46,287,58,82,10,43],"tags":[251,86,340,6,92,102,4,320,87,19,83,85,89,252,246,24,103,9,84,27,109,33,34,108],"class_list":["post-4007","post","type-post","status-publish","format-standard","hentry","category-ddfrobot","category-adafruit","category-arduino","category-dfrobot","category-digitalelectronics","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-pololu","category-program","category-arduino-programming","category-program-esp32","category-projects","category-sparkfun","tag-accelerometer","tag-adafruit","tag-altimu-10","tag-arduino","tag-battery","tag-components","tag-consultant","tag-dfrobot","tag-display","tag-electronics","tag-esp32","tag-fritzing","tag-gps-receiver","tag-gyroscope","tag-magnetometer","tag-microcontroller","tag-pololu","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\/4007","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=4007"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4007\/revisions"}],"predecessor-version":[{"id":4012,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4007\/revisions\/4012"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}