ENT2232 Lab 4 Manual
ENT2232 Lab 4 Manual
ENT2232 Lab 4 Manual
Faculty of Technology
Department of Engineering Technology
ENT2232 – Instrumentation and Calibration – Lab Manual
Objectives:
Theory:
An MPU6050 sensor module contains the MPU-6050 Six-Axis (Gyro +
Accelerometer) MEMS (Micro-Electro-Mechanical-System) and provides
acceleration, rotation, and temperature sensor readings over an I2C or SPI serial bus
interface. The MPU6050 IMU has both 3-Axis accelerometer and 3-Axis gyroscope
integrated on a single chip. However, the precision of MEMS gyroscopes is generally
not high and altitude error may accumulate quickly. Therefore, MEMS gyroscopes
must be calibrated before use.
Working Principle
Besides sensing the angular velocity, Gyroscope sensors can also measure the motion
of the object. For more robust and accurate motion sensing, in consumer electronics
Gyroscope sensors are combined with Accelerometer sensors. Depending on the
direction there are three types of angular rate measurements.
Yaw- the horizontal rotation on a flat surface when seen the object from above
Pitch- Vertical rotation as seen the object from front
Roll- the horizontal rotation when seen the object from front.
The concept of Coriolis force is used in Gyroscope sensors. In this sensor to measure
the angular rate, the rotation rate of the sensor is converted into an electrical signal.
Working principle of Gyroscope sensor can be understood by observing the working
of Vibration Gyroscope sensor.
Page 1 of 5
This sensor consists of an internal vibrating element made up of crystal material in the
shape of a double – T- structure. This structure comprises a stationary part in the center
with ‘Sensing Arm’ attached to it and ‘Drive Arm’ on both sides.
This double-T-structure is symmetrical. When an alternating vibration electrical field
is applied to the drive arms, continuous lateral vibrations are produced. As Drive arms
are symmetrical, when one arm moves to left the other moves to the right, thus
canceling out the leaking vibrations. This keeps the stationary part at the center and
sensing arm remains static.
When the external rotational force is applied to the sensor vertical vibrations are caused
on Drive arms. This leads to the vibration of the Drive arms in the upward and
downward directions due to which a rotational force acts on the stationary part in the
center.
Rotation of the stationary part leads to the vertical vibrations in sensing arms. These
vibrations caused in the sensing arm are measured as a change in electrical charge. This
change is used to measure the external rotational force applied to the sensor as Angular
rotation.
Measuring Acceleration
The MPU6050 has an on-chip accelerometer that can measure acceleration.
Page 2 of 5
Measuring Rotation
The MPU6050 has an on-chip gyroscope that can measure angular rotation.
• VCC (The breakout board has a voltage regulator. Therefore, you can connect
the board to 3.3V and 5V sources.)
• GND
• SCL (Serial Clock Line of the I2C protocol.)
• SDA (Serial Data Line of the I2C protocol.)
• XDA (Auxiliary data => I2C master serial data for connecting the module to
external sensors.)
• XCL (Auxiliary clock => I2C master serial clock for connecting the module to
external sensors.)
• AD0 (If this pin is LOW, the I2C address of the board will be 0x68. Otherwise,
if the pin is HIGH, the address will be 0x69.)
• INT (Interrupt digital output)
Page 3 of 5
Figure 03: Circuit diagram for MPU6050 interfacing with Arduino
Practical Instructions:
Session A
1. Connect the sensor module to the Arduino as shown in Figure 03.
2. Open Arduino IDE.
3. Go to Tools and click on Manage Libraries. (A new window will open which will have
a search bar, therein type MPU6050).
4. Install the library MPU6050 by Electronic Cats.
5. Once the libraries are installed, let’s utilize the IMU_Zero example sketch from the
MPU6050 library to calibrate the module with new offsets for the onboard
accelerometer and gyroscope data registers. This essentially “resets” the sensor
readings to the current orientation of the module. For that, open the Arduino IDE and
select File > Examples > MPU6050 > IMU_Zero from the main menu to open the
example sketch.
6. Start the calibration process by uploading the example sketch to the Arduino board.
Open the Serial Monitor window so that you can see the program’s output.
7. Follow the instructions within the comments section of the sketch to calibrate your
module. Once completed, you should see the word “-------done-------” in your serial
monitor.
Session B
Page 4 of 5
Questions
Session A
Session B
3. Describe the Procedure and design steps.
4. Discuss the issues of the practical.
5. Provide solutions to overcome the mentioned issues.
****
Page 5 of 5