{"id":3275,"date":"2022-12-17T05:58:09","date_gmt":"2022-12-17T13:58:09","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3275"},"modified":"2022-12-17T05:58:09","modified_gmt":"2022-12-17T13:58:09","slug":"project-25-movement-imu-mk05","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3275","title":{"rendered":"Project #25 &#8211; Movement &#8211; IMU &#8211; Mk05"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3275-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #SparkFunRedBoard #Movement #Magnetometer #Accelerometer #Gyroscope #9DOF #Barometer #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01a.png\" alt=\"\" width=\"720\" height=\"528\" class=\"alignnone size-full wp-image-3277\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01a-300x220.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\/2022\/12\/DL2211Mk01b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01b.png\" alt=\"IMU\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3278\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01b-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\/2022\/12\/DL2211Mk01c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01c.png\" alt=\"IMU\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3279\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/12\/DL2211Mk01c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Inertial Measurement Unit<\/strong><\/p>\n<p>An inertial measurement unit (IMU) is an electronic device that measures and reports a body&#8217;s specific force, angular rate, and sometimes the orientation of the body, using a combination of accelerometers, gyroscopes, and sometimes magnetometers. When the magnetometer is included, IMUs are referred to as IMMUs. IMUs are typically used to maneuver modern vehicles including motorcycles, missiles, aircraft, including unmanned aerial vehicles, among many others, and spacecraft, including satellites and landers. Recent developments allow for the production of IMU-enabled GPS devices. An IMU allows a GPS receiver to work when GPS-signals are unavailable, such as in tunnels, inside buildings, or when electronic interference is present.<\/p>\n<p><strong>AltIMU-10 v5 Gyro, Accelerometer, Compass, and Altimeter (LSM6DS33, LIS3MDL, and LPS25H Carrier)<\/strong><\/p>\n<p>The Pololu AltIMU-10 v5 is an inertial measurement unit (IMU) and altimeter that features the same LSM6DS33 gyro and accelerometer and LIS3MDL magnetometer as the MinIMU-9 v5, and adds an LPS25H digital barometer. An I\u00b2C interface accesses ten independent pressure, rotation, acceleration, and magnetic measurements that can be used to calculate the sensor\u2019s altitude and absolute orientation. The board operates from 2.5 to 5.5 V and has a 0.1&#8243; pin spacing.<\/p>\n<p><strong>DL2211Mk01<\/strong><\/p>\n<p>1 x SparkFun RedBoard Qwiic<br \/>\n1 x SparkFun Micro OLED (Qwiic)<br \/>\n1 x Qwiic Cable &#8211; 100mm<br \/>\n1 x Pololu AltIMU-10 v5<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>SparkFun RedBoard Qwiic<\/strong><\/p>\n<p>SDA &#8211; Analog A4<br \/>\nSCL &#8211; Analog A5<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2211Mk01p.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 #25 - Movement - IMU - Mk05\r\n25-05\r\nDL2211Mk01p.ino\r\n1 x SparkFun RedBoard Qwiic\r\n1 x SparkFun Micro OLED (Qwiic)\r\n1 x Qwiic Cable - 100mm\r\n1 x Pololu AltIMU-10 v5\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Two Wire Interface (TWI\/I2C)\r\n#include &lt;Wire.h&gt;\r\n\/\/ SparkFun Micro OLED\r\n#include &lt;SFE_MicroOLED.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\/\/ 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\/\/ 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\r\n\/\/ SparkFun Micro OLED\r\n#define PIN_RESET 9\r\n#define DC_JUMPER 1\r\n\/\/ I2C declaration\r\nMicroOLED oled(PIN_RESET, DC_JUMPER);\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;25-05&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  \/\/ Micro OLED\r\n  isMicroOLED();\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 setupIMU() {\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>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>getMagnetometer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Magnetometer\r\n\/\/ Setup Magnetometer\r\nvoid setupMag() {\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>getMicroOLED.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun Micro OLED\r\n\/\/ Setup Micro OLED\r\nvoid isSetupMicroOLED() {\r\n\r\n  \/\/ Initialize the OLED\r\n  oled.begin();\r\n  \/\/ Clear the display&#039;s internal memory\r\n  oled.clear(ALL);\r\n  \/\/ Display what&#039;s in the buffer (splashscreen)\r\n  oled.display();\r\n\r\n  \/\/ Delay 1000 ms\r\n  delay(1000);\r\n\r\n  \/\/ Clear the buffer.\r\n  oled.clear(PAGE);\r\n  \r\n}\r\n\/\/ Micro OLED\r\nvoid isMicroOLED() {\r\n\r\n  \/\/ Text Display Accelerometer\r\n  \/\/ Clear the display\r\n  oled.clear(PAGE);\r\n  \/\/ Set cursor to top-left\r\n  oled.setCursor(0, 0);\r\n  \/\/ Set font to type 0\r\n  oled.setFontType(0);\r\n  \/\/ Accelerometer\r\n  oled.print(&quot;Acceler&quot;);\r\n  oled.setCursor(0, 12);\r\n  \/\/ X\r\n  oled.print(&quot;X: &quot;);\r\n  oled.print(imuAX);\r\n  oled.setCursor(0, 25);\r\n  \/\/ Y\r\n  oled.print(&quot;Y: &quot;);\r\n  oled.print(imuAY);\r\n  oled.setCursor(0, 39);\r\n  \/\/ Z\r\n  oled.print(&quot;Z: &quot;);\r\n  oled.print(imuAZ);\r\n  oled.display();\r\n\r\n  \/\/ Delay\r\n  delay(3000);\r\n\r\n  \/\/ Text Display Gyroscopes\r\n  \/\/ Clear the display\r\n  oled.clear(PAGE);\r\n  \/\/ Set cursor to top-left\r\n  oled.setCursor(0, 0);\r\n  \/\/ Set font to type 0\r\n  oled.setFontType(0);\r\n  \/\/ Gyroscopes\r\n  oled.print(&quot;Gyro&quot;);\r\n  oled.setCursor(0, 12);\r\n  \/\/ X\r\n  oled.print(&quot;X: &quot;);\r\n  oled.print(imuGX);\r\n  oled.setCursor(0, 25);\r\n  \/\/ Y\r\n  oled.print(&quot;Y: &quot;);\r\n  oled.print(imuGY);\r\n  oled.setCursor(0, 39);\r\n  \/\/ Z\r\n  oled.print(&quot;Z: &quot;);\r\n  oled.print(imuGZ);\r\n  oled.display();\r\n\r\n  \/\/ Delay\r\n  delay(3000);\r\n\r\n  \/\/ Text Display Magnetometer\r\n  \/\/ Clear the display\r\n  oled.clear(PAGE);\r\n  \/\/ Set cursor to top-left\r\n  oled.setCursor(0, 0);\r\n  \/\/ Set font to type 0\r\n  oled.setFontType(0);\r\n  \/\/ Magnetometer\r\n  oled.print(&quot;Mag&quot;);\r\n  oled.setCursor(0, 12);\r\n  \/\/ X\r\n  oled.print(&quot;X: &quot;);\r\n  oled.print(magX);\r\n  oled.setCursor(0, 25);\r\n  \/\/ Y\r\n  oled.print(&quot;Y: &quot;);\r\n  oled.print(magY);\r\n  oled.setCursor(0, 39);\r\n  \/\/ Z\r\n  oled.print(&quot;Z: &quot;);\r\n  oled.print(magZ);\r\n  oled.display();\r\n\r\n  \/\/ Delay\r\n  delay(3000);\r\n\r\n  \/\/ Text Display Barometer\r\n  \/\/ Clear the display\r\n  oled.clear(PAGE);\r\n  \/\/ Set cursor to top-left\r\n  oled.setCursor(0, 0);\r\n  \/\/ Set font to type 0\r\n  oled.setFontType(0);\r\n  \/\/ Barometer\r\n  oled.print(&quot;Baro&quot;);\r\n  oled.setCursor(0, 12);\r\n  \/\/ Pressure\r\n  oled.print(&quot;P: &quot;);\r\n  oled.print(pressure);\r\n  oled.setCursor(0, 25);\r\n  \/\/ Altitude Meters\r\n  oled.print(&quot;A: &quot;);\r\n  oled.print(altitude);\r\n  oled.setCursor(0, 39);\r\n  \/\/ Temperature Celsius\r\n  oled.print(&quot;T: &quot;);\r\n  oled.print(temperature);\r\n  oled.display();\r\n\r\n  \/\/ Delay\r\n  delay(3000);\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  \/\/ Give display time to power on\r\n  delay(100);\r\n  \r\n  \/\/ Set up I2C bus\r\n  Wire.begin();\r\n\r\n  \/\/ Setup Micro OLED\r\n  isSetupMicroOLED();\r\n\r\n  \/\/ Setup IMU\r\n  setupIMU();\r\n\r\n  \/\/ Setup Magnetometer\r\n  setupMag();\r\n\r\n  \/\/ Setup Barometer\r\n  isSetupBarometer();\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>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/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>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor and E-Mentor<\/strong><\/p>\n<ul>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2022<\/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\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<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\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #SparkFunRedBoard #Movement #Magnetometer #Accelerometer #Gyroscope #9DOF #Barometer #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Inertial Measurement Unit An inertial measurement unit (IMU) is an electronic device that measures and reports a body&#8217;s specific force, angular rate, and sometimes the orientation of the body, using a combination of accelerometers, &#8230; <a title=\"Project #25 &#8211; Movement &#8211; IMU &#8211; Mk05\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3275\" aria-label=\"Read more about Project #25 &#8211; Movement &#8211; IMU &#8211; Mk05\">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":[240,50,49,38,59,5,46,58,10,43],"tags":[251,6,254,102,4,87,19,85,175,246,24,249,103,9,27,109,33,34],"class_list":["post-3275","post","type-post","status-publish","format-standard","hentry","category-movement","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-arduino-programming","category-projects","category-sparkfun","tag-accelerometer","tag-arduino","tag-barometer","tag-components","tag-consultant","tag-display","tag-electronics","tag-fritzing","tag-imu","tag-magnetometer","tag-microcontroller","tag-movement","tag-pololu","tag-programming","tag-projects-2","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3275","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=3275"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3275\/revisions"}],"predecessor-version":[{"id":3280,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3275\/revisions\/3280"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}