C Labs
Opening brief · Introduction

Know which way is up

How does a machine know what is happening to it in the physical world?

You encounter orientation sensing every day, even when you do not notice it. A phone rotates its display when you turn it. A drone changes motor speeds to remain level. A rocket corrects its course, while a VR headset updates your view as you move your head.

These machines do very different jobs, but each needs an answer to the same question: which way am I facing? That answer is its orientation—its rotation relative to a useful reference such as gravity and the world around it.

Knowing its orientation allows a machine to react rather than simply move. This is a common job for an .

Many embedded systems operate as a repeating loop:

The control loop

Disturbance → Measure → Calculate → Correct → Measure again

A disturbance changes the system. Sensors measure what happened. Software calculates the system’s new state, and a controller decides how to respond. The cycle then begins again with another measurement.

This Lab concentrates on the first essential part of that loop: measurement. Before a drone can keep itself level, it needs a trustworthy description of how it is moving.

Reveal possible answers

Several measurements can help a machine estimate its orientation or movement:

Real systems often combine several sensors because each one answers a different part of the question.

You will not build an entire drone. Instead, you will build the sensing system that lets one begin to answer: what is happening to me in the physical world?

The system you are about to build

PHYSICAL WORLD → MPU6050 → ESP32 → USB → COMPUTER

The measures acceleration and rotation. The reads those measurements and calculates an estimate of orientation. It then sends the result over USB so your computer can reproduce the movement as a live 3D model.

The MPU6050 contains two sensors: an and a . Each sees a different part of the motion. You will learn how to read both measurements and combine them into an orientation estimate.

What you will learn

By working through the investigation, you will learn how to:

  • communicate with a sensor over I²C;
  • turn raw register values into physical measurements;
  • use gravity to calculate tilt;
  • measure and correct gyroscope bias;
  • integrate angular velocity over time; and
  • fuse imperfect measurements into a more useful orientation estimate.

You do not need to understand every term yet. Each one will be introduced when the system needs it. For now, the goal is simple: connect a physical movement in your hand to a measurement you can see, question, and improve.

Progressive toolkit

Tools appear as the investigation reaches them.