Over 10 years we help companies reach their financial and branding goals. Engitech is a values-driven technology agency dedicated.

Gallery

Contacts

411 University St, Seattle, USA

engitech@oceanthemes.net

+1 -800-456-478-23

Kinetic Sensor/Modules Sensors and Modules

INTRODUCTION TO MPU6050IC

Most of us are fans of Video Games. We played a lot of games on our mobiles like PUBG, Call Of Duty and my personal favorite Asphalt. In all these games one thing we all notice is that as we rotate or bend our phone, the car also rotates in the same direction.  Have you ever imagined how this would happen? Well their are electronic sensors:  accelerometer and Gyroscope  

Lets dive into this blog, to know the Ans for this!!!

What is an Accelerometer and Gyroscope?

ACCELEROMETER WORKING

Let us assume a small ball being placed in a box filled with vacuum and no external force is applied to it (i.e., consider the situation of outer space).

Now initially the ball will be at the center of the box. Consider each side of the box as an axis.

Suddenly we start moving the box to the left side  with the acceleration of ‘g’ (i.e., 9.8m/s2), the ball will hit the +X side of the box. Since no external force is acting on it, and the entire thing is weightless (vacuum state), hence the force comes out to be ‘g’.

Consider another scenario when the box is moved upwards with the same acceleration ‘g’. Now again the ball will hit the downward side of the box i.e. +Z axis with the force equal to ‘g’.

This is just a simple explanation on how an accelerometer works but in practical scenario accelerometers are based on MEMS technology built on a silicon wafer with companion CMOS electronics through wafer-level bonding.

Taking the above situation in mind, there consists of a silicon wafer having polysilicon springs connected with a suspended plate covered with fixed mass around it on the wafer where in between the space, this fixed plate moves.

This entire structure reflects the changes whenever acceleration is applied across the X,Y and Z axis. This reflection is reflected by the capacitance change placed in between the fixed masses as the suspended plate moves thus the sensor records this change in capacitance as the final reading.

GYROSCOPE WORKING

Since the accelerometer measures the linear acceleration, the gyroscope on the other hand measures the angular rotation which is accomplished by Coriolis Effect. 

Coriolis Effect

The Coriolis Effect states that when a mass (m) moves in a specific direction with a velocity (v) and an external angular rate (Ω) is applied, the Coriolis Effect generates a force (F) that causes the mass to move perpendicularly. The value of this displacement is directly related to the angular rate applied.

 

Consider two masses oscillating in opposite directions at a constant frequency. When an angular rate is applied, the Coriolis effect produced by each mass is in opposite directions, resulting in a proportional change in capacitance between the masses. By measuring this change in capacitance, the angular rate can be calculated.

The MEMS sensor consists of a proof mass (i.e., it consists of 4 parts M1, M2, M3. M4) that continuously oscillates inward and outwards in the plane, thus causing a coriolis effect.

When the structure is being rotated, the Coriolis Force acts on the moving mass causing oscillations in the plane.

There are three modes depending upon the axis along which the angular rotation is applied:

  • Roll Mode: When the angular rate is applied at the X-axis
  • Pitch Mode: When the angular rate is applied at the Y-axis
  • Yaw Mode: When the angular rate is applied at the Z-axis

What is MPU6050 IC

A MUST HAVE Motion Interfacing one finds in almost every smartphone and tablet. It is a 3-axis gyroscope and 3-axis accelerometer, in total an integrated 6-axis MotionTracking device all in a single small 4x4x0.9mm package. This package size has been achieved by the MEMS (MicroElectroMechanical System) innovation.

Coming to some technical aspect of the IC,

  • It comes with a dedicated I2C sensor bus at 400KHz
  • Features 3 16-bit analog-to-digital converters (ADC) each for digitizing gyroscope and accelerometer outputs.
  • Gyroscope full-scale range of 250,500,1000 and 2000 degree/sec (DPS).
  • Accelerometer full-scale range of 2g,4g,8g,16g and 
  • On-chip 1024 Byte FIFO buffer which enables the system to read the sensor data in burst and then enter the low-power mode.
  • Lastly, it operates at a power supply voltage range of 2.375V – 3.46V.

Module of MPU6050

Pinout MPU6050

Block Diagram of MPU6050

Block Diagram of MPU6050 IC

Auxiliary and Primary I2C connection

The Sensor is connected to the MCU (system Processor) via I2C bus lines i.e., SDA and SCL along with the external compass sensor as shown. The module has an inbuilt bypass multiplexer, which connects the primary I2C bus pins 23 and 24 with the auxiliary sensors I2C pins 6 and 7.

Once the auxiliary sensors have been configured by the system processor, the interface bypass multiplexer should be disabled so that the MPU-6050 auxiliary I2C master can take control of the sensor I2C bus and gather data from the auxiliary sensors.

How does MPU6050 communicate with the host?

I2C connections

A two wire, half duplex interface comprising Serial Data SDA and Serial Clock SCL, I2C lines are in general open-drain and bi-directional.

It is a  master slave implementation where the master puts the slave device address on the bus and salve with the matching address acknowledges the master.

Here the MPU-6050 operates as a slave device when communicating with the MCu and the SDA and SCL lines are pulled up to VDD. The maximum bus speed is 400kHz.

The slave address of the MPU-6050 id 0b110100x, a 7-bit long. Here the LSB bit i.e.x in the 7-bit long address is determined by the logic level at AD0 pin.If x=0 i.e., pin AD0 is Logic LOW otherwise Logic HIGH.

The I2C communication begins and ends with the START and STOP COndition respectively. Whenever the master puts the Start condition on the bus the communication is established and as long as the Stop condition is sent by the master

The transaction of HIGH too LOW for the SDA pin keeping the SCL pin HIGH is marked as the Start condition.

The transaction of LOW too HIGH for the SDA pin keeping the SCL pin HIGH again is marked as the Start condition.

Start and Stop Condition

The data format of the I2C is 8-bit long. The transmission byte is followed by the acknowledge signal (ACK) shock clock generated by the master. The slave sends the ACK signal by pulling the SDA down and holding it during the HIGH portion of the acknowledged clock pulse.

If a slave is busy and cannot transmit or receive another byte of data until some other task has been performed, it can hold SCL LOW, thus forcing the master into a wait state. Normal data transfer resumes when the slave is ready and releases the clock line.

Acknowledge on I2C bus

Coming to the communication part, the master first sends the Start condition followed by the 7-bit address with 8th bit being read/write bit. The read/write signifies whether the master wants to read the data or to send the write command. The 9th clock pulse consists of the ACK or NACK (not Acknowledged) signal. The data transmission is terminated by the Stop Condition.

Complete I2C Data Transfer

Interestingly the master can send Start condition and address to slave without first generating the Stop condition. 

For Writing the internal MPU-6050 register, the master first sends the Start Condition followed by the slave address and writes bit 0. At the 9th clock pulse, the slave sends the ACK signal. Seeing ACK, master sends the register address to the bus on whose data master wants to write which is again followed by the ACK signal from the slave. After that the master puts the register data on to the bus. The communication eds with the Stop Condition sent by the master.

To write multiple bytes after the last ACK signal, the master can continue outputting data rather than transmitting a stop signal. In this case, the MPU-60X0 automatically increments the register address and loads the data to the appropriate register.

Writing Condition on I2C Bus

To read the internal MPU-60X0 registers, the master sends a start condition, followed by the I2C address and a write bit, and then the register address that is going to be read. Upon receiving the ACK signal from the MPU-60X0, the master transmits a start signal followed by the slave address and read bit. As a result, the MPU-60X0 sends an ACK signal and the data. The communication ends with a not acknowledged (NACK) signal and a stop bit from the master. The NACK condition is defined such that the SDA line remains high at the 9 th clock cycle. 

Reading Condition On I2C Bus

Alternative to MPU6050

Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog