Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Showing posts with label Arduino MPU6050 Gyroscope Accelerometer. Show all posts
Showing posts with label Arduino MPU6050 Gyroscope Accelerometer. Show all posts

Friday, April 13, 2018

Arduino Artificial Horizon Simulator - DIY aircraft flight instrument clone

In this project, we’ll see how to use Arduino with a very popular motion sensor MPU6050.
The developer has made a simple simulation for the main flight instrument in the cockpit which is the primary flight display PFD. 

On this display you can see the basic aircraft attitude (Pitch and Roll) maneuvers.


This instrument is called Artificial Horizon because it simulates the looks of horizon in front of the pilot inside the cockpit.

This project is based on the MPU6050 Inertial Measurement Unit IMU.

This sensor is the best documented motion sensor Arduino shield and you can find many projects with detailed descriptions on how it’s working.

The MPU6050 is a 6 Degree of Freedom sensor as it features a 3axis accelerometer plus a 3axis gyroscope.


Components

Arduino Uno
MPU6050  IMU Inertial Measurement Unit
Wires


Connections

Connect 5V [IMU MPU-6050] to VCC [ARDUINO] 
Connect SDA [IMU MPU-6050] to Analog IN (A4) [ARDUINO] 
Connect SCL [IMU MPU-6050] to Analog IN (A5) [ARDUINO] 
Connect GND [IMU MPU-6050] to GND [ARDUINO]
Connect INTPIN [IMU MPU-6050] to Pin 2 (Digital PWM pin) [ARDUINO]



Circuit




Code


Arduino Code

Processing Code







Display

The final display is produced inside Processing IDE. You can either install Processing IDE to then run Processing code for display inside it or you can run the display code online using sketchpad.









I've made a similar project as an entry for a  design contest organized by Renesas.


My version of the project based on Renesas YRDKRX62N development board.

It used a 3axis accelerometer as a motion sensor and a graphic LCD for display.

You can find it on my instructables page.






Thursday, March 22, 2018

Arduino MPU6050 Gyroscope Accelerometer - GY521 MOU6050

In this post, I’ll show you how to read data from the MPU6050.

This is an integrated MEMS Accelerometer and Gyroscope unit that is so popular and can be easily attached to Arduino.

The unit uses I2C protocol.

In the first example from Arduino website, we can read data and show it on the serial monitor application in Arduino IDE.

In the second project, you can read data from the unit and view data on Processing.



Project #1

This project is brought to you from Arduino create website.


Project Schematics:


GY-521                                           Arduino
VCC                    ->                  3.3 V or 5 V 
GND                    ->                           GND
SCL                           ->                       A5
SDA                      ->                       A4
XDA ->                No Connection
XCL ->               No Connection
ADO ->               No Connection

INT ->               No Connection





Here is the code for the project:


#include
const int MPU=0x68; 
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;

void setup(){
  Wire.begin();
  Wire.beginTransmission(MPU);
  Wire.write(0x6B); 
  Wire.write(0);    
  Wire.endTransmission(true);
  Serial.begin(9600);
}
void loop(){
  Wire.beginTransmission(MPU);
  Wire.write(0x3B);  
  Wire.endTransmission(false);
  Wire.requestFrom(MPU,12,true);  
  AcX=Wire.read()<<8|Wire.read();    
  AcY=Wire.read()<<8|Wire.read();  
  AcZ=Wire.read()<<8|Wire.read();  
  GyX=Wire.read()<<8|Wire.read();  
  GyY=Wire.read()<<8|Wire.read();  
  GyZ=Wire.read()<<8|Wire.read();  
  
  Serial.print("Accelerometer: ");
  Serial.print("X = "); Serial.print(AcX);
  Serial.print(" | Y = "); Serial.print(AcY);
  Serial.print(" | Z = "); Serial.println(AcZ); 
  
  Serial.print("Gyroscope: ");
  Serial.print("X = "); Serial.print(GyX);
  Serial.print(" | Y = "); Serial.print(GyY);
  Serial.print(" | Z = "); Serial.println(GyZ);
  Serial.println(" ");
  delay(333);
}














Project #2

And as another source of a project using the same unit GY-521, here it is:

You can download Arduino code, connect the project, get Processing code and then run it on http://sketchpad.cc


Project Schematics is just the same as the previous project. I repeated them to make things easy:



GY-521                                           Arduino
VCC                    ->                  3.3 V or 5 V 
GND                    ->                           GND
SCL                           ->                       A5
SDA                      ->                       A4
XDA ->                No Connection
XCL ->               No Connection
ADO ->               No Connection

INT ->               No Connection



Get Arduino Code from here

Get Processing Code from here









Paid Online Surveys

Check our books on Amazon we created on our way to find happiness.


A Trip To Siwa Oasis: Tourist guide to an Egyptian Oasis by [ElSakhawy, Sara M.]


A Trip To Siwa Oasis




The Ultimate travel bag list by [ Elskhawy, Sara M.]

















Tank