Gyro Camera for Motorcycle using Arduino
As seen in MotoGP Race, the rider is seen riding through corners while laying aside his bike to the left and right. But there is an interesting moment when the motor looks to collapse sideward, the front views remain horizontally. How could that be?
Such onboard camera applies GYRO system, where the camera will be fixed perpendicular to the gravity of the earth.
Step 1: BUILD YOUR OWN GYRO CAMERA
We could build our own Gyro Camera by using GYRO and ACCELEROMETER modules.
They are two separate modules, hence we have to use two modules simultaneously. Then we make Gyro Chip and Accelerometer Chip in one module (there are two chips in one module). In latest version they are made in one chip only, thus minimizing the distortion of movement calculation
In this article, the module is Triple Axis Accelerometer & Gyro Breakout – MPU-6050, which has 3-axis gyroscope and 3-axis accelerometer in one chip, supplied by power of 3.3volt.
In addition to module MPU6050, the following similar modules could also be applied:
• IMU Fusion Board – ADXL345 & IMU3000
• IMU Digital Combo Board – 6 Degrees of Freedom ITG3200/ADXL345
Module MPU6050 with its tiny size of 20mm x 15mm and height of 1.6mm.
If you using different board than Arduino Uno R3, SCL and SDA pins of MPU are also different:
VDD : +3.3V
VIO : +3.3V
GND : GND
SDA : Pin A4 (Arduino Uno, Ethernet) / Pin 20 (Mega2560, Due) / Pin 2 (Leonardo)
SCL : Pin A5 (Arduino Uno, Ethernet) / Pin 21 (Mega2560, Due) / Pin 3 (Leonardo)
Step 2: PROGRAMMING
After having completely assembled, it is time now to upload the program to Arduino.
This circuit is only to drive servo in axis-X only. However, data from Axis Y and Z are still required for the respective Gyroscope and Accelerometer. I tried to combine them by applying Kalman Filter calculation so as to reduce ‘noise’ output from Gyroscope + Accelerometer so that servo movement is smooth and no unwanted movement.
/* GYRO CAMERA - saft7.com Demonstrates auto-leveling Camera Video by using Gyro & Accelerometer with Arduino The circuit: Servo controlled by Arduino, using Gyro and Accelerometer as reference of movement. Created March 12, 2013 by Firmansyah Saftari www.saft7.com This code and complete article can be found at: http://www.saft7.com/ Programming Language: C++ */ #include <Servo.h> Servo xservo; #include <Wire.h> #include "Kalman.h" Kalman kalmanX; Kalman kalmanY; uint8_t IMUAddress = 0x68; // MPU6050 Address
For more detail: Gyro Camera for Motorcycle using Arduino
This Post / Project can also be found using search terms:
- DIY 3 axis MPU6050 sensor with servo arduino
- gyroscope arduino
- Arduino gyro
- two motor control arduino adxl accelerometer sensor