<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title xmlns="http://www.w3.org/2005/Atom">Dobrica Pavlinušić's random unstructured stuff: accelerometer</title>
  <id xmlns="http://www.w3.org/2005/Atom">https://saturn.ffzg.hr/rot13/</id>
  <link xmlns="http://www.w3.org/2005/Atom" type="text/html" rel="alternate" href="https://saturn.ffzg.hr/rot13/index.cgi?accelerometer"/>
  <link xmlns="http://www.w3.org/2005/Atom" type="application/atom+xml" rel="self" href="https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443/feed/workspace/rot13?page=accelerometer;type=Atom"/>
  <updated xmlns="http://www.w3.org/2005/Atom">2021-01-12T14:10:18Z</updated>
  <entry xmlns="http://www.w3.org/2005/Atom">
    <title xmlns="http://www.w3.org/2005/Atom">accelerometer</title>
    <link xmlns="http://www.w3.org/2005/Atom" type="text/html" rel="alternate" href="https://saturn.ffzg.hr/rot13/index.cgi?accelerometer"/>
    <content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;div&gt;Creator: Dobrica Pavlinušić&lt;/div&gt;&lt;hr/&gt;&lt;div class="wiki"&gt;
&lt;div class="nlw_phrase"&gt;&lt;table class="wafl_container"&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;div class="wafl_box"&gt;
        
          &lt;div class="wafl_titlebox"&gt;
            &lt;div class="wafl_title"&gt;
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="wafl_items"&gt;
            
              &lt;div class="wiki"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="nlw_phrase"&gt;&lt;a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#adxl335"&gt;Dobrica Pavlinušić's random unstructured stuff (ADXL335)&lt;/a&gt;&lt;!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] ADXL335} --&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="nlw_phrase"&gt;&lt;a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#mpu_9250"&gt;Dobrica Pavlinušić's random unstructured stuff (MPU-9250)&lt;/a&gt;&lt;!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] MPU-=9250} --&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

            
            
          &lt;/div&gt;
        
      &lt;/div&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;!-- wiki: {toc: }
--&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;
This page tries to document my experiments using accelerometers&lt;/p&gt;
&lt;h1 id="adxl335"&gt;ADXL335&lt;/h1&gt;
&lt;p&gt;
Board: GY-61.&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ADXL335 3-axis Accelerometer&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;On-board 3.3V Voltage Regulator&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Analog voltage output centered at 1.65V&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Suitable for connection to 5V and 3.3V systems&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Supply Voltage: 3V - 5V&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Full scale range: +/-3g&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Sensitivity: 300mV/g (Typ)&lt;/p&gt;
&lt;h1 id="mpu_9250"&gt;MPU-9250&lt;/h1&gt;
&lt;p&gt;
Board: Grove - IMU 10DOF v1.1&lt;/p&gt;
&lt;p&gt;
&lt;a target="_blank" title="(external link)" href="https://wiki.seeedstudio.com/Grove-IMU_10DOF/"&gt;https://wiki.seeedstudio.com/Grove-IMU_10DOF/&lt;/a&gt;&lt;/p&gt;
&lt;span class="nlw_phrase"&gt;&lt;a href="https://saturn.ffzg.hr/rot13/index.cgi/Grove%20-%20IMU%2010DOF%20v1.1.pdf?action=attachments_download;page_name=accelerometer;id=20210109121050-0-17173"&gt;Grove - IMU 10DOF v1.1.pdf&lt;/a&gt;&lt;!-- wiki: {file: Grove -= IMU 10DOF v1.1.pdf} --&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;
MPU-9250 addr: 0x68&lt;br /&gt;
BMP180 addr: 0x77&lt;/p&gt;
&lt;p&gt;
This board has 5V -&amp;gt; 3V3 level shifter but works with 3V3 as VCC&lt;/p&gt;
&lt;pre&gt;
root@rpi4:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

root@rpi4:~# modprobe configs
root@rpi4:~# zgrep INV /proc/config.gz
CONFIG_INV_MPU6050_IIO=m
CONFIG_INV_MPU6050_I2C=m
# CONFIG_INV_MPU6050_SPI is not set

root@rpi4:~# modprobe inv-mpu6050-i2c

root@rpi4:~# echo mpu9250 0x68 &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device
[Sat Jan  9 14:10:25 2021] inv-mpu6050-i2c 1-0068: mounting matrix not found: using identity...
[Sat Jan  9 14:10:25 2021] inv-mpu6050-i2c 1-0068: 1-0068 supply vddio not found, using dummy regulator
[Sat Jan  9 14:10:25 2021] inv-mpu6050-i2c 1-0068: trigger probe fail -22
[Sat Jan  9 14:10:25 2021] inv-mpu6050-i2c: probe of 1-0068 failed with error -22
[Sat Jan  9 14:10:25 2021] i2c i2c-1: new_device: Instantiated device mpu9250 at 0x68

root@rpi4:~# echo bmp180 0x77 &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device
[Sat Jan  9 14:12:17 2021] i2c i2c-1: new_device: Instantiated device bmp180 at 0x77
[Sat Jan  9 14:12:17 2021] bmp280 1-0077: 1-0077 supply vddd not found, using dummy regulator
[Sat Jan  9 14:12:17 2021] bmp280 1-0077: 1-0077 supply vdda not found, using dummy regulator
[Sat Jan  9 14:12:17 2021] bmp280 1-0077: non-rising trigger given for EOC interrupt, trying to enforce it
[Sat Jan  9 14:12:17 2021] bmp280 1-0077: unable to request DRDY IRQ

root@rpi4:~# iio_info
Library version: 0.16 (git tag: v0.16)
Compiled with backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.16 (git tag: v0.16)
Backend description string: Linux rpi4 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l
IIO context has 1 attributes:
	local,kernel: 5.4.79-v7l+
IIO context has 1 devices:
	iio:device0: bmp180
		2 channels found:
			pressure:  (input)
			3 channel-specific attributes found:
				attr  0: input value: 100.646000000
				attr  1: oversampling_ratio value: 8
				attr  2: oversampling_ratio_available value: 1 2 4 8
			temp:  (input)
			3 channel-specific attributes found:
				attr  0: input value: 24800
				attr  1: oversampling_ratio value: 1
				attr  2: oversampling_ratio_available value: 1
&lt;/pre&gt;
&lt;br /&gt;&lt;p&gt;
Hm. bmp180 works, mpu9250 doesn't&lt;/p&gt;
&lt;p&gt;
It needs full device tree overlay &lt;a target="_blank" title="(external link)" href="https://github.com/dpavlin/linux-gpio-pinout/blob/master/device-tree/grove-imu10dof.dts"&gt;https://github.com/dpavlin/linux-gpio-pinout/blob/master/device-tree/grove-imu10dof.dts&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr/&gt;&lt;div&gt;Attachments: Grove - IMU 10DOF v1.1.pdf&lt;/div&gt;</content>
    <id xmlns="http://www.w3.org/2005/Atom">https://saturn.ffzg.hr/rot13/index.cgi?accelerometer</id>
    <author xmlns="http://www.w3.org/2005/Atom">
      <name xmlns="http://www.w3.org/2005/Atom">Dobrica Pavlinušić</name>
    </author>
    <updated xmlns="http://www.w3.org/2005/Atom">2021-01-12T14:10:18Z</updated>
  </entry>
</feed>
