A Simple Accelerometer Calibrator

High possibility of earthquake could lead to the high number of victims caused by it. It also can cause other hazards such as tsunami, landslide, etc. In that case it requires a system that can examine the earthquake occurrence. Some possible system to detect earthquake is by creating a vibration sensor system using accelerometer. However, the output of the system is usually put in the form of acceleration data. Therefore, a calibrator system for accelerometer to sense the vibration is needed. In this study, a simple accelerometer calibrator has been developed using 12 V DC motor, optocoupler, Liquid Crystal Display (LCD) and AVR 328 microcontroller as controller system. The system uses the Pulse Wave Modulation (PWM) form microcontroller to control the motor rotational speed as response to vibration frequency. The frequency of vibration was read by optocoupler and then those data was used as feedback to the system. The results show that the systems could control the rotational speed and the vibration frequencies in accordance with the defined PWM.


Introduction
Earthquake is one of the most inevitable hazards around the world which typically caused by the movement of Earth's plates. When the plates move, they will rub against each other. The plates' friction makes the crust releases the energy and propagates toward the surface [1]. The earthquake can also induce aftershock around the initial earthquake location [2,3]. Moreover, it can cause many disasters such as tsunami and landslide which are some of the most frequent and hazardous disaster that triggered by it. For tsunami itself, the occurrences of tsunami are mostly produced by earthquakes that take place around sea floor [4][5][6]. About 82 % of tsunami all over the world is caused by tectonic plate movement [6]. Therefore, a system that can read the occurrence of earthquake is needed to prevent the hazard caused by it.
Recently, there are many researches on seismic sensor developments. Starting from the use of the accelerometer [7][8][9][10][11], fiber-optic Bragg grating [12,13], to the use of micro electromechanical systems [14,15]. Although the developments of seismic sensors have been widely studied, the use of accelerometers in earthquake monitoring system is still the most developed part. It is associated with the usability of the accelerometer system and also the easiness it offered.
To read the earthquake incidence using accelerometer sensor, the accelerometer needs to be calibrated first before being used. Many researchers have successfully developed the accelerometer calibrator [16][17][18][19][20]. However, the calibrator manufactured is difficult to build and maintain. It needs a complex procedure to develop and testing the system. Moreover, acceleration calibration mechanism of an accelerometer still has to be investigated. This paper describes the development of an accelerometer calibrator using DC motor, optocoupler, and an accelerometer.

System design
This section describes the design of accelerometer calibrator employing 12 V DC motor for plate actuation of the calibrator, an optocoupler for measuring the motor rotational speed, an AVR ATMega with Arduino bootloader for controlling the motor and all processes occurring in this system, liquid crystal display (LCD) and personal computer (PC) for displaying set point and readings of the optocoupler, and an accelerometer MMA8451Q GY-45 for testing the calibrator. Block diagram of this system is shown in Figure 1. In this system, the 8-bit pulse-width modulation (PWM) port of ATMega 328p microcontroller is used to control the rotational speed of motor. The rotation of motor will make the disc, which is equipped by four blades spin, rotates. This disc rotation is then read by the optocoupler to obtain the actual rotation speed which indicating the frequency of linear acceleration produced by it. In obtaining the actual angular velocity of the motor, the output voltage of the optocoupler is compared with the reference voltage by using comparator circuit as signal conditioning. The comparator circuit scheme is shown in Figure 2. The output of optocoupler is connected to the noninverting input of the operational amplifier (op-amp) and the reference is connected to the inverting input. When the non-inverting signal is higher than the inverting input, then the op-amp output will set to high (the value of the output is same with the positive supply) and vice versa. The result obtained from this comparison is then fed to the interrupt port of microcontroller. From these processes, when the signal output changes by the alteration of the reading of the optocoupler from high to low, the microcontroller will count and calculate the occurrence of interruption for one second to obtain the rotational speed. The result is then sent to the computer using the USB to serial communication and is compared to the set value. The result is also presented on the LCD to display the data in real time.
After the system had been built, the accelerometer MMA8451Q was used to test the calibrator.  Since the motor required a 12 V power source to get the maximum rotational speed, this system used a 12 V DC power supply on operating all parts of system. The power was also regulated to 5 V to give power to the microcontroller, LCD, and also for the accelerometer. The developed calibrator diagram is displayed in Figure 3.

Results and discussion
The correlation between average rotational speed of the system and duty cycle has been investigated. The results are displayed in Figure 4. The duty cycle was varied from 0 to 100 % by controlling the PWM values started from 0 to 255. In this project, the value of PWM was set to be tested from 75 to 250 with the increment of 25 because the PWM value under 75 would not cause the motor to rotate. It means that the duty cycle of the pulse to the motor varied from 30 to 98 %. The results show that average angular velocity produced by the motor are exponentially correlated with the duty cycle resulted by the controlled PWM.   Figure 5 shows the test results of the system for various set points. Measurement test was performed for two minutes for every set point. Overall, the results have shown that the system has worked well in reaching a predetermined set point. Especially for the set point of 2 rps (rotation per second), there are just a few errors found for this test. The error from this measurement was caused by the reading of optocoupler sensor. With only four blades on the disc to calculate the motor rotational speed, the optocoupler gave a wide range of reading especially when the projected rotational speed has a great value. Therefore, when the set point was lowered, the readings of optocoupler would show smaller error as proven by the results at set point of 2 rps. With a lower set point, the rotational speed would be slower so that the optocoupler sensor accurately read the four blades.

Figure 6. Accelerometer vibration data
For more accurate measurement results, the tests had been done on the system by using the MMA8451Q accelerometer with the set point of 2 rps. The result from this test procedure is displayed in Figure 6. The rotational speed of motor could be determined by knowing the frequency of the acceleration shown by the figure. From these results, the maximum peak read by the sensor was about 0.68 g. Therefore, using the wave acceleration function expressed by equation (1) (1) where A is the amplitude of wave function which has a value of 5 cm and g is gravitational acceleration. By assuming the gravitational acceleration to be 9.78 ms -2 , the frequency obtained from the graph was 1.84 Hz. The difference between the set point and the actual rotational speed read by the sensor was caused by the friction between the place for the accelerometer and the body of the system around it. The friction also caused instability on the maximum peaks produced by the systems. However, the actual angular velocity resulted from the system was about 2 rps proximate to the predetermined set point.

Conclusion
A simple calibrator for accelerometer has been developed using a 12 V DC motor, optocoupler, and AVR ATMega 328. The calibrator was developed using PWM of the microcontroller to control the motor rotational speed. The results have showed that the angular velocity resulted from the system was exponentially correlated with the PWM value. The system could also reach the set point well with a lowest set point resulting in the smallest error. It has been shown that the system could adjust the rotational speed of the motor to approach the predetermined value with the negligible errors.