2026-07-28ยท4 min read
IoT & Embedded

From Sensor to Screen: ESP32-Based Vehicle Alignment System with ADS1115 & MPU6050

#IoT#ESP32#ADS1115#MPU6050#React

One of the most in-depth embedded-systems research projects I worked on at Universitas Brawijaya was designing a microcontroller-based vehicle alignment (toe and camber) simulation system using the ESP32.

The system combines an MPU6050 accelerometer and gyroscope sensor for spatial orientation angles with an ADS1115 module (16-bit I2C ADC) for reading linear potentiometer voltage with millimeter precision.

The biggest challenge was filtering mechanical vibration noise while the sensors read dynamic angles. By applying a simple complementary filter on the microcontroller, the data sent via Wi-Fi/MQTT to the React dashboard became highly stable and responsive without lag.

TECHNICAL CODE (CPP)
PRODUCTION READY
// Kalkulasi Sudut Camber menggunakan ESP32 & MPU6050
#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_ADS1X15.h>

Adafruit_MPU6050 mpu;
Adafruit_ADS1115 ads;

float calculateCamberAngle() {
  sensors_event_t a, g, temp;
  mpu.getEvent(&a, &g, &temp);
  
  // Hitung sudut kemiringan vertikal (Roll/Camber)
  float roll = atan2(a.acceleration.y, a.acceleration.z) * 180.0 / PI;
  return roll;
}
TECHNICAL NOTE:Use the external 16-bit ADS1115 ADC instead of the ESP32 internal ADC to avoid voltage non-linearity below 0.5V and above 2.8V.
๐Ÿš€

Rizky Mardhani

Computer Engineering ยท FILKOM Universitas Brawijaya