Git Product home page Git Product logo

mpu6050's Introduction

simple mpu6050 reader for orange pi and raspberry pi

this program will read gyro and accelerometer sensor data from mpu6050 imu and forward it to serial port, so you can work with the data on your development pc. in main.c mpu6050 is initialized with ±500 °/s gyro, ±4g accelerometer configurations.

following format is what you will receive from serial port, which are respectively accelerometer's x, y, z and gyro's x, y, z values:

-11224,6704,-88,-84,-99,-7

quick start with libimu

you can use libimu (https://github.com/grizzlei/libimu) to process the data you get from sensors. for a quick start, you can compile and use demo.c on your development pc.

configuring pi

first, enable i2c-0 and uart-1 interfaces from underlying operating system's tool. if you have to use a different configuration, update the code accordingly.

for armbian, use armbian-config

wiring

[mpu6050] -- i2c --> [orange/raspberry pi board] -- uart --> [your development pc]
╔═══════════════╦═══════════════╗    
║ orangepi pins ║  mpu6050 pins ║
╠═══════════════╬═══════════════╣
║ 1 [-][a]      ║  [a] - vcc    ║ 
║   [b][-]      ║  [d] - gnd    ║ 
║   [c][-]      ║  [c] - scl    ║ 
║   [-][e]      ║  [b] - sda    ║
║   [-][f]      ║  [-]          ║ 
║   [-][-]      ║  [-]          ║ 
║   [-][g]      ║  [-]          ║
║   [-][-]      ║  [-]          ║
║   [-][-]      ╠═══════════════╣
║   [-][-]      ║  usb-ttl pins ║
║   [-][-]      ╠═══════════════╣
║   [-][-]      ║ [e][f][g][-]  ║
║   [d][-] 26   ║ rx tx gnd vcc ║
╚═══════════════╩═══════════════╝

usb-ttl wiring is not necessary if you don't want gyro and accelerometer sensor data over serial.

dependencies

apt install libi2c-dev

build and install

! program will start as systemd service if you choose to install

git pull https://github.com/grizzlei/mpu6050.git
cd mpu6050
make
(optional) sudo make install

hasan karaman (whoami) - https://hasankaraman.dev - [email protected] - 2022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.