This tutorial explains how to interface the GY-521 module with evive. Module has MPU6050 on it, which has a 3-axis accelerometer ,3-axis gyroscope and a Digital Motion Processor on it. This module works on the principle of MEMS(Micro electro-mechanical system).
Before running into the details of working with the module, first, we should have an idea about what an accelerometer or a gyroscope is. Starting with the accelerometer: it gives a measure of acceleration along all 3 axes- x,y and z. Every accelerometer module has a micro-electromechanical structure which suffers a displacement due to acceleration this displacement is sensed in terms of change in capacitance which changes out voltage given by accelerometer unit. The GY-521 module has registers that store the acceleration value of all axes.
Similarly, gyroscope gives the amount of rotation along each of the x,y and z-axes. Rotation along x,y and z-axes are popularly known as roll, pitch, and yaw respectively. Gyroscope sensor also has a special structure that vibrates due to the rotation of the sensor leading to a change in the capacitance and hence output voltage changes.
- Connect “VCC” of GY-521 with “VCC” of evive
- Connect “GND” of GY-521 with “GND” of evive
- Connect “SDA” of GY-521 with “SDA” of evive (Serial data )
- Connect “SCL” of GY-521 with “SCL” of evive (Serial clock )
This code demonstrates the Interfacing of GY-521 module with evive. We are going to display the readings of the accelerometer, Gyroscope, and the temperature sensor on the serial monitor. In this code, we have used the Wire library which is used for “I2C” communication (Inter Integrated Circuit communication)