Skip to main content
Integrated sensor with 3-axis accelerometer, 3-axis gyroscope and a temperature sensor with I2C interface.

Pin names

Power
Voltage supply
Ground
Ground
I2C
I2C clock line
I2C
I2C data line
Not Implemented
Unused - not currently implemented in the simulator
Not Implemented
Unused - not currently implemented in the simulator
Digital Input
Address select pin
Digital Output
Interrupt
The XDA and XCL pins are not currently implemented in the simulator. If you need them, please open a request, and describe your use case.
You normally only need to connect the VCC, GND, SCL, and SDA pins. The I2C address of the device is 0x68. You can change the address of 0x69 by connecting the AD0 pin to VCC.

Attributes

string
default:"0"
Initial x acceleration value (g)
string
default:"0"
Initial y acceleration value (g)
string
default:"1"
Initial z acceleration value (g)
string
default:"0"
Initial x rotation value (deg/sec)
string
default:"0"
Initial y rotation value (deg/sec)
string
default:"0"
Initial z rotation value (deg/sec)
string
default:"24"
Initial temperature value (celsius)

Units

All the acceleration values (x/y/z) use g-force units, where 1g = 9.80665 m/s². The gyroscope measures angular rotation and returns the number of degrees per second.

Arduino code example

The example below uses the Adafruit MPU6050 library to read and display the acceleration values from the sensor. On Arduino Uno, connect the SDA pin to A4, and the SCL pin to A5.
Run this example on Wokwi

Automation controls

The mpu6050 sensor can be controlled using Automation Scenarios. The names of the controls match the names of the attributes defined above:
float
Set the x acceleration value (g)
float
Set the y acceleration value (g)
float
Set the z acceleration value (g)
float
Set the x rotation value (deg/sec)
float
Set the y rotation value (deg/sec)
float
Set the z rotation value (deg/sec)
float
Set the temperature value (celsius)
The following example set the temperature to 25°C:

Simulator examples