Quadcopter part 8: I2C

For the quadcopter I bought a GY-80 arduino compatible 10 DOF (degrees of freedom) sensor IMU. The small board comes with an accelerometer, a gyroscope, a magnetometer, and a pressure sensor. For now I only need the accelerometer and the gyroscope, and this post deals with connecting the sensor board to the beaglebone back and reading out the results by using the BlackLib library.

First some specifications on the sensor board:

  • 3 Axis Gyro
    • ST Microelectronics L3G4200D
    • Address: 0x69
    • Datasheet
  • 3 Axis Accelerometer
    • Analog Devices ADXL345
    • Address: 0x53
    • Datasheet
  • 3 Axis Magnetometer
  • Barometer + Thermometer

Connecting the sensors to the beaglebone black is very straightforward. The sensor board supports both 5V and 3.3V power, and in case of the beaglebone al the I2C lines are 3.3V logic levels, I decided to power the sensors with the 3.3V.

To connect the SDA and SCL lines to the beaglebone black board, you need to realise that the beaglebone comes with 3 I2C busses. Only I2C bus 0 and 1 are by default enabled, and used by the system, the third one can be turned on by using the device tree overlays. But I2C bus 0 isn’t exported to the expansion headers so I will have to use I2C bus 1, on expansion header P9, pins 19 and 20, since these are by default enabled, no additional configuration was required.

When powering up the board:

root@beaglebone:~# i2cdetect -y -r 1
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

With the BlackLib library, reading out the sensor data was fairly easy. Sources can be found on my github.

With this final hardware installed on the quadcopter, the assembly has been completed!
wpid-wp-1425224103231.jpeg

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.