beginner · Time varies

CLUE spirit level

Use the CLUE accelerometer and display to create a pocket digital bubble level.

View original project ↗

What you’re building

Adafruit’s CLUE Spirit Level is a compact CircuitPython demonstration that converts the board’s accelerometer readings into a digital bubble level on its 240-pixel display. The script draws three colored circular guides, places a red bubble in a separate display group, and repeatedly updates that group from the CLUE’s x and y acceleration values. Multiplying by ten spreads normal tilt readings across more of the display; reversing the sign makes the dot float opposite the tilt, like a physical bubble. The expected outcome is an immediately responsive visual level with no external sensor or wiring. It requires an Adafruit CLUE running a compatible CircuitPython release plus the project’s bundled adafruit_clue and display-shapes libraries. The important constraint is that this is an illustrative accelerometer visualization, not a calibrated construction instrument: mounting alignment, sensor offset, acceleration, and code scaling affect the indicated center and should be calibrated before any measurement-dependent use.

Key steps

  1. Install a compatible CircuitPython release on CLUE and confirm the CIRCUITPY drive mounts.
  2. Download the guide’s Project Bundle and open the examples directory matching the CircuitPython major version installed on the board.
  3. Copy that directory’s code.py and required lib contents to the CIRCUITPY drive.
  4. Allow the board to reload and verify that the concentric guide circles and moving red bubble appear on the built-in display.
  5. Tilt the CLUE in both axes, then calibrate the center or scaling in code if using it beyond the guide’s visual demonstration.
Sources

Original project and code

Original project pages, manufacturer documentation and repositories used while preparing this page. Last reviewed .

  1. Project by learn.adafruit.comlearn.adafruit.com