Designing an Electronic Spirit Level for the Visually Impaired
This article presents a complete, low‑cost design of a spirit level that provides audible and visual feedback for users with visual impairments. It uses the ADXL312 accelerometer to detect tilt in both horizontal and vertical planes, triggering a buzzer when the device is perfectly level or vertical.
Introduction
For many people with visual impairments, traditional bubble spirit levels are difficult to use. A tactile or audible alternative can significantly improve independence and safety in everyday tasks such as hanging pictures, setting up furniture, or leveling trailers. This design demonstrates how a small MEMS accelerometer can replace the conventional bubble, offering comparable precision while providing an audio cue.
Hardware Overview
The core sensor is the ADXL312, a 3‑axis MEMS accelerometer that measures up to ±1.5 g with a 10‑bit resolution. Key specifications:
- Package: 5 mm × 5 mm
- Power: 0.1 µA in standby, 6.25 Hz bandwidth (default 50 Hz)
- Noise density: 340 µg/√Hz (≈850 µg RMS at 6.25 Hz)
- Resolution: 2.9 m g per least significant bit
Data are read over an SPI bus and stored in six 8‑bit registers. The device also supports I²C, a 32‑level FIFO, dual interrupts, offset registers, a self‑test, and automatic sleep modes.
System Schematic
The complete circuit (Figure 3) includes a 5 V supply regulated down to 3.3 V by an ADP121 linear regulator, powering the ADXL312, microcontroller, and 25AA040 EEPROM. A 10 kΩ pull‑up on the CAL pin allows calibration mode selection. The buzzer and 16‑character LCD provide immediate feedback and numeric readings.

Figure 3. Circuit diagram. (Source: Analog Devices)
Calibration Procedure
During manufacturing, the device is mounted on a horizontal jig with the CAL jumper connected to ground. The microcontroller reads the raw x, y, and z values, subtracts them from zero, and writes the offsets into the ADXL312’s internal registers and the EEPROM. After the jumper is removed, the calibration routine is bypassed; the stored offsets are loaded on each power‑up.
The software averages eight samples per axis, refreshing the LCD every 100 ms. When the x‑axis reads 0 or 1023 (±1 g) the buzzer sounds, indicating the device is level; when the z‑axis reads these values the buzzer indicates vertical alignment.
Signal Processing and Accuracy
The ADXL312’s output follows a sinusoidal relationship with tilt angle:

Figure 4. Sinusoidal response of the sensor.
At full scale (±1.5 g), a 1 g force corresponds to two‑thirds full scale. With a resolution of 2.9 m g, the angular resolution is approximately 0.17°. For context, a standard 1.2 m bubble level has a 0.15° resolution, so the electronic version matches or surpasses mechanical precision.
Noise can be reduced by lowering the bandwidth to 6.25 Hz, yielding 850 µg RMS. Further averaging of samples also improves stability.
Data Representation
Table 1 illustrates two’s complement encoding for the ADXL312’s 10‑bit output.
| Decimal | Binary |
|---|---|
| +511 | 01 1111 1111 |
| +1 | 00 0000 0001 |
| 0 | 00 0000 0000 |
| -1 | 11 1111 1111 |
| -511 | 10 0000 0001 |
Future Enhancements
- Higher resolution sensors (ADXL313, ADXL355) for finer angle detection.
- Implementing on‑chip math (Taylor series) to display degrees on the LCD.
- Integrating the unit into larger systems such as trailer leveling or vehicle stability control.
Conclusion
The ADXL312‑based spirit level delivers accurate, low‑power tilt measurement with an intuitive audio cue, making it a practical tool for visually impaired users and a versatile component for embedded systems.
Simon Bramble is a senior analog electronics engineer at Analog Devices, specializing in power and sensor solutions. Contact him at simon.bramble@analog.com.
Related Content
- Optimizing high precision tilt/angle sensing: Accelerometer fundamentals
- Optimizing high precision tilt/angle sensing: Establishing baseline performance
- Optimizing high precision tilt/angle sensing: Enhancing performance
- Performing precision measurement with silicon temperature sensors
- Achieving accurate motion tracking in consumer portables
Subscribe to Embedded’s weekly newsletter for more embedded engineering insights.
Embedded
- How Additive Manufacturing Helped Van Damme Produce Custom Marshmallow Nozzles at a Fraction of the Cost
- Why Wafer‑Level Chip‑Scale Packaging is Essential for Next‑Gen Wearable SRAMs
- Building a Flexible, Multi‑Gigabit Campus Core for the Wi‑Fi 6 Era
- Cloud‑Enabled EDA: Accelerating Chip Innovation and Cost Efficiency
- Designing for Sustainability: Start with the End in Mind
- Optimizing Smart Factories: The Ideal Level for Efficiency and Organization
- A Heartfelt Farewell: My 40-Year Journey in Publishing
- Understanding the Spirit Level: A Key Tool for Precision in Construction
- Key Design Guidelines for Aviation & Aerospace PCBs: Reliability, Performance, and Compliance
- Key Design Guidelines for Aviation & Aerospace PCBs: Ensuring Reliability and Compliance