Motion sensor MPU6050 with TinkerPie
A second accelerometer + gyroscope you can mount anywhere, for example on a robot arm.
| Type | Smart sensors (I2C) |
|---|---|
| Connect to | SENSOR port · 0x68 |
| Gives | milli-g and °/s |
| Simulator | Yes: a control appears under the simulated board |
How it works
The MPU6050 combines a 3-axis accelerometer (it feels tilt and shaking) and a 3-axis gyroscope (it feels how fast it turns). Mount it on a robot arm, a car or a ramp to measure their movement.
How to wire it
Plug into any SENSOR 1-4 port (SDA, SCL, 3.3 V, GND). Each type has a fixed I2C address, so different types can share the bus.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
sensors.mpuAcceleration(Dimension.X)
sensors.mpuRotationRate(Dimension.Z)
// Arduino C++
sensors::mpuAcceleration(Dimension::X)
sensors::mpuRotationRate(Dimension::Z) Good to know
- Accelerometer up to ±16 g; gyroscope up to ±2000 °/s.
- Uses I2C (address 0x68).
- Mount it firmly; a loose sensor shakes and gives noisy readings.
Similar modules
- Light meter BH1750
- Temperature + humidity AHT20
- Temperature + humidity SHT31
- Colour sensor TCS34725
- IR thermometer MLX90614
- Real-time clock DS3231
- 4-channel ADC ADS1115
- Current + voltage sensor INA219
More projects to try
Questions
Can I try the Motion sensor MPU6050 without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
The board already has a motion sensor. Why add an MPU6050?
You can fix the MPU6050 anywhere, for example on the moving part of a robot arm, while the board stays still.