Gyroscope and Accelerometer
STM32-Experiments Free Updated Sep 20, 2026

Gyroscope and Accelerometer

Gyroscope , Accelerometer , MPU6050 , I2C

Introduction

This is where we get our STM32 talking to its first “smart” sensor, the MPU6050, a tiny chip that can tell you both how it's accelerating and how fast it's spinning, all at once. We'll wake it up from its default sleep mode, and then continuously pull both sets of readings over I2C and print them to PuTTY. This is genuinely the same category of chip you'll find inside phones (for screen rotation), game controllers, and drones.

2. Scope

We'll cover how the I2C protocol actually works, get the STM32 talking to the MPU6050 as the “master” on the bus, write one register to wake the sensor up, and then read six values back in one efficient burst rather than six separate slow transactions. I2C is genuinely one of the most useful things you'll learn in this whole series, it's the protocol behind an enormous number of cheap sensor breakout boards you can buy, so getting comfortable with it here pays off again and again later.

3. Prerequisite

3.1 Hardware

  • STM32 Nucleo-F070RB development board

  • MPU6050 breakout module

  • Breadboard and jumper wires

  • Micro-USB cable

  • PC with PuTTY

3.2 Software

  • STM32CubeMX (standalone)

  • STM32CubeIDE

  • ST-LINK USB driver

  • PuTTY, or an equivalent serial terminal app

Community Q&A

0 questions

Ask questions and get answers from our community and staff moderators.

No questions yet — be the first to start the conversation!

Ask a Question

Please log in to ask a question or post a reply.

Login to Participate