Projects / Ideas / Black Pill digital spirit level

Black Pill digital spirit level

IntermediateMotionIdeaReviewed
In short

How do you build a black Pill digital spirit level?

A Black Pill reads an MPU6050 and shows a bubble on an OLED that moves as the board tilts, with the angle in degrees. Works only when held still. You need STM32 Black Pill (STM32F411CEU6), ST-Link V2 programmer (clone), MPU6050 IMU, SSD1306 OLED Display and Breadboard 830 Tie Points.

Level
Intermediate
Time
About 160 min
Parts
5
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal

Show tilt as a moving bubble.

How to build it

  1. Read the accelerometer over I2C
  2. Compute roll and pitch with atan2
  3. Smooth with a low-pass filter
  4. Draw a bubble inside a circle
  5. Add a zero button to calibrate on a flat surface

Related projects

Common questions

What parts do I need for the black Pill digital spirit level?

STM32 Black Pill (STM32F411CEU6), ST-Link V2 programmer (clone), MPU6050 IMU, SSD1306 OLED Display and Breadboard 830 Tie Points.

How long does the black Pill digital spirit level take to build?

About 160 minutes for a intermediate maker.