Рет қаралды 21,342
New! ralphbacon.blog
A cheap MPU6050 Accelerometer and Gyro can determine its orientation very well, and could be useful for quadcopters, drones or other model aeroplanes, as well as simpler experiments such as a digital spirit level like the one I create here in my demo.
Whilst there is an excellent library by Jeff Rowberg that allows all the functionality possible with this device, my demo sketch doesn't use any, and relies on the raw data being manipulated to provide a stable and useful x-axis reading (in degrees) that could easily be extended to include the y- and z-axes too.
Just to build on previous sketches, I'm using some neopixels here to provide the visual indication of how level the x-axis is, and with some jiggery pokery have managed to to get it to show the centre led when balanced with the leds to the left (or right) illuminated depending on how far off-balance it is.
I'll be interested whether anyone kind think of any practical uses over and above stabilising a quadcopter or making a spirit level.
-----------------------------------------------------
Here are the links you might need:
-----------------------------------------------------
The demo sketch can be found here:
github.com/Ral...
(also download the accompanying GyroFunctions.h file in the same zip)
eBay item GY-521 3 Axis Accelerometer Gyroscope Module 6 DOF Module MPU-6050 for Arduino
www.ebay.co.uk/...
Joop Brokking: MPU-6050 6dof IMU tutorial for auto-leveling quadcopters with Arduino source code
Website: www.brokking.ne... (also contains links to his videos)
Part 1: • MPU-6050 6dof IMU tuto...
Part 2: • MPU-6050 6dof IMU tuto...
Sparkfun Guide to Accelerometers, Gyro and IMU (Inertial Measurement Unit)
www.sparkfun.c...
Arduino Playground on the MPU6050
playground.ardu...
Jeff Rowberg's i2cdevlib for advanced users
github.com/jro...
The Java IDE called "Processing v3.3"
processing.org...
Instructions on how to set up "Processing v3.3" for the TeaPot (aeroplane) demo
www.c-sharpcorn...
InvenSense (manufacturer) web page on the MPU6050
www.invensense...
If you like this video please give it a thumbs up, share it and if you're not already subscribed please do so :)
My channel is here:
------------------------------------------------------------------
/ ralphbacon
------------------------------------------------------------------
How can I remember this? Memory tip: "See" Ralph Bacon, geddit?