{"id":10850,"date":"2021-01-17T12:22:56","date_gmt":"2021-01-17T12:22:56","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/mma7361-analog-accelerometer"},"modified":"2024-10-29T13:33:43","modified_gmt":"2024-10-29T13:33:43","slug":"mma7361-analog-accelerometer","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer","title":{"rendered":"MMA7361 &#8211; Analog Accelerometer"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About this post<\/h2>\n\n<p>After introducing the MPU6050 6-axis I2C sensor in the <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/mpu6050-accelerometer-and-gyroscope\" target=\"_blank\" rel=\"noopener noreferrer\">last article<\/a>, I would like to deal with the simpler MMA7361 3-axis analog acceleration sensor in this post. I will cover the following topics:<\/p>\r\n<ul>\r\n<li><a href=\"#Anker1\">Technical Data \/ Features<\/a><\/li>\r\n<li><a href=\"#Anker2\">How to read out the raw data<\/a><\/li>\r\n<li><a href=\"#Anker3\">g-Value and angle calculation<\/a><\/li>\r\n<li><a href=\"#Anker4\">Free Fall (0g) Interrupt<\/a><\/li>\r\n<li><a href=\"#Anker5\">MMA7361 as position sensor (orientation)<\/a><a id=\"Anker1\"><\/a><\/li>\r\n<\/ul>\r\n\n<h2 class=\"wp-block-heading\">Specifications \/ Properties of the MMA7361<\/h2>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-632x1024.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"632\" height=\"1024\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-632x1024.jpg\" alt=\"MMA7361 module\" class=\"wp-image-9966\" style=\"width:158px;height:256px\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-632x1024.jpg 632w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-185x300.jpg 185w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-768x1244.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2-948x1536.jpg 948w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_top_2.jpg 1099w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/a><figcaption class=\"wp-element-caption\">MMA7361 module<\/figcaption><\/figure>\n<\/div>\n<p>I explained the working principle of accelerometers in my last post.<\/p>\r\n<p>The MMA7361 is a pure accelerometer. The measurement data for acceleration in the x, y and z directions are provided as analog values at the pins X, Y and Z. You will find printed on the module where the x, y and z axes are located.<\/p>\r\n<p>The MMA7361 module used in this article is operated at 3.3 or 5 volts in contrast to the bare MMA7361 IC. The measuring range can be set to +\/-1.5 g (g = gravitational acceleration, not grams!) or +\/-6 g. In addition, the MMA7361 has a self-test function and a 0g interrupt (free fall detection). The conversion of the raw data must be done by suitable sketches. For example, a data sheet can be found <a href=\"https:\/\/www.nxp.com\/docs\/en\/data-sheet\/MMA7361L.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\r\n<p>Here are the most important data at a glance:<\/p>\r\n<ul>\r\n<li><strong>Power supply<\/strong>: 3.3 or 5 V<\/li>\r\n<li><strong>Power consumption<\/strong>:\r\n<ul>\r\n<li><strong>IC<\/strong>: -0.4 mA (normal operation) \/ ~3 \u00b5A (sleep mode)<\/li>\r\n<li><strong>Module<\/strong>: ~1.9 mA &#8211; due to the board LED, which you can carefully remove<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>2 <strong>Ranges<\/strong>: +\/- 1.5 g (GS = LOW) \/ +\/- 6 g (GS = HIGH)<\/li>\r\n<li><strong>Sensitivity<\/strong>:\r\n<ul>\r\n<li>+\/- 1.5 g Range: 800 mV\/g<\/li>\r\n<li>+\/- 6 g Range: 206 mV\/g<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><strong>0G detection<\/strong> (active-high)<\/li>\r\n<li><strong>Sleep mode<\/strong> (SL = LOW)<\/li>\r\n<li><strong>Self test<\/strong> (ST = HIGH): please look at the data sheet<a id=\"Anker2\"><\/a><\/li>\r\n<\/ul>\r\n\n<h2 class=\"wp-block-heading\">Reading out the raw data of the MMA7361 <\/h2>\n\n<p>The raw data can be easily read out via the analog inputs of your Arduino &#8211; or whatever microcontroller you use. According to my experience the A\/D converter of the Arduino UNO fluctuates strongly with +\/- 2 or 3 units. I&#8217;ll make up for that in the sketch by averaging 50 values. Alternatively, you might think about using an A\/D converter like the <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/ads1115-a-d-converter-with-amplifier\" target=\"_blank\" rel=\"noopener noreferrer\">ADS1115.<\/a><\/p>\r\n<p>A real nuisance are the dimensions of the module and the fact that the pin headers are already soldered to the module. You can plug the module in a breadboard, but then there is only room for jumper cables on one side. I removed a pinboard and soldered it to the top:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-1024x340.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"340\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-1024x340.jpg\" alt=\"MMA7361 module, left: original, right: changed pin header\" class=\"wp-image-9971\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-1024x340.jpg 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-300x100.jpg 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-768x255.jpg 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-1536x511.jpg 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after-1320x439.jpg 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/mma7361_pin_header_changed_before_after.jpg 2000w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">MMA7361 module, left: original, right: changed pin header<\/figcaption><\/figure>\n\n<h3 class=\"wp-block-heading\">Wiring<\/h3>\n\n<p>The circuit is not a big surprise:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-1024x649.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"649\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-1024x649.png\" alt=\"MMA7361, circuit for all examples\" class=\"wp-image-9973\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-1024x649.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-300x190.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-768x487.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring-1320x837.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/MMA7361_Wiring.png 1512w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">MMA7361, circuit for all examples<\/figcaption><\/figure>\n\n<h3 class=\"wp-block-heading\">The sketch for reading the raw data<\/h3>\n\n<p>There is not much to say about the sketch either. Except perhaps that I decided to work primarily with integer variables. The fluctuations of the measured values are so high that float values would suggest an accuracy that is simply not given.<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"MMA7361_raw_data.ino\" data-enlighter-title=\"MMA7361_raw_data.ino\">int xPin = A0;\r\nint yPin = A1;\r\nint zPin = A2;\r\nint selfTestPin = 8;\r\nint gSelectPin = 9;\r\nint sleepPin = 10;\r\n\r\nvoid setup(){\r\n  Serial.begin(9600);\r\n  pinMode(selfTestPin, OUTPUT);\r\n  pinMode(gSelectPin, OUTPUT);\r\n  pinMode(sleepPin, OUTPUT);\r\n  digitalWrite(sleepPin, HIGH);\r\n  digitalWrite(selfTestPin, LOW);\r\n  digitalWrite(gSelectPin, LOW); \r\n  Serial.println(\"MMA7361 - Raw Data\");\r\n}\r\n\r\nvoid loop(){\r\n  Serial.print(\"x-Axis: \"); \r\n  Serial.print(readMMA7361(xPin));\r\n  Serial.print(\"     \");\r\n  Serial.print(\"y-Axis: \"); \r\n  Serial.print(readMMA7361(yPin));\r\n  Serial.print(\"     \");\r\n  Serial.print(\"z-Axis: \"); \r\n  Serial.println(readMMA7361(zPin));\r\n  delay(1000);\r\n}\r\n\r\nint readMMA7361(int channel){\r\n  long sum = 0;\r\n  int result = 0;\r\n  for(int i=0; i&lt;50; i++){\r\n    sum += analogRead(channel);\r\n  }\r\n  result = sum \/ 50;\r\n  return result;\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<h4 class=\"wp-block-heading\">The result<\/h4>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Raw_Data_Output.png\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"349\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Raw_Data_Output.png\" alt=\"Output of MMA7361_raw_data.ino\" class=\"wp-image-9975\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Raw_Data_Output.png 716w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Raw_Data_Output-300x146.png 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of MMA7361_raw_data.ino<\/figcaption><\/figure>\n\n<p>For the above values, the MMA7361 was positioned flat on the table, i.e. with its x\/y plane. 0 g should act on the x and y axes and 1 g on the z axis. So, one would expect the same readings for x and y. But that is not the case. I tested several modules and the values were usually between 350 and 380 units, i.e. about 1.7 to 1.9 volts. However, the starting value for a given module and a given axis was quite reproducible.<\/p>\r\n<p>I could confirm the stated sensitivity of 800&nbsp; mV\/g for the range of +\/- 1.5g. Converted to &#8220;analogRead units&#8221; the following applies:<\/p>\r\n\n<p><\/p>\r\n<p><p class=\"ql-center-displayed-equation\" style=\"line-height: 25px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/ql-cache\/quicklatex.com-0995abea5e07874103c64d00806ee7f1_l3.png\" height=\"25\" width=\"337\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91; &#53;&#48;&#48;&#48;&#92;&#59;&#32;&#91;&#92;&#116;&#101;&#120;&#116;&#123;&#109;&#86;&#125;&#93;&#92;&#115;&#116;&#97;&#99;&#107;&#114;&#101;&#108;&#123;&#92;&#119;&#101;&#100;&#103;&#101;&#125;&#61;&#32;&#49;&#48;&#50;&#51;&#32;&#92;&#59;&#92;&#59;&#32;&#92;&#114;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#92;&#59;&#92;&#59;&#56;&#48;&#48;&#92;&#59;&#91;&#92;&#116;&#101;&#120;&#116;&#123;&#109;&#86;&#125;&#93;&#92;&#115;&#116;&#97;&#99;&#107;&#114;&#101;&#108;&#123;&#92;&#119;&#101;&#100;&#103;&#101;&#125;&#61;&#49;&#54;&#51;&#46;&#55; &#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/p>\r\n\r\n\n<p>That means, when I rotated the MMA7361 by 90\u00b0, the measured value of the affected axis went up or down by about 163 units. This value is used as aconstant (unitsPerG) in the sketch.<a id=\"Anker3\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">Calculation of acceleration and angle<\/h2>\n\n<h3 class=\"wp-block-heading\">Zero points of the MMA7361 axes<\/h3>\n\n<p>Before we calculate accelerations and angles, we must first determine the zero points (called \u201cstart values\u201d in the further course). In principle, there are two options:<\/p>\r\n<ol>\r\n<li>You determine the maximum and minimum values by slowly rotating and use the mean as the zero point. The zero points are stored as constants.<\/li>\r\n<li>You position the MMA7361 flat. The measured values for the x- and y-axis correspond to the zero points. The measured value for the z-axis corresponds to 1 g. This means that the zero point for the z-axis is the measured value minus 800 mV (= 163 units) for the range of +\/-1.5 g or measuring value minus 206 mV  for  +\/- 6 g.<\/li>\r\n<\/ol>\r\n<p>I chose method 2. In my sketches, the zero points are recalculated with each reset.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Calculation of acceleration values<\/h3>\n\n<p>Calculating the acceleration a from the zero startVal, the rawVal reading and the slope unitsPerG is simple:<\/p>\r\n\n<p><p class=\"ql-center-displayed-equation\" style=\"line-height: 19px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/ql-cache\/quicklatex.com-fdc4e1379b66b3e6660cd20cb699f7ba_l3.png\" height=\"19\" width=\"403\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91; &#97;&#32;&#61;&#32;&#115;&#116;&#97;&#114;&#116;&#86;&#92;&#33;&#97;&#108;&#43;&#40;&#114;&#97;&#119;&#86;&#92;&#33;&#97;&#108;&#45;&#115;&#116;&#97;&#114;&#116;&#86;&#97;&#108;&#41;&#92;&#99;&#100;&#111;&#116;&#32;&#117;&#110;&#105;&#116;&#115;&#80;&#101;&#114;&#71; &#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/p>\r\n\n<h3 class=\"wp-block-heading\">Calculation of angles<\/h3>\n\n<p>If the MMA7361 is not moved, a statement about its position in the three-dimensional space can be made by the distribution of the gravitational acceleration&nbsp; on the axes. The following diagram illustrates this with the example of the x-axis:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-1024x498.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"498\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-1024x498.png\" alt=\"Calculation of angles from g-values of the MMA7361\" class=\"wp-image-10025\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-1024x498.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-300x146.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-768x374.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-1536x747.png 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff-1320x642.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/calculation_g_eff.png 1628w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Calculation of angles from g-values<\/figcaption><\/figure>\n\n<p>g<sub>eff<\/sub> is the effective gravitational accelaration force acting on the axis. The following applies to the tilt angle \u03b1:<\/p>\r\n\n<p><p class=\"ql-center-displayed-equation\" style=\"line-height: 45px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/ql-cache\/quicklatex.com-fad18927732a3247e2ae9b73ef450855_l3.png\" height=\"45\" width=\"337\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91; &#115;&#105;&#110;&#40;&#92;&#97;&#108;&#112;&#104;&#97;&#41;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#103;&#95;&#123;&#101;&#102;&#92;&#33;&#102;&#125;&#125;&#123;&#103;&#125;&#32;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#114;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#97;&#108;&#112;&#104;&#97;&#61;&#97;&#114;&#99;&#115;&#105;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#103;&#95;&#123;&#101;&#102;&#92;&#33;&#102;&#125;&#125;&#123;&#103;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41; &#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/p>\r\n\n<p>However, there are two limitations:<\/p>\r\n<ul>\r\n<li>The angles are not unique. The g<sub>eff<\/sub>\/g value is identical for an angle \u03b1 and the angle of 180\u00b0 \u03b1.<\/li>\r\n<li>The calculation becomes increasingly error-prone the closer you get to 90\u00b0.<\/li>\r\n<\/ul>\r\n<p>Regarding the second limitation, here is an example calculation:<\/p>\r\n\n<p><p class=\"ql-center-displayed-equation\" style=\"line-height: 19px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/ql-cache\/quicklatex.com-996ac44355e46ff01b0246c9c725426e_l3.png\" height=\"19\" width=\"294\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91; &#97;&#114;&#99;&#115;&#105;&#110;&#40;&#48;&#41;&#32;&#61;&#32;&#48;&deg;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#108;&#101;&#102;&#116;&#114;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#92;&#59;&#92;&#59;&#92;&#59;&#97;&#114;&#99;&#115;&#105;&#110;&#40;&#49;&#41;&#61;&#57;&#48;&deg; &#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/p>\n\n<p><p class=\"ql-center-displayed-equation\" style=\"line-height: 19px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/ql-cache\/quicklatex.com-0b872822df21afe33dde8c47861da20d_l3.png\" height=\"19\" width=\"389\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91; &#97;&#114;&#99;&#115;&#105;&#110;&#40;&#48;&#46;&#48;&#49;&#41;&#32;&#61;&#32;&#48;&#46;&#53;&#55;&deg;&#92;&#59;&#92;&#59;&#92;&#59;&#92;&#108;&#101;&#102;&#116;&#114;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#92;&#59;&#92;&#59;&#92;&#59;&#97;&#114;&#99;&#115;&#105;&#110;&#40;&#48;&#46;&#57;&#57;&#41;&#61;&#56;&#49;&#46;&#56;&#57;&deg; &#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/p>\r\n\n<p>So, a measurement fluctuation has a rather drastic effect around 90\u00b0. However, for tilt angles up to ~60\u00b0, the method is quite exact.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Example sketch &#8220;All Values&#8221;<\/h3>\n\n<pHere is the sketch that calculates the accelerations and angles from the raw data. A few comments:<\/p>\r\n<ul>\r\n<li>The values are stored in an array (x,y,z).<\/li>\r\n<li>The asin() function returns the angles in rad. I convert the results to degrees (times 360\/2\u03c0).<\/li>\r\n<li>I tried to format the output nicely with <code>sprintf<\/code>. For the g-values (gVal) this became quite complex. I got it, but only with quite a lot of code and then left it out, so that the view of the essentials is preserved.<\/li>\r\n<li>In some places, I multiply by 1.0. This makes sense to prevent the compiler from providing me with integer values where I want floats.<\/li>\r\n<li>To catch errors due to geff\/g values greater than 1 (invalid for the asin function), I simply truncate the values when this happens.<\/li>\r\n<\/ul>\r\n<p>&nbsp;<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"MMA7361_all_data.ino\" data-enlighter-title=\"MMA7361_all_data.ino\">const int unitsPerG = 163; \/\/ depends on your ADC and the range (1.5g vs 6g)\r\nint axisPin[] = {A0, A1, A2};\r\nint selfTestPin = 8;\r\nint gSelectPin = 9;\r\nint sleepPin = 10;\r\nint startVal[3] = {0};\r\n\r\nchar result[8]; \/\/ for format of the output\r\n\r\nvoid setup(){\r\n  Serial.begin(9600);\r\n  pinMode(selfTestPin, OUTPUT);\r\n  pinMode(gSelectPin, OUTPUT);\r\n  pinMode(sleepPin, OUTPUT);\r\n  digitalWrite(sleepPin, HIGH);\r\n  digitalWrite(selfTestPin, LOW);\r\n  digitalWrite(gSelectPin, LOW);\r\n  getStartVals(); \r\n}\r\n\r\nvoid loop(){\r\n  int angles[3] = {0};\r\n  int raw[3] = {0};\r\n  float gVal[3] = {0.0};\r\n\r\n  getRawVals(raw);\r\n  getAngles(angles,raw);\r\n  getGValues(gVal, raw); \r\n  Serial.print(\"x-Raw:  \"); sprintf(result,\"%6d\", raw[0]); \/\/ sprintf for format\r\n  Serial.print(result);\r\n  Serial.print(\"     \");\r\n  Serial.print(\"y-Raw:  \"); sprintf(result,\"%6d\", raw[1]); \r\n  Serial.print(result);\r\n  Serial.print(\"     \");\r\n  Serial.print(\"z-Raw:  \"); sprintf(result,\"%6d\", raw[2]); \r\n  Serial.println(result);\r\n  \r\n  Serial.print(\"x-Angle:  \"); sprintf(result,\"%4d\", angles[0]);\r\n  Serial.print(result);\r\n  Serial.print(\"     \");\r\n  Serial.print(\"y-Angle:  \"); sprintf(result,\"%4d\", angles[1]);\r\n  Serial.print(result);\r\n  Serial.print(\"     \");\r\n  Serial.print(\"z-Angle:  \"); sprintf(result,\"%4d\", angles[2]);\r\n  Serial.println(result);\r\n\r\n  Serial.print(\"x-g:      \"); \r\n  Serial.print(gVal[0]); \r\n  Serial.print(\"     \");\r\n  Serial.print(\"y-g:      \"); \r\n  Serial.print(gVal[1]);\r\n  Serial.print(\"     \");\r\n  Serial.print(\"z-g:      \");\r\n  Serial.println(gVal[2]);\r\n  Serial.println();\r\n  \r\n  delay(1000);\r\n}\r\n\r\nvoid getGValues(float gValueArray[], int rawArray[]){\r\n  for(int i=0; i&lt;3; i++){\r\n    int diff = rawArray[i] - startVal[i];\r\n    gValueArray[i] = diff*1.0\/unitsPerG;\r\n  }\r\n}\r\n\r\nvoid getRawVals(int rawVals[]){\r\n  for(int i=0; i&lt;3; i++){\r\n    rawVals[i] = readMMA7361(axisPin[i]);\r\n  }\r\n}\r\n\r\nvoid getAngles(int angleArray[], int rawArray[]){\r\n  bool positive = true;\r\n  for(int i=0; i&lt;3; i++){\r\n    int diff = rawArray[i] - startVal[i];\r\n    positive = (diff&gt;=0);\r\n    diff = abs(diff);\r\n    if(diff &gt; unitsPerG){\r\n      diff = unitsPerG;\r\n    }\r\n    angleArray[i] = int((asin(diff*1.0\/unitsPerG))*57.296);\r\n    if(positive==false){\r\n      angleArray[i] = -angleArray[i];\r\n    }\r\n  } \r\n}\r\n\r\nint readMMA7361(int pin){\r\n  long sum = 0;\r\n  int result = 0;\r\n  for(int i=0; i&lt;50; i++){  \/\/ mean value of 50 measurements\r\n    sum += analogRead(pin);\r\n  }\r\n  result = sum \/ 50;\r\n  return result;\r\n}\r\n\r\nvoid getStartVals(){\r\n  Serial.println(\"Your MMA71361 should now be placed flat on the ground, i.e.:\");\r\n  Serial.println(\"x\/y-axis = 0 degrees, z-axis = 90 degrees \");\r\n  Serial.print(\"Wait....\");\r\n  delay(2000); \/\/ to have enough time to position the MMA7361\r\n  for(int i=0; i&lt;3; i++){\r\n    startVal[i] = readMMA7361(axisPin[i]);\r\n  }\r\n  startVal[2] -= unitsPerG; \/\/ Z-axis is at 90\u00b0 in start position! \r\n  Serial.println(\"ready!\");\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<h4 class=\"wp-block-heading\">The result<\/h4>\n\n<p>Here&#8217;s what a result might look like:<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Output_all_data_sketch.png\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"434\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Output_all_data_sketch.png\" alt=\"Output of MMA7361_all_data.ino\" class=\"wp-image-10030\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Output_all_data_sketch.png 716w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Output_all_data_sketch-300x182.png 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of MMA7361_all_data.ino<\/figcaption><\/figure>\n\n<p>You can see how I turned the MMA7361 by 90\u00b0 between the second and third measuring blocks.<a id=\"Anker4\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">Free Fall (0 g) Interrupt<\/h2>\n\n<p>The pin 0G is low in normal condition. If &#8220;0 g&#8221; is measured simultaneously on all axes (according to the data sheet -0.4 g to + 0.4 g), the pin 0G goes to HIGH. The 0 g state occurs in free fall, but possibly also in vibration.<\/p>\r\n<p>Here&#8217;s how you could use the signal:<\/p>\r\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"MMA7361_free_fall_interrupt.ino\" data-enlighter-title=\"MMA7361_free_fall_interrupt.ino\">int selfTestPin = 8;\r\nint gSelectPin = 9;\r\nint sleepPin = 10;\r\nint zeroGPin = 2;\r\n\r\nvolatile bool fall = false;\r\n\r\nvoid setup(){\r\n  Serial.begin(9600);\r\n  pinMode(selfTestPin, OUTPUT);\r\n  pinMode(gSelectPin, OUTPUT);\r\n  pinMode(sleepPin, OUTPUT);\r\n  pinMode(zeroGPin, INPUT);\r\n  attachInterrupt(digitalPinToInterrupt(zeroGPin), zeroG, RISING);\r\n  digitalWrite(sleepPin, HIGH);\r\n  digitalWrite(selfTestPin, LOW);\r\n  digitalWrite(gSelectPin, LOW);\r\n  Serial.println(\"Free Fall Interrupt for MMA7261 active...\");\r\n  delay(100);\r\n  fall = false;\r\n}\r\n\r\nvoid loop(){\r\n  if(fall==true){\r\n    Serial.println(\"Aaaaaaaaah!!!!! - I'm faaaaallllling!\");\r\n    delay(1000);\r\n  }\r\n  fall = false;\r\n}\r\n\r\nvoid zeroG(){\r\n  fall = true;\r\n}<\/pre>\r\n\n<p>The free fall interrupt is relatively sensitive. It can already be triggered when you tap on the table on which the MMA7361 is placed. To prevent it from triggering even with a short vibration, you can use a small trick.<\/p>\r\n<p>First, you change the interrupt condition from RISING to HIGH. If an interrupt is triggered, then after a short time (I have chosen 100 ms in the example sketch) it is checked for another short time (e.g. 50 ms) whether the 0G pin is still active.<\/p>\r\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"MMA7361_free_fall_interrupt_less_sensitive.ino\" data-enlighter-title=\"MMA7361_free_fall_interrupt_less_sensitive.ino\">int selfTestPin = 8;\r\nint gSelectPin = 9;\r\nint sleepPin = 10;\r\nint zeroGPin = 2;\r\n\r\nvolatile bool fall = false;\r\n\r\nvoid setup(){\r\n  Serial.begin(9600);\r\n  pinMode(selfTestPin, OUTPUT);\r\n  pinMode(gSelectPin, OUTPUT);\r\n  pinMode(sleepPin, OUTPUT);\r\n  pinMode(zeroGPin, INPUT);\r\n  attachInterrupt(digitalPinToInterrupt(zeroGPin), zeroG, HIGH);\r\n  digitalWrite(sleepPin, HIGH);\r\n  digitalWrite(selfTestPin, LOW);\r\n  digitalWrite(gSelectPin, LOW);\r\n  Serial.println(\"Free Fall Interrupt for MMA7261 active...\");\r\n  delay(100);\r\n  fall = false;\r\n}\r\n\r\nvoid loop(){\r\n  if(fall==true){\r\n    delay(100);\r\n    fall = false;\r\n    delay(50);\r\n      if(fall==true){\r\n        Serial.println(\"Aaaaaaaaah!!!!! - I'm faaaaallllling!\");\r\n        delay(1000);\r\n      }\r\n    fall = false;\r\n  }\r\n}\r\n\r\nvoid zeroG(){\r\n  fall = true;\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n\n<p>Just play around with the delay times to customize the interrupt function to your needs. <a id=\"Anker5\"><\/a><\/p>\r\n\n<h2 class=\"wp-block-heading\">The MMA7361 as orientation sensor<\/h2>\n\n<p>In the last section, I want to show you how to use the MMA7361 as an orientation sensor. By this I mean the determination of the 6 main directions in three-dimensional space, which I refer to as follows (view from the side):<\/p>\r\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-1024x678.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"678\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-1024x678.png\" alt=\"The six orientations of the MMA7361 (viewed from the side)\" class=\"wp-image-10036\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-1024x678.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-300x199.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-768x509.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme-1320x874.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Orientation_scheme.png 1327w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The six orientations of the MMA7361 (viewed from the side)<\/figcaption><\/figure>\n\n<p>In principle, it is simple. First, the angles are determined. The axes with an angle (absolute value) less than 45\u00b0 are considered to be horizontal, the axis with an angle (absolute value) greater than or equal to 45\u00b0 as vertical. Depending on whether the vertical axis has a positive or negative angle, it points up or down. And the following sketch simply checks this systematically. I did not consider the special case that two axes have exactly 45\u00b0. <\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"MMA77361_orientation.ino\" data-enlighter-title=\"MMA77361_orientation.ino\">const int unitsPerG = 163;\r\nint axisPin[] = {A0, A1, A2};\r\nint selfTestPin = 8;\r\nint gSelectPin = 9;\r\nint sleepPin = 10;\r\nint startVal[3] = {0};\r\n\r\nenum MMA7361_ORIENTATION{\r\n  FLAT, FLAT_1, XY, XY_1, YX, YX_1\r\n} orientation;\r\n\r\nvoid setup(){\r\n  Serial.begin(9600);\r\n  pinMode(selfTestPin, OUTPUT);\r\n  pinMode(gSelectPin, OUTPUT);\r\n  pinMode(sleepPin, OUTPUT);\r\n  digitalWrite(sleepPin, HIGH);\r\n  digitalWrite(selfTestPin, LOW);\r\n  digitalWrite(gSelectPin, LOW);\r\n  getStartVals(); \r\n}\r\n\r\nvoid loop(){\r\n  int angles[3] = {0};\r\n  int raw[3] = {0};\r\n \r\n  getRawVals(raw);\r\n  getAngles(angles,raw);\r\n  getOrientation(angles);\r\n  printOrientation();\r\n\r\n  delay(1000);\r\n}\r\n\r\nvoid getRawVals(int rawVals[]){\r\n  for(int i=0; i&lt;3; i++){\r\n    rawVals[i] = readMMA7361(axisPin[i]);\r\n  }\r\n}\r\n\r\nvoid getAngles(int angleArray[], int rawArray[]){\r\n  bool positive = true;\r\n  for(int i=0; i&lt;3; i++){\r\n    int diff = rawArray[i] - startVal[i];\r\n    positive = (diff&gt;=0);\r\n    diff = abs(diff);\r\n    if(diff &gt; unitsPerG){\r\n      diff = unitsPerG;\r\n    }\r\n    angleArray[i] = int((asin(diff*1.0\/unitsPerG))*57.296);\r\n    if(positive==false){\r\n      angleArray[i] = -angleArray[i];\r\n    }\r\n  } \r\n}\r\n\r\nint readMMA7361(int pin){\r\n  long sum = 0;\r\n  int result = 0;\r\n  for(int i=0; i&lt;50; i++){\r\n    sum += analogRead(pin);\r\n  }\r\n  result = sum \/ 50;\r\n  return result;\r\n}\r\n\r\nvoid getStartVals(){\r\n  Serial.println(\"Your MMA71361 should now be placed flat on the ground, i.e.:\");\r\n  Serial.println(\"x\/y-axis = 0 degrees, z-axis = 90 degrees \");\r\n  Serial.print(\"Wait....\");\r\n  delay(2000);\r\n  for(int i=0; i&lt;3; i++){\r\n    startVal[i] = readMMA7361(axisPin[i]);\r\n  }\r\n  startVal[2] -= unitsPerG; \/\/ Z-axis is at 90\u00b0 start position! \r\n  Serial.println(\"ready!\");\r\n}\r\n\r\nvoid getOrientation(int angleArray[]){\r\n  if(abs(angleArray[0])&lt;45){      \/\/ |x| &lt; 45\r\n    if(abs(angleArray[1])&lt;45){    \/\/ |y| &lt; 45\r\n      if(angleArray[2]&gt;0){        \/\/  z  &gt; 0\r\n        orientation = FLAT;\r\n      }\r\n      else{                       \/\/  z  &lt; 0\r\n        orientation = FLAT_1;\r\n      }\r\n    }\r\n    else{                         \/\/ |y| &gt; 45 \r\n      if(angleArray[1]&gt;0){        \/\/  y  &gt; 0\r\n        orientation = XY;\r\n      }\r\n      else{                       \/\/  y  &lt; 0\r\n        orientation = XY_1;   \r\n      }\r\n    }\r\n  }\r\n  else{                           \/\/ |x| &gt;= 45\r\n    if(angleArray[0]&gt;0){          \/\/  x  &gt;  0\r\n      orientation = YX;       \r\n      }\r\n      else{                       \/\/  x  &lt;  0\r\n        orientation = YX_1;\r\n      }\r\n  }\r\n}\r\n\r\nvoid printOrientation(){\r\n  Serial.print(\"Orientierung: \");\r\n  \r\n  switch(orientation){\r\n    case FLAT:\r\n      Serial.println(\"Flat\");\r\n      break;\r\n    case FLAT_1:\r\n      Serial.println(\"Flat - upside down\");\r\n      break;\r\n    case XY:\r\n      Serial.println(\"XY\");\r\n      break;\r\n    case XY_1:\r\n      Serial.println(\"XY - upside down\");\r\n      break;\r\n    case YX:\r\n      Serial.println(\"YX\");\r\n      break;\r\n    case YX_1:\r\n      Serial.println(\"YX - upside down\");\r\n      break;\r\n  }\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<h2 class=\"wp-block-heading\">Acknowledgement<\/h2>\n\n<p>The rocket in the post image I owe <a href=\"https:\/\/pixabay.com\/de\/users\/satheeshsankaran-11196627\/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=5666114\" target=\"_blank\" rel=\"noopener noreferrer\">Satheesh Sankaran<\/a> on <a href=\"https:\/\/pixabay.com\/de\/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=5666114\" target=\"_blank\" rel=\"noopener noreferrer\">Pixabay<\/a>.<\/p>\r\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I show you how to use the analog 3-axis accelerometer MMA7361 to determine acceleration, angle and orientation and how to use the free fall interrupt.<\/p>\n","protected":false},"author":1,"featured_media":9963,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[572],"tags":[1348,1343,1337,1340,1347,1345],"class_list":["post-10850","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sensors","tag-0-g-en","tag-3-axis","tag-accelerometer-en-2","tag-accelerometer-en-3","tag-free-fall-en-2","tag-mma7361-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-17T12:22:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-29T13:33:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"MMA7361 &#8211; Analog Accelerometer\",\"datePublished\":\"2021-01-17T12:22:56+00:00\",\"dateModified\":\"2024-10-29T13:33:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer\"},\"wordCount\":940,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Beitragsbild-1.jpg\",\"keywords\":[\"0 g\",\"3-axis\",\"accelerometer\",\"accelerometer\",\"free fall\",\"MMA7361\"],\"articleSection\":[\"Sensors\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer\",\"name\":\"MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Beitragsbild-1.jpg\",\"datePublished\":\"2021-01-17T12:22:56+00:00\",\"dateModified\":\"2024-10-29T13:33:43+00:00\",\"description\":\"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Beitragsbild-1.jpg\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Beitragsbild-1.jpg\",\"width\":1200,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/mma7361-analog-accelerometer#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MMA7361 &#8211; Analog Accelerometer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste","description":"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer","og_locale":"en_US","og_type":"article","og_title":"MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste","og_description":"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer","og_site_name":"Wolles Elektronikkiste","article_published_time":"2021-01-17T12:22:56+00:00","article_modified_time":"2024-10-29T13:33:43+00:00","og_image":[{"width":1200,"height":1200,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg","type":"image\/jpeg"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"MMA7361 &#8211; Analog Accelerometer","datePublished":"2021-01-17T12:22:56+00:00","dateModified":"2024-10-29T13:33:43+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer"},"wordCount":940,"commentCount":2,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg","keywords":["0 g","3-axis","accelerometer","accelerometer","free fall","MMA7361"],"articleSection":["Sensors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer","url":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer","name":"MMA7361 - Analog Accelerometer &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg","datePublished":"2021-01-17T12:22:56+00:00","dateModified":"2024-10-29T13:33:43+00:00","description":"I explain how to use the MMA7361 analog 3-axis accelerometer to determine acceleration, angle and orientation and how to use the free fall interrupt.","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2020\/11\/Beitragsbild-1.jpg","width":1200,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/mma7361-analog-accelerometer#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"MMA7361 &#8211; Analog Accelerometer"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/10850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=10850"}],"version-history":[{"count":0,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/10850\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/9963"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=10850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=10850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=10850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}