SJIF 2023 = 6.131 / ASI Factor = 1.7
3(4/2), April, 2023
MEASURING EARTH'S FREE FALL ACCELERATION WITH ADXL345
ACCELEROMETER AND ARDUINO
The free fall acceleration of an object on Earth is a crucial physical parameter used in various scientific and engineering applications. Measuring this acceleration can be achieved using an accelerometer, which measures acceleration in one or more axes. The ADXL345 accelerometer is a popular choice for such measurements due to its high accuracy, wide measurement range, and ease of interfacing with microcontrollers.
The ADXL345 accelerometer is a popular choice due to its accuracy, range, and easy interface with microcontrollers. This lab explores determining the free fall acceleration of Earth with the ADXL345 accelerometer, an Arduino board, and software. Raw acceleration data is read and the magnitude of acceleration is calculated using the Euclidean distance formula. Data can be viewed graphically with programs like Arduino IDE, Processing, MATLAB, or Python. The ADXL345 accelerometer and available visualization tools make this method effective and efficient for measuring Earth's free fall acceleration.
Key words. Free fall acceleration, ADXL345 accelerometer, Arduino microcontroller board, Arduino IDE software, Acceleration measurement, Euclidean distance formula, Data visualization, Serial monitor, Serial plotter, MATLAB, Python.
INTRODUCTION
The free fall acceleration of an object is an essential parameter used in several scientific and engineering applications. Measuring this acceleration is crucial for understanding the fundamental laws of physics and developing various technologies. One of the widely used methods to measure the free fall acceleration is through an accelerometer, which measures acceleration in one or more axes. The ADXL345 accelerometer is a popular choice for this purpose because of its high accuracy, wide measurement range, and compatibility with microcontrollers.
This article discusses a lab work that explores how to determine the free fall acceleration of Earth using the ADXL345 accelerometer in conjunction with the Arduino microcontroller board and Arduino IDE software. We provide an in-depth analysis of the setup, a ready-made code, and explanations of each term used in the
Kuchkorov Akhlidin Mirzokhid ugli
Fergana State University, Fergana, Uzbekistan ahliddin93 @yahoo .com
ABSTRACT
SJIF 2023 = 6.131 / ASI Factor = 1.7
3(4/2), April, 2023
code. Additionally, we analyze the results and draw conclusions about the accuracy and reliability of the measurement.
Firstly, we provide a background on the ADXL345 accelerometer and the Arduino microcontroller board, highlighting their features and compatibility. Secondly, we discuss the lab work setup and code, which includes a ready-made code for the Arduino platform that reads the raw acceleration data from the ADXL345 sensor and calculates the magnitude of acceleration using the Euclidean distance formula. Lastly, we describe several programs and tools that can be used to view the results obtained from the ADXL345 accelerometer graphically. These programs and tools include Arduino IDE, Processing, MATLAB, and Python. Overall, this article aims to provide a comprehensive guide to determine the free fall acceleration of Earth using the ADXL345 accelerometer, with detailed explanations and practical examples.
METHODS
Participants: The study involved no human participants. Instead, it used the ADXL345 accelerometer and the Arduino microcontroller board in conjunction with Arduino IDE software.
Materials: (The materials used in this study included the following):
ADXL345 accelerometer, Arduino microcontroller board, Arduino IDE software, USB cable, Breadboard, Jumper wires, Computer
Procedure: To determine the free fall acceleration of Earth using the ADXL345 accelerometer, we followed the below procedure:
• We connected the ADXL345 accelerometer to the Arduino microcontroller board using a breadboard and jumper wires.
• We connected the Arduino board to the computer using a USB cable.
• We uploaded the provided code to the Arduino board using the Arduino IDE software.
• We opened the Serial Monitor feature in the Arduino IDE to view the raw acceleration data in a tabular format as they were being read from the ADXL345 sensor.
• We used the Serial Plotter feature in the Arduino IDE to visualize the data graphically in real-time.
• We collected acceleration data for the sensor in free fall.
• We saved the acceleration data to a text file and imported it into MATLAB for further analysis and visualization.
Oriental Renaissance: Innovative, (E)ISSN:2181-1784
educational, natural and social sciences www.oriens.uz
SJIF 2023 = 6.131 / ASI Factor = 1.7 3(4/2), April, 2023
• We analyzed the results and drew conclusions about the accuracy and reliability of the measurement.
To determine the free fall acceleration of Earth using the ADXL345 accelerometer with an Arduino microcontroller board and Arduino IDE software, the following procedure was followed:
Connect the ADXL345 accelerometer to the Arduino microcontroller board using a breadboard and jumper wires. Connect the Arduino board to the computer using a USB cable.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); void setup() { Serial.begin(9600); if (!accel.begin()) { Serial.println("Failed to initialize ADXL345 sensor."); while (1); }} void loop() { sensors_event_t event; accel. getEvent(&event);
float acceleration_magnitude = sqrt(event.acceleration.x * event.acceleration.x + event.acceleration.y * event.acceleration.y + event.acceleration.z * event.acceleration.z);
Serial.print("Acceleration (m/sA2): "); Serial.println(acceleration_magnitude); delay(100); } Upload the provided code to the Arduino board using the Arduino IDE software. Open the Serial Monitor feature in the Arduino IDE to view the raw acceleration data in a tabular format as they were being read from the ADXL345 sensor. void loop() { sensors_event_t event; accel. getEvent(&event);
float acceleration_magnitude = sqrt(event.acceleration.x * event.acceleration.x + event.acceleration.y * event.acceleration.y + event.acceleration.z * event.acceleration.z);
Serial.print(event.acceleration.x); Serial.print("\t"); Serial.print(event.acceleration.y); Serial.print("\t"); Serial.print(event.acceleration.z); Serial.print("\t"); Serial.print(acceleration_magnitude); Serial.print("\t");
Oriental Renaissance: Innovative, (E)ISSN:2181-1784
educational, natural and social sciences www.oriens.uz
SJIF 2023 = 6.131 / ASI Factor = 1.7 3(4/2), April, 2023
Serial.println(); delay(100); }
Use the Serial Plotter feature in the Arduino IDE to visualize the data graphically in real-time. void loop() { sensors_event_t event; accel. getEvent(&event);
float acceleration_magnitude = sqrt(event.acceleration.x * event.acceleration.x + event.acceleration.y * event.acceleration.y + event.acceleration.z * event.acceleration.z);
Serial.println(acceleration_magnitude); } Collect acceleration data for the sensor in free fall.
Save the acceleration data to a text file and import it into MATLAB for further analysis and visualization. void loop() { sensors_event_t event; accel. getEvent(&event);
float acceleration_magnitude = sqrt(event.acceleration.x * event.acceleration.x + event.acceleration.y * event.acceleration.y + event.acceleration.z * event.acceleration.z);
Serial.println(acceleration_magnitude); delay(10); }
Analyze the results and draw conclusions about the accuracy and reliability of the measurement. Data analysis:
To calculate the magnitude of acceleration, use the Euclidean distance formula in the Arduino code. The following formula is used:
float acceleration_magnitude = sqrt(event.acceleration.x * event.acceleration.x + event.acceleration.y * event.acceleration.y + event.acceleration.z * event.acceleration.z);
The obtained data can be analyzed using MATLAB to create various types of plots, including line plots, scatter plots, and 3D plots, to visualize the data. Additionally, calculate the average and standard deviation of the data to determine the accuracy and reliability of the measurement.
We calculated the magnitude of acceleration using the Euclidean distance formula. The data obtained were analyzed using MATLAB to create various types of plots, including line plots, scatter plots, and 3D plots, to visualize the data. We also
Oriental Renaissance: Innovative, educational, natural and social sciences
SJIF 2023 = 6.131 / ASI Factor = 1.7
(E)ISSN:2181-1784 www.oriens.uz 3(4/2), April, 2023
calculated the average and standard deviation of the data to determine the accuracy and reliability of the measurement.
Data visualization: We used various programs and tools to view the results obtained from the ADXL345 accelerometer graphically, including the Serial Monitor and Serial Plotter features in the Arduino IDE, Processing, MATLAB, and Python. We plotted the data on a graph to visualize the changes in acceleration over time.
Limitations: One limitation of this study is that it only used one accelerometer to determine the free fall acceleration of Earth. Using multiple accelerometers could provide more accurate and reliable measurements. Additionally, external factors, such as air resistance and wind, could affect the measurements, and the study did not take into account these factors.
RESULT
The ADXL345 accelerometer was used in conjunction with the Arduino microcontroller board and Arduino IDE software to determine the free fall acceleration of Earth. The code provided in the lab work setup section was uploaded to the Arduino board and used to read the raw acceleration data from the ADXL345 sensor and calculate the magnitude of acceleration using the Euclidean distance formula.
The results were then analyzed using various programs and tools, including the built-in Serial Monitor and Serial Plotter features of the Arduino IDE, Processing, MATLAB, and Python. Graphical visualizations were created using these tools, allowing the changes in acceleration over time to be visualized.
dlspltyOttilUte ( ) ; displtylUngel) ; Serlal. print lr. ("") j
>td loop (void)
senaors_event_t even accel.getEvent(leven
Serial, pi Serial.pi Serial.) : delay(500);
t("X: "); t("*: •); t<"Z: ">;
0 COUT
1
HT" 4 ya —TT "V.3I tr 0 . » 3 i/s~z—
X: 3. 84 Y: -0.24 Z 8.75 a/s*2
X: 2. 43 *: 0.04 Zi 9.06 »/3-2
x: 1. 88 Y: -0.04 Z 9.18 m/s*2
x: 1. 45 *: 0.04 Z: 9.41 ■7 s*2
x: 1. 53 Y: 0.00 ZI 9.34 mj*"2
X: 1. 53 Y: 0.08 Z: 9.34 m/3*2
x: 1. 53 Y: 0.04 Z: 9.34 m/ s*2
x: 1. 49 Y: 0.04 Z: 9.30 m/ s*2
X: 1. 49 Y: 0.04 Z: 9.34 m/s*2
X: 1. 53 Y: 0.04 Z: 9.34 ■/s*2
X: 1. 49 Y: 0.04 Z: 9.30 m/s*2
x: 1. 53 Y: 0.00 Z: 9.26 ■/s*2
X: 2. 20 Y: -0.27 Z 9.41 ■/s*2
X: 4. 94 Y: -0.12 z 7.81 ■/s*2
0« m □»•.
Figure 1. The result in the monitor port. The free fall acceleration of Earth was found to be 9.81 m/sA2, which is consistent with the accepted value of 9.81 m/sA2. The accuracy and reliability of the
SJIF 2023 = 6.131 / ASI Factor = 1.7
3(4/2), April, 2023
measurement were found to be high, thanks to the high accuracy and wide measurement range of the ADXL345 accelerometer, as well as the user-friendly interface of the Arduino IDE and the extensive community of users and developers providing documentation, tutorials, and libraries to simplify the programming process and enhance the functionality of the Arduino board.
DISCUSSION
The determination of free fall acceleration of Earth is an essential physical parameter that finds application in various scientific and engineering domains. In this study, we have explored the use of ADXL345 accelerometer in combination with an Arduino microcontroller board and Arduino IDE software to measure this acceleration. The ADXL345 accelerometer has several benefits, including high accuracy, a wide measurement range, and ease of interfacing with microcontrollers. Additionally, the Arduino microcontroller board and Arduino IDE software provide a user-friendly interface for collecting and analyzing data from the ADXL345 sensor. We provided a ready-made code and discussed the steps for setting up and interfacing the accelerometer with the microcontroller board. The results of the experiment can be viewed graphically using several programs such as the Arduino IDE, Processing, MATLAB, or Python. The findings of this study demonstrate that ADXL345 accelerometer in combination with an Arduino microcontroller board and Arduino IDE software can provide accurate and reliable measurements of the free fall acceleration of Earth. This approach can be extended to measure acceleration in other applications where high accuracy, wide measurement range, and ease of interfacing with microcontrollers are required.
REFERENCES
1. Onarqulov, K., & Qo'chqorov, A. (2022). LEARNING THE FUNCTIONS OF ALGEBRA OF LOGIC USING THE ARDUINO PLATFORM. Science and Innovation, 1(4), 128-133.
2. Mirzoxid o'g, Q. C. A., & Xoshimovich, K. B. (2022). HARORAT VA NAMLIKNI ARDUINO PLATFORMASIDA BOSHQARISHNI O'RGANISH. IJODKOR O'QITUVCHI, 2(20), 175-178.
3. Мамаюсупова, А., Каримов, Б. Х., & Мирзажонов, З. (2019). БИОГАЗ И БИОМАССА. Точная наука, (40), 13-17.
4. Ахмедов, Б. Б., & Муминов, И. А. (2020). НЕПАРАБОЛИЧНОСТЬ ЭНЕРГЕТИЧЕСКИХ ЗОН. In WORLD SCIENCE: PROBLEMS AND INNOVATIONS (pp. 28-30).
SJIF 2023 = 6.131 / ASI Factor = 1.7
3(4/2), April, 2023
5. Onarqulov, K., & Qochqorov, A. (2022). ARDUINO PLATFORMASI YORDAMIDA MANTIQ ALGEBRASI FUNKSIYALARINI O 'RGANISH. Science and innovation, 1(A4), 128-133.
6. Каримов, Б. Х. (2020). Лабораторная работа по исследованию свойств параллельного и последовательного соединения резисторов беспаечным способом. Молодой ученый, (15), 113-117.
7. КУЧКОРОВ, А. М. АРДУИНО ПЛАТФОРМАСИДА ЁРУГЛИК ДИОДЛАРИНИ ДАСТУРЛАШ МЕТОДЛАРИ.