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.

Arduino 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
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)


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.

Arduino Gyro Camera circuit



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

This code and complete article can be found at:

Programming Language: C++


#include <Servo.h>
Servo xservo;

#include <Wire.h>
#include "Kalman.h"
Kalman kalmanX;
Kalman kalmanY;

uint8_t IMUAddress = 0x68; // MPU6050 Address

[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]The components are:
• Triple Axis Accelerometer & Gyro Breakout – MPU-6050
• Arduino UNO R3
• Digital Servo (use good and powerful servo)
• Breadboard Mini
• 9v Battery + Switch
• Box and other accessories.[/box]

For more detail: Gyro Camera for Motorcycle using Arduino

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Scroll to Top