<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: accelerometer]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?accelerometer</link>
<description></description>
<pubDate>Tue, 12 Jan 2021 14:10:18 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[accelerometer]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?accelerometer</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div class="wiki">
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#adxl335">Dobrica Pavlinušić's random unstructured stuff (ADXL335)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] ADXL335} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#mpu_9250">Dobrica Pavlinušić's random unstructured stuff (MPU-9250)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] MPU-=9250} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><p>
This page tries to document my experiments using accelerometers</p>
<h1 id="adxl335">ADXL335</h1>
<p>
Board: GY-61.</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;ADXL335 3-axis Accelerometer<br />
&nbsp;&nbsp;&nbsp;&nbsp;On-board 3.3V Voltage Regulator<br />
&nbsp;&nbsp;&nbsp;&nbsp;Analog voltage output centered at 1.65V<br />
&nbsp;&nbsp;&nbsp;&nbsp;Suitable for connection to 5V and 3.3V systems</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;Supply Voltage: 3V - 5V<br />
&nbsp;&nbsp;&nbsp;&nbsp;Full scale range: +/-3g<br />
&nbsp;&nbsp;&nbsp;&nbsp;Sensitivity: 300mV/g (Typ)</p>
<h1 id="mpu_9250">MPU-9250</h1>
<p>
Board: Grove - IMU 10DOF v1.1</p>
<p>
<a target="_blank" title="(external link)" href="https://wiki.seeedstudio.com/Grove-IMU_10DOF/">https://wiki.seeedstudio.com/Grove-IMU_10DOF/</a></p>
<span class="nlw_phrase"><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">Grove - IMU 10DOF v1.1.pdf</a><!-- wiki: {file: Grove -= IMU 10DOF v1.1.pdf} --></span><br /><br /><p>
MPU-9250 addr: 0x68<br />
BMP180 addr: 0x77</p>
<p>
This board has 5V -&gt; 3V3 level shifter but works with 3V3 as VCC</p>
<pre>
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 &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 &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
</pre>
<br /><p>
Hm. bmp180 works, mpu9250 doesn't</p>
<p>
It needs full device tree overlay <a target="_blank" title="(external link)" href="https://github.com/dpavlin/linux-gpio-pinout/blob/master/device-tree/grove-imu10dof.dts">https://github.com/dpavlin/linux-gpio-pinout/blob/master/device-tree/grove-imu10dof.dts</a></p>
</div>
<hr/><div>Attachments: Grove - IMU 10DOF v1.1.pdf</div>]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category></category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?accelerometer</guid>
<pubDate>Tue, 12 Jan 2021 14:10:18 -0000</pubDate>
</item>
</channel>
</rss>