IncliSense: Precision-Engineered Dual-Axis Digital Level

by FA24-EEE-014 in Circuits > Electronics

1181 Views, 8 Favorites, 0 Comments

IncliSense: Precision-Engineered Dual-Axis Digital Level

Top View Edited 1X.png

Meet IncliSense, an advanced digital leveling machine engineered to replace the guesswork of traditional spirit levels with absolute mathematical certainty.

For decades, professionals and makers have relied on standard bubble levels, which depend entirely on subjective visual estimates. This opens the door to human error, parallax distortion, and costly mistakes in precision fields like engineering, construction, and machine calibration. When a fraction of a degree determines the structural integrity or functional success of a project, a simple bubble is no longer sufficient.

I built IncliSense to eliminate these vulnerabilities. Powered by a highly sensitive MPU6050 6-axis accelerometer and gyroscope, this device continuously monitors gravitational pull and spatial orientation. It processes raw multi-axis data in real-time, calculating exact pitch and roll angles to provide pinpoint numerical accuracy instead of a vague visual estimation.

This project bridges the gap between standard electronics and professional-grade measurement equipment. By harnessing modern MEMS (Micro-Electro-Mechanical Systems) technology, IncliSense proves that high-end, reliable precision can be built efficiently and accurately from scratch.

Supplies

Component.png
Instruments.png

1. Principal Computing & Sensing

  1. Microcontroller: Arduino Nano (Atmega328P) – Chosen for its high number of digital I/O pins and small footprint, allowing it to fit inside the slim, 3D-printed body while controlling all 11 LEDs and the sensor simultaneously.
  2. Motion Processing Unit: MPU6050 (6-Axis) – An integrated 3-axis Accelerometer and 3-axis Gyroscope. This is the "heart" of the project, using MEMS technology to detect gravity vectors and provide precise tilt data.

2. Visual and Audio Feedback System

  1. 11x High-Intensity LEDs: These serve as the user interface. They are mounted directly into the enclosure's faceplate to provide a vertical "gradient" level scale.
  2. 5V Active Piezo Buzzer: Provides a high-frequency audible "Level-Lock" signal. This allows the user to know they have achieved a perfect $0^\circ$ level without having to look at the device.

3. Power Management System

  1. 2x 3.7V Lithium Batteries: Wired in series to create a 7.4V Power Pack. This provides sufficient voltage to the Arduino's internal regulator, ensuring the sensor and all 11 LEDs remain bright and accurate throughout the measurement session.
  2. Tactile Push Button Switch: A robust, panel-mounted button that controls the primary power rail. It allows for quick activation and ensures no power is wasted when the tool is stored in a workspace.

4. Structural & Interconnect Materials

  1. Industrial-Grade 3D-Printed Enclosure: A custom-designed, long-form housing. It was printed with high wall thickness to prevent warping, ensuring the base remains a mathematically flat reference plane.
  2. Direct-Pin Wiring (Point-to-Point): Using multi-strand insulated copper wires, the components are soldered directly to the Arduino Nano. This "no-PCB" approach was used to keep the internal assembly thin and lightweight.
  3. Insulation & Protection: Heat-shrink tubing and electrical tape were used to insulate the direct-soldered joints, preventing short circuits within the compact housing.
  4. High-Strength Adhesive: Used to fix the MPU6050 sensor firmly to the base. It is critical that the sensor cannot shift or vibrate, as this would compromise the accuracy of the leveling readings.

5. Software & Development Tools

  1. Arduino IDE (C++): The environment used to write the custom processing logic, including the trigonometry required to convert raw MPU6050 data into degrees of inclination.
  2. Precision Soldering Station: Used for all electrical connections. Because this project lacks a breadboard or perfboard, high-quality solder joints were essential for structural integrity.
  3. Digital Multimeter: Used during the build to verify the 7.4V battery output and ensure there was no continuity loss between the Nano and the 11-LED array.

Enclosure Design

View 1 of 3D Model.png
View 3 of 3D Model.png
View 2 of 3D Model.png

Title:CAD Engineering in Fusion 360

The first phase of the project was the creation of a custom industrial-grade housing for IncliSense. Since accuracy is the primary goal, the enclosure was designed with a precision-flat base to ensure the internal sensor readings perfectly match the physical surface being measured.

  1. Fusion 360 Workflow:
  2. Sketching: I began by sketching a long-form rectangular profile to mimic the ergonomics of a professional carpenter's level, providing a stable grip and large surface area for contact.
  3. Parametric Hole Alignment: Using the Rectangular Pattern tool in Fusion 360, I created 11 perfectly spaced circular cutouts on the top face. This ensures that the LED feedback array is mathematically centered and aligned for intuitive user readings.
  4. Internal Cavity & Shelling: I utilized the Shell command to create a hollow internal compartment for the Arduino Nano and battery pack. I specified a thick wall setting to provide maximum structural rigidity and prevent any warping of the base, which is critical for a calibration tool.
  5. Component Clearances: Dedicated mounting slots were extruded and "cut" into the model for the Push Button and Buzzer to ensure a flush, professional fit on the exterior surface once assembled.


3D Printing & Material Selection

After the design phase in Fusion 360, I moved to the physical fabrication of the IncliSense body. Choosing the right material was critical for a tool intended for precision measurement.

  1. Material Choice (ABS): I selected ABS (Acrylonitrile Butadiene Styrene) filament for the enclosure instead of standard PLA. ABS was chosen for its superior impact resistance and thermal stability. This ensures that the tool can withstand the rigors of a construction site and won't warp if left in a hot vehicle or under direct sunlight, preserving the accuracy of the base.
  2. Printing Parameters:
  3. Infill: 40% Gyroid infill for maximum structural rigidity. This high infill prevents the base from flexing, which is essential for consistent sensor readings.
  4. Enclosure & Temperature: To prevent warping, the print was performed in a heated enclosure with a high bed temperature and high nozzle temperature tailored for ABS.
  5. Post-Processing: Once the print was complete, I verified the flatness of the base using a machinist's straight edge. The result was a lightweight yet extremely durable industrial shell ready for component integration.


Electronic Integration & System Interfacing

Circut Design.png

Title: Circuit Architecture and Component Interfacing

The second phase involved the assembly of the "IncliSense" brain and its feedback systems. To maintain a slim profile and ensure structural integrity within the 3D-printed case, I opted for a Direct-Wiring (Point-to-Point) approach instead of using a traditional PCB or breadboard.

  1. Logic Processing: I programmed the Arduino Nano to act as the central hub. It communicates with the MPU6050 sensor via the I2C protocol ($SDA$ and $SCL$ pins) to pull real-time orientation data.
  2. The 11-LED Array: I soldered 11 individual insulated copper wires from the digital output pins of the Nano directly to the anodes of the LEDs mounted in the enclosure. This configuration allows the code to control each LED independently, creating a "moving light" effect that correlates to the tilt of the device.
  3. Audio Feedback: A 5V Active Buzzer was wired to a dedicated digital pin. I programmed the logic to trigger a continuous tone only when the MPU6050 detects a $0^\circ$ level state, providing the user with an eyes-free "Level-Lock" notification.
  4. Power System: To make the device portable, I wired two 3.7V batteries in series, creating a $7.4V$ power supply. This was connected to the Arduino's $VIN$ pin through a Push Button switch. The button serves as the primary power toggle, allowing the user to activate the sensor only when a measurement is required, maximizing battery efficiency.


Component Mounting & Soldering

Internal Picture of digital leveling machine.jpeg


This stage involved the transition from a conceptual circuit to a rugged, field-ready tool. Because IncliSense is designed for physical use in construction or engineering environments, the internal assembly had to be vibration-resistant and compact.

  1. LED Array Installation: I manually seated each of the 11 LEDs into the custom-fit apertures on the 3D-printed faceplate. Since the holes were designed with tight tolerances in Fusion 360, the LEDs are held in place via friction, ensuring a flush and professional exterior finish.
  2. Direct-Point Soldering: To keep the device slim, I avoided using a bulky PCB. Instead, I performed point-to-point soldering:
  3. Anodes: Each LED anode was soldered to a specific digital pin on the Arduino Nano (pins D2 through D12).
  4. Common Cathode: I created a single "Ground Rail" by soldering all 11 LED cathodes together with a solid copper wire, which then connects to the Nano's GND pin.
  5. Sensor Alignment: The MPU6050 was the most critical component to mount. I used high-strength adhesive to fix it to the internal base of the enclosure. Using a physical spirit level as a reference, I ensured the sensor board was perfectly parallel to the external flat bottom of the 3D print.
  6. Power & Switching: I soldered the 2x 3.7V batteries in series and integrated the Push Button on the positive line. All exposed joints were insulated with heat-shrink tubing to prevent short circuits within the tight internal cavity.
  7. Buzzer Integration: The active buzzer was mounted near the top of the casing, soldered directly to the Nano, and secured with a dab of hot glue to ensure the sound resonates clearly through the enclosure.

Programming and Calibration Logic


Title: Firmware Implementation and Sensor Calibration

This final phase focused on writing the custom logic to translate raw sensor data into intuitive visual and audio feedback.

  1. Logic Processing: I programmed the Arduino Nano to poll the MPU6050 via the I2C protocol. The raw accelerometer data is processed to determine the precise gravity vector relative to the device's orientation.
  2. Angle Calculation: I implemented a trigonometric formula to convert raw axis values into a pitch angle:
  3. $$Pitch = \arctan(Y / \sqrt{X^2 + Z^2}) \times \frac{180}{\pi}$$
  4. Visual Mapping: I created an algorithm that maps specific angle ranges to the 11-LED array. As the device tilts, the "active" LED shifts along the column, providing a real-time visual representation of the surface slope.
  5. Audible "Level-Lock": I programmed a high-precision threshold $(pm 5^\circ)$. When this range is reached, the code triggers the Buzzer for a continuous tone, allowing for "eyes-free" leveling.
  6. Precision Calibration: To ensure industrial accuracy, I included a software offset. By placing IncliSense on a verified level surface, I used the code to "zero out" any physical sensor misalignment, ensuring perfect reliability.


Programming and Multi-Axis Logic

Title: Firmware Implementation & Sensor Data Processing

The final phase of the project involved developing the custom C++ code to translate raw motion data into an intuitive, multi-axis visual display. The code is designed to handle both X (Left/Right) and Y (Front/Back) tilt simultaneously.

  1. Libraries and Communication: I used the Wire.h library to establish I2C communication between the Arduino Nano and the MPU6050. The sensor is initialized and tested in the setup() function to ensure a stable connection before the tool begins operation.
  2. Tilt Calculation: To determine the exact inclination, the code reads raw acceleration data $(\text{ax, ay, az})$ and utilizes the atan2 trigonometric function. This converts the gravitational vectors into degrees for both axes:
  3. X-Axis (Pitch): atan2(ax, az) * 180.0 / PI
  4. Y-Axis (Roll): atan2(ay, az) * 180.0 / PI
  5. Dual-Axis LED Control:
  6. The Center Lock: If both the X and Y angles are within a high-precision range of $\pm 5^\circ$, the center LED is triggered and the Buzzer sounds, indicating a perfect level.
  7. X-Axis (Left/Right): Six dedicated LEDs track side-to-side tilt. The logic is tiered: slight tilts $(\pm 5^\circ \text{ to } 20^\circ)$ light up the inner LEDs, while steeper tilts $(\pm 30^\circ+)$ trigger the outer LEDs.
  8. Y-Axis (Front/Back): The remaining center-row LEDs provide feedback for front and back inclination, ensuring the user can level the surface in two dimensions at once.
  9. System Stability: To ensure a clean user interface, I included a clearAllLEDs() function at the start of every loop. This prevents "ghosting" or multiple LEDs staying on at once, ensuring that only the LED representing the current angle is active. A $100\text{ms}$ delay was added to smooth out the sensor jitter for a steady visual output.


Testing, Accuracy, and Final Results


Title: Validation and Performance Analysis

The final phase of the project was rigorous testing to ensure that the digital output of IncliSense matched the physical reality of the surfaces being measured.

  1. Side-by-Side Comparison: I tested the device against a high-quality professional spirit level. By placing both tools on various inclined surfaces, I verified that the LED "bubble" on IncliSense moved in perfect synchronization with the physical bubble of the traditional level.
  2. Accuracy Thresholds: Using the Serial Monitor for data logging, I confirmed that the MPU6050 sensor, once calibrated, maintains an accuracy of within $\pm 0.5^\circ$. The "Level-Lock" buzzer triggers consistently at the zero-point, providing a reliable audible cue that eliminates the need for visual guesswork.
  3. Stability and Noise Reduction: Thanks to the digital filtering in the code and the structural rigidity of the ABS housing, the readings remain stable even when the device is placed on vibrating surfaces (such as a running workbench or machinery).
  4. Portability and Power: The $7.4V$ series battery configuration provided over 5 hours of continuous runtime during testing. The Push Button proved essential for quick-check measurements, allowing for instant-on functionality without draining the cells during downtime.