Angle Measurement Device Using Arduino Nano & ADXL335

Building an Angle Measurement Device using an Arduino Nano is exciting and helpful in the world of DIY projects and electronics. An I2C LCD display, an ADXL335 accelerometer, and an Arduino Nano are three crucial parts of this project. These parts work together to create a small, accurate, and easy-to-use tool that can measure and show angles instantly anywhere.

This tool can be applied in many different fields, such as robotics and do-it-yourself projects where accurate tilt or inclination measurement is necessary. We’ll lead you through the entire process of building your angle measuring device in this post, including how to add a reset button to set it to zero degrees.

Angle Measurement Device Using Arduino Nano and ADXL335

Circuit Diagram

Angle Measurement Device Circuit Diagram

Components Required

  1. Arduino Nano
  2. ADXL335 Accelerometer
  3. I2C LCD Display (16×2)
  4. Push Button (Reset Switch)
  5. Breadboard and Jumper Wires
  6. Power Supply (USB cable or battery pack)

Understanding the Components

Arduino Nano

The Arduino Nano is a small, breadboard-friendly variant of the Arduino Uno. It offers similar functionality in a more compact package, making it perfect for this portable project. The Nano features:

  • ATmega328P microcontroller
  • 32KB of flash memory
  • 2KB of SRAM
  • 22 I/O pins (14 digital, 8 analog)
  • A mini-USB connector for programming and power

ADXL335 Accelerometer (GY-61)

The ADXL335 accelerometer measures acceleration in three axes: X, Y, and Z. It outputs Analog voltages proportional to the acceleration sensed by the sensor. This data can calculate the tilt angles relative to each axis. The ADXL335 features:

  • Measurement range: ±3 g
  • Low power consumption
  • Analog voltage outputs
  • Small size (4mm × 4mm × 1.45mm)

I2C LCD Display Module

An I2C LCD display simplifies the process of displaying data from the Arduino. Instead of using multiple pins, the I2C protocol uses two wires: SDA (data line) and SCL (clock line). The features include:

  • 16 characters by 2 lines
  • I2C interface using the PCF8574 I/O expander
  • Adjustable contrast via a potentiometer
  • Backlight control

Circuit Diagram and Connections

Here is how to connect each component:

Connecting the ADXL335 Accelerometer

  • VCC to 3.3V on Arduino Nano
  • GND to GND on Arduino Nano
  • X to A7 on Arduino Nano
  • Y to A6 on Arduino Nano
  • Z to A3 on Arduino Nano

Connecting the I2C LCD Display

  • VCC to 5V on Arduino Nano
  • GND to GND on Arduino Nano
  • SDA to A4 on Arduino Nano
  • SCL to A5 on Arduino Nano

Connecting the Reset Switch

  • One terminal to GND
  • Another terminal to D7 (digital pin 7) on Arduino Nano

Uploading the Code

Installing Necessary Libraries

Before diving into the code, make sure you have the necessary libraries installed. You will need:

You can install these libraries through the Arduino IDE Library Manager by navigating to Sketch > Include Library > Manage Libraries and searching for the library names.

The code will read analog values from the ADXL335 accelerometer, convert these values into angles, and display them on the I2C LCD display. It also includes functionality to reset the angle measurements using a push button.

Calibrating Angle Measurement Device

Calibration is a critical step to ensure accurate angle measurements. Follow these steps to calibrate your device:

  • Place the device on a flat, level surface.
  • Press the reset button to set the current position as 0 degrees.
  • The calibration process resets the baseline values for the X, Y, and Z axes to zero, allowing the device to measure angles accurately from this reference point.

Testing the Angle Measurement Device

Power Up the Device: Connect the Arduino Nano to a USB power source or a battery pack.

Observe Readings: The I2C LCD will display the angle measurements for the X, Y, and Z axes in real time.

Tilt the Device: Move the device in different directions and observe the corresponding changes in angle on the LCD display.

Applications and Further Enhancements

Applications

This angle measurement device can be used in a variety of applications, including:

Robotics: To measure the tilt of a robotic arm or platform.

DIY Projects: As an inclinometer for various home improvement tasks.

Gadget Building: To create custom gadgets that require tilt sensing.

Possible Enhancements

Wireless Communication: Add a Bluetooth or Wi-Fi module to transmit angle data wirelessly.

Data Logging: Store angle data on an SD card for further analysis.

Advanced Calibration: Implement a more sophisticated calibration process to improve accuracy.

Video Output

Conclusion

Building an angle measurement device using an Arduino Nano and ADXL335 accelerometer is an excellent project for learning about accelerometers and microcontrollers. With the added reset switch, you can easily calibrate the device to ensure accurate measurements. This project can be expanded and modified for various applications, making it a versatile and practical tool in your electronics toolkit.

Leave a Comment