This project is about a simple inclinometer featuring auto rotation of display.
This inclinometer can be rotated in any position keeping the digits readable even upside down!
It is controlled by an Arduino 101 driven by accelerometers to read the tilt angle of X-Y axes.
Additionally, there is a feature to show the ambient temperature in Celsius or in Fahrenheit degrees.
The assemble is very simple and I hope you have fun using it!
Step 1: Material List
This version of the Arduino is no longer produced despite having interesting features such as temperature sensor, 6-axis accelerometer, gyroscope, temperature sensor and bluetooth on board.
It is very useful for this project avoiding an external MPU.
Multi-Function Shield (MFD):
The MFD can simplify and speed up the prototype development.
- 4 digit 7-segment LED display module driven by two serial 74HC595's
- 4 x surface mount LED's in a parallel configuration
- 10K adjustable precision potentiometer
- 3 x independent push buttons
- Piezo buzzer
- DS18B20 temperature sensor interface
- LM35 temperature sensor interface
- Infrared receiver interface
- Serial interface header for convenient connection to serial modules such as Bluetooth, wireless interface, voice module, a voice recognition module, etc.
Step 2: Assembly
The assembly is very simple and it is not necessary any schematics.
Just insert the multi-function shield into Arduino taking care with the pinouts to avoid any demage during insertion.
Note: This project can be updated to any Arduino model using an external MPU-6050 breakout.
Step 3: Setup
There are 3 buttons to setup the inclinometer:
- Left button: Select the working mode.
a) Auto axis - In this mode, the axis (X or Y) to measure the inclination degrees is selected automatically by the internal gyroscope.
b) X-Axis - Show only the angles of axis X.
c) Y-Axis - Show only the angles of axis Y.
d) Temperature - Show the ambient temperature in Celsius or Fahrenheit.
- Center button: Set the zero degree reference of X and Y axis. When Temperature Mode is selected, this button set the temperature scale (ºC or ºF).
- Right button: Reset the reference of axis to original angles.
The X-axis is indicated in the display by the char "=" and the Y-axis by the char "| |".
The range of angles for tilt reading is -90° to + 90°.
Step 4: Transfer Function
The main functions of code are:
- Reading of accelerometers inclination angles.
- Calculation of the transfer function of upside down effect for the 7-seg LED display.
With the angles is possible to detect the spacial position of the device to decide what routine will be released:
- Front View - Inclinometer Stand Up
- Front View - Inclinometer Upside Down
The transfer function for the display of 7-seg (A to F) works as follows:
A to D, B to E, C to F, D to A, E to B, F to C, G to G
To complete the upside down effect is necessary to invert the sequence of characters on the display:
From: 1, 2, 3, 4
To: 4, 3, 2, 1
Step 5: The Code
For another version of Arduino, some code update is required and also use an external breakout of the MPU-6050 for accelerometers.