{"id":353,"date":"2021-05-13T03:09:23","date_gmt":"2021-05-13T03:09:23","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=353"},"modified":"2022-05-04T09:32:24","modified_gmt":"2022-05-04T09:32:24","slug":"interfacing-mpu6050-sensor-module-to-thejas-soc","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/interfacing-mpu6050-sensor-module-to-thejas-soc\/","title":{"rendered":"Interfacing MPU6050 Sensor Module to ARIES v2 Board"},"content":{"rendered":"\n<p>In this tutorial, we are going to learn how to interface <strong>MPU6050<\/strong> with<strong> ARIES v2 Board<\/strong>. The MPU6050 sensor module is a complete 6-axis Motion Tracking Device. It combines 3-axis Gyroscope, 3-axis Accelerometer, and Digital Motion Processor all in a small package. Also, it has the additional feature of an on-chip temperature sensor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MPU6050(Gyroscope + Accelerometer + Temperature)<\/h2>\n\n\n\n<p>As we said, The MPU6050 is a Micro-Electro-Mechanical System (<strong>MEMS<\/strong>) which consists of a 3-axis Accelerometer and 3-axis Gyroscope inside it. This helps us measure acceleration, velocity, orientation, displacement, and many other motion-related parameters of a system or object. This module also has a (DMP) Digital Motion Processor inside it which is powerful enough to perform complex calculations and thus free up the work for Microcontroller.<\/p>\n\n\n\n<p>The MPU6050 module allows us to read data from it through the I2C bus. Any change in motion will be reflected on the mechanical system which will, in turn, vary the voltage. Then the IC has a 16-bit ADC which it uses to accurately read these changes in voltage and stores it in the FIFO buffer.<\/p>\n\n\n\n<p><strong>DMP (Digital Motion Processor)<\/strong><\/p>\n\n\n\n<p>The embedded Digital Motion Processor (DMP) is used to compute motion processing algorithms. It takes data from gyroscope, accelerometer, and additional 3rd party sensor such as magnetometer and processes the data. It provides motion data like roll, pitch, yaw angles, landscape and portrait sense, etc. It minimizes the processes of the host in computing motion data. The resulting data can be read from DMP registers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/MPU6050-Module.jpg\" alt=\"\" class=\"wp-image-354\" width=\"567\" height=\"378\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/MPU6050-Module.jpg 600w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/MPU6050-Module-300x200.jpg 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Circuit Diagram<\/h2>\n\n\n\n<p>MPU6050 communicates with the ARIES v2 board via the I2C1 port. MPU6050 &nbsp;is composed of 8 pins, but we need only 5 pins for the working, VCC, GND, two I2C pins(SCL and SDA), and AD0 pin. Connect VCC and GND to +3.3V and GND respectively of ARIES v2 board. Connect SCL of the sensor to SCL_1 and SDA of the sensor to SDA_1 of ARIES v2 board. Then connect AD0 pin with GND pin for selecting default address.<\/p>\n\n\n\n<p>Now, for powering up and programming the code into the ARIES v2 board, we have to connect a <strong>micro USB type B<\/strong> (common data cable, used for mobile charging and data transfer) in the <strong>UART0<\/strong> port of the ARIES v2 board, to a Laptop\/Desktop\/PC with preinstalled VEGA SDK and Toolchain.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/04\/pinmap_Ar_MPU6050-1.jpg\" alt=\"\" class=\"wp-image-1154\" width=\"838\" height=\"693\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/04\/pinmap_Ar_MPU6050-1.jpg 631w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/04\/pinmap_Ar_MPU6050-1-300x248.jpg 300w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>MPU6050<\/strong><\/td><td><strong>ARIES v2 Board<\/strong><\/td><\/tr><tr><td>VCC  <\/td><td>+3V3<\/td><\/tr><tr><td>GND <\/td><td>GND<\/td><\/tr><tr><td>SCL<\/td><td>SCL-1<\/td><\/tr><tr><td>SDA<\/td><td>SDA-1<\/td><\/tr><tr><td>AD0<\/td><td>GND<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<h2 class=\"wp-block-heading\">Procedure<\/h2>\n\n\n\n<p>After setting up the toolchain and SDK path environments, build the example program for the MPU6050 sensor by:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd vega-sdk\/vega-sdk\/examples\/i2c\/mpu6050_sensor_demo<\/code><\/pre>\n\n\n\n<p><strong>make clean<\/strong> command to clean the executable :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make clean<\/code><\/pre>\n\n\n\n<p>then use the <strong>make <\/strong>command to build it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make<\/code><\/pre>\n\n\n\n<p>Now, we can transfer the built program to the board, before transfer please ensure that you have connected the UART0 connector of the board to the PC.<\/p>\n\n\n\n<p>Open a new terminal and execute the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo minicom aries<\/code><\/pre>\n\n\n\n<p>Now you can see the minicom terminal opened and the board UART terminal is ready.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"689\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-1.png\" alt=\"\" class=\"wp-image-567\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-1.png 820w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-1-300x252.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-1-768x645.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/figure>\n\n\n\n<p>Use&nbsp;<strong>CTRL+A S<\/strong>&nbsp;to enter the file sending menu and select&nbsp;<strong>xmodem<\/strong>&nbsp;by pressing&nbsp;<strong>Enter<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"143\" data-id=\"269\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem.png\" alt=\"\" class=\"wp-image-269\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem.png 615w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem-300x70.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>In the next window, with&nbsp;the space bar&nbsp;select the&nbsp;<strong>mpu6050_sensor_demo.bin<\/strong>&nbsp;file to be transferred, by pressing&nbsp;Enter, the transfer process starts.<\/p>\n\n\n\n<p>Wait until the process is completed. The screen should display how much data has been transferred.<\/p>\n\n\n\n<p>After completing the transfer the Program will start to execute<\/p>\n\n\n\n<p>The output is displayed in the minicom UART terminal:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/mpu6050.png\" alt=\"\" class=\"wp-image-356\" width=\"841\" height=\"580\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/mpu6050.png 1009w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/mpu6050-300x207.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/mpu6050-768x530.png 768w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/figure>\n\n\n\n<p>Xa, Ya, Za  &#8212;&gt; 3-axis accelerometer output<\/p>\n\n\n\n<p>Xg,Yg,Zg &#8212;&gt; 3-axis &nbsp;gyroscope output<\/p>\n\n\n\n<p>t &#8211;&gt; temperature<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"MPU6050 Gyro + Accelerometer Sensor Demo using VEGA Processor [ RISC-V ISA]\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/T1DXYlmtWvs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>For additional pieces of information:<\/p>\n\n\n\n<p><a href=\"https:\/\/invensense.tdk.com\/wp-content\/uploads\/2015\/02\/MPU-6000-Datasheet1.pdf\">https:\/\/invensense.tdk.com\/wp-content\/uploads\/2015\/02\/MPU-6000-Datasheet1.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to learn how to interface MPU6050 with ARIES v2 Board. The MPU6050 sensor module is a complete 6-axis Motion Tracking Device. It combines 3-axis Gyroscope, 3-axis Accelerometer, and Digital Motion Processor all in a small package. Also, it has the additional feature of an on-chip temperature sensor. MPU6050(Gyroscope + [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,14,1],"tags":[75,7,66,43,26,31,24],"class_list":["post-353","post","type-post","status-publish","format-standard","hentry","category-getting-started","category-tutorials","category-uncategorized","tag-aries-v2-board","tag-cdac","tag-iic","tag-mpu6050","tag-thejas-64","tag-thejas32","tag-vegaprocessor"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":33,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":1174,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions\/1174"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}