Development of a Simple and Low-cost Smartphone Gimbal with MPU-6050 Sensor

This paper discusses about design and development of gimbal smartphone, which are made to be simple and less money consuming by utilizing microcontroller and MPU 6050 sensor. Recently, the development of videography and image processing is inseparable from the rapid advance in smartphone technology. One of the most popular features is camera. Hand movements and shocks cause fewer maximum results. To improve the quality of camera captures and video, it is necessary to have a stabilizer for camera position. Thus, it is expected that the outcomes of this paper are able to give contribution for cheap gimbal smartphone. Design and implementation of gimbal uses acrylic as the material, with 5 mm of thickness. This MPU 6050 sensor is optimized to detect sway in axis X, Y, and Z or roll, pitch, and yaw. Gyroscope and accelerometer provide input to the microcontroller, which will process for output on 3 servomotors that function to maintain the camera’s position at a specified set point. The results show that MPU 6050 sensor can response angle reading error of 1.34° of roll, 0.25° of pitch, and 0.78° of yaw. Error in maximum servomotor movement is 1.5°. Thus, it can be concluded that gimbal can work optimally with less money consuming as well as low error. It is expected that the next research will add other suitable and accurate control, that is, PID or fuzzy. Keywords—gimbal, MPU-6050 sensor, servo motor


INTRODUCTION
The main aim of this paper is to develop stabilized camera control system which is used in number of applications such as photography. The camera control system is supporting using a mechanical system known as gimbal system. In photograpy, taking pictures and videos can be done through several media. As the recent development of technology, especially in science, everything can be carried out easily and fast. The most important factors to know the quality of movie are camera and its supporting devices, because hand movement while taking pictures, that is called camera shake, causes undesirable image blur. The objects present in unstable environment are arranged in stable position using this mechanical device [1], [2]. Thus, camera and capture devices continue to improve. The supporting devices that are recently used to take video is gimbal. Control of camera can be feasible by manual control but it is complex and tedious since it requires separate operator to control it [3]. Gimbal is a camera movement controller tool in axis x, y, and z.
Gimbal functions as a tool to maintain camera angle in a particular direction. Gimbal is very compatible to be used in a system commonly used on camera. The system is called Pan Tilt Zoom (PTZ) [4], which is a pan to control yaw axis of camera. Tilt is camera tilt control in the form of pitch and roll axes. Zoom is a magnification control of image on the camera. In PTZ system, gimbal is used to move the camera on pitch, roll, and yaw angle so that the camera can maintain its angle [5], [6].
Many people still use tripod to record video. However, it is important to know that tripod is only used to help us hold a camera, not to stabilize the video. Thus, it is more effective to use gimbal, which is not only useful to record video, but also to stabilize the picture. To examine camera motions, the simplest method is to shoot a pint light source [7]. To prevent or reduce the camera shake in smartphone, the gimbal for image stabilizer has been developed. The common architecture consists of built-in gyro sensors that identify the hand movement and the movement cancellation mechanism that precisely shifts the optical axis or image sensing device to compensate for the camera motion [8], [9].

II. METHODS
The method used to develop gimbal smartphone consists of designing system, designing hardware, and implementing the whole system.

A. Designing System
System consisted of accelerometer sensor and gyroscope MPU6050 to detect object's orientation over the gravity. Data processing and decision making used Arduino Uno. Actuator used three servomotors. The working principle of this tool started from the input in the form of MPU6050 sensor, which was a gyroscope and accelerometer used to read the tilt or shake. Input data from the sensor was processed by Arduino Uno as microcontroller to match the method used, and data from the microcontroller was used to drive the servomotor as the output of the device to stabilize the camcorder. Smartphone functioned as an object to be stabilized and a media of picture or video recorder.

IMU Sensor
The gimbal used to control is 3-axis gimbal which consist of IMU Sensor [10]. Inertial Measurement Unit (IMU) is a sensor used to measure speed, orientation, and gravity through Journal of Robotics and Control (JRC) ISSN: 2715-5072 137 Arif Ainur Rafiq, Development of a Simple and Low-cost Smartphone Gimbal Using MPU-6050 Sensor accelerometer and gyroscope. IMU is often used in aircraft system. IMU which be applied in many navigation systems such as for mobile platform [11], spin-stabilized of sounding rocket [12], autonomous of vehicle navigation [13], and personal navigator [14] uses either the accelerometer or the gyroscope or both as the main component. The first component of IMU is accelerometer sensor. This sensor is used to measure the acceleration of an object by carrying out an integral acceleration of the object over time. The next component of IMU Sensor is gyro sensor. The sensor works by detecting motion according to gravity, or in other words, detecting the user's movement. Gyroscope has an output in the form of angular velocity from 3 axis direction, namely x axis/phi angle (right and left) of y axis/angle theta (top and bottom), and z axis/psi angle (front and back) [15], [16], and [17]. Sensor used in this design is MPU 6050. It is available in the market with affordable price. MPU 6050 sensor is one of sensors that use the basic principles of IMU sensor [18]. The register setting on MPU 6050 is carried out by microcontroller with I2C communication [19], [20].

Arduino Uno
Arduino is a microcontroller board based on ATmega328 [21], [22]. Arduino Uno can be activated via a USB connection or with an external power supply [23]. The power source is selected automatically [24]. This microcomputer has 14 digitals I/O port (six of them can provide the PWM outputs), 6 analog I/O ports, a reset switch and a ISP download [25]. In this article, Arduino functions as a controller of all components and commands given.

Servo Motor
Servo mechanism is the principle work of DC motor which has 3 wires and maximum angle of 180° can be rotated [26]. Servo motor is a motor that works based on the work procedure of closed loop, so that the rotation angle of the servomotor can be adjusted [27]. Servo motor angle can be adjusted by using Pulse Width Modulation (PWM) input. The magnitude of torque used in MG996R servomotor type is 9.40 kg-cm [28]. That size of torque would be enough to rotate the shaft of the servomotor. Controlling servomotor is different from regular DC motor. To control servomotor, it is necessary to use PWM (Pulse Width Modulation) [29].

Electronic Design
In electronics design, 3 servo motors were connected to Arduino Uno which received input from MPU6050 sensor. Input in the form of tilt or shock used gyroscope and accelerometer. The smartphone was placed on a camera mount so it did not fall while being used. This stabilizer used a servomotor connected to one another so that it was able to determine the yaw, pitch, and roll angles according to the placement of the motor. The results of data from gyroscope sensor and accelerometer were used to drive the servomotor to the axis x, y, and z to adjust the balance so that the smartphone remains in the set point condition that has been adjusted in Arduino Uno microcontroller program. The battery assembled in series produced a voltage of 7.4 volts, and it was reduced into 5 volts by a buck converter to be distributed to servomotors, Arduino, and MPU-6050.

B. System Flow Chart
Flowchart of the tool working procedure is shown in Figure 5. A flowchart is a diagram with graphical that express the flow of an algorithm and a process that displays the step of the system proposed.
The set point of this tool was adjusted, and after then, the sensor performed the initial position reading. If the position has been matched with the set point, the motor will be silent. Meanwhile, if the position has not been matched, it will read again to find out whether it exceeds the set point. If it exceeds the set point, the pitch and roll motor will move clockwise while the yaw motor will remain at the set point. If it is less than the set point then the counter will move clockwise. If it has been matched, the motor will be silent.

C. System Hardware
In this hardware design, AutoCAD software is used to provide detailed image and precise measurements. Component placement is also a factor in compatibility between design and implementation. In its implementation, the material used was acrylic, with a size of 5 mm, so it was strong enough to support the burden of a smartphone. In this design, it consists of 3 MG996 servo motors for the 3-axis control and a base on which the MPU6050 sensor, the Arduino and the battery will be placed. In the figure of mechanical design, each motor will be connected to each other by the mouth so that they can move as in line with the axis, roll, and pitch. Position of the motor is also adjusted in accordance with the design commonly used by people. The tool testing method starts from testing several parts including servomotor testing, MPU6050 sensor, and system response. After that, the angle data is taken from gyroscope sensor and accelerometer, in which the data is used to drive the servomotor.

A. Sensor Testing
Sensor testing is conducted to each axis, namely pitch, roll, and yaw. The results of each axis can be seen in Table 1, Table  2, Table 3, and Figure 5.  Table 1 present that the sensor has been able to show the data of angle and to detect the tilt position with the average of error for the roll of 1.34. The smallest error value is 1.20 at the angle 90°. And the highest error is 2.31 at the angle 60°. Based on the result on Table 2, it can be analysed that the sensor has been able to show the data of angle and to detect the tilt position with the average of error for the pitch of 0.35. The smallest error value is 0.11 at the angle 90°. And the highest error is 0.72 at the angle 45°. Based on the result on Table 3, it present that the sensor has been able to show the data of angle and to detect the tilt position with the average of error for the yaw of 0.78. The smallest error value is 0. at the angle 30°. And the highest error is 1.78 at the angle 45°. Based on the graph in Figure 9, it is seen that the sensor has been able to detect the tilt angle properly to all axes. The reliability value is used to determine the level of consistency of measurements repeatedly with the same conditions or circumstances. The smaller the reliability value produced, the more stable the measurement level [30]. The validity value is influenced by the deviation value.

B. Servo Motor Testing
Servo motor testing aims to find out whether servomotor can move according to the turning angle as an input. This test uses Arduino test as a microcontroller to provide input on the servomotor. After conducting the experiment above, a table is made to identify and to make a decision whether the servomotor functions properly.
The results of servomotor testing can be seen in Table 4. Based on the results of servomotor, it is seen that servo motor can do the angle movement in line with the set point, with the average value is 1.32 degree. This value is still in a normal range in its use.

C. System Mechanism Testing
System mechanism testing is carried out by monitoring the movement of the tool when it moves to the right and left. Based on the test, it is seen that smartphone can maintain its orientation although the tool is tilted to the right and left. Small error still occurs in this testing because of not using controller to produce smoother output on the servomotor during its implementation.
Assembling the gimbal was quite easy but it must be carefully for connecting one other. It started with installing the Yaw servo and secured it to the base. Next, using the same method to install the Roll and Pitch servo. The parts are specifically designed to easily fit the MG996R servos. From the Figure 10, we can see that for powering the gimbal, it used 2 Li-ion Batteries which it placed in the battery holder. The 2 Li-ion batteries will produce around 7.4Vt, but it need 5V for powering the Arduino and the servos. That's why it used a buck converter which will convert 7.4V to 5V in order to make it suitable with the voltage references.
Overall, with a cost of no more than Rp. 400.000, we can make a gimbal smartphone that are simple and inexpensive but reliable according to their function. With this the selfbalancing platform or the Arduino gimbal is done and it works well as expected.
IV. CONCLUSION After going through the process of designing, testing, and analysis based on the results that have been done, it can be concluded that the 3 servomotors used can stabilize the smartphone with a maximum error rate of 2.31⁰ on the roll Arif Ainur Rafiq, Development of a Simple and Low-cost Smartphone Gimbal Using MPU-6050 Sensor angle reading. The use of acrylic material is sufficient to support a smartphone load up to a size of 6.3". This article can provide an easy, cheap, and simple alternative to produce an aid for photography lovers with accurate results. In the next research, it is recommended to use a type of BLDC motor to get the smooth movement.