
After learning about the MPU-6050 module and using it to measure tilt angle, the same principle can be put to work building a practical digital protractor that shows the angle of any surface it's placed on, either digitally on an LCD or mechanically through a pointer that sweeps over a printed protractor scale.
Components needed
An Arduino Uno board, an MPU-6050 module, a small servo motor with a printed or cut-out needle pointer, a printed paper protractor placed behind the pointer's path, and a 16x2 LCD screen.
Wiring it up
The MPU-6050 module connects to the I2C pins (A4 and A5) on the Arduino, the servo motor connects to a digital pin supporting PWM, and the LCD connects using the usual pins or via an I2C module.
How it works
The code reads raw acceleration values from the Y and Z axes on the MPU-6050, then converts them into an actual angle in degrees using a trigonometric function based on atan2() (the two-argument arctangent), which correctly handles all angles across the full 360-degree range, unlike the simpler atan() function. Once the angle is calculated, its numeric value is shown directly on the LCD, while the servo motor simultaneously rotates by that same angle, moving the printed pointer over a paper protractor placed behind it — producing a hybrid display that combines precise digital readout with the direct visual clarity of a traditional protractor.
You can find the MPU-6050 module and servo motors at Juthour Tech.
اترك تعليقا