0% found this document useful (0 votes)
32 views

Arduino Project

Project report accelerometer using arduino uno 3

Uploaded by

Rupinder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Arduino Project

Project report accelerometer using arduino uno 3

Uploaded by

Rupinder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

SANT LONGOWAL INSTITUTE OF ENGINEERING AND TECHNOLOGY

Longowal-148106, Sangrur, Punjab

(Deemed to be University)

CANDIDATE’S DECLERATION

I hereby certify that the work, which is being presented in thesis, entitled “SEAT PAD
ACCELEROMETER DEVELOPMENT USING ARDUINO AND TRI-AXIS
ACCELEROMETER (ADXL335)” in partial fulfillment of requirement for the award of Bachelors ‘of
Technology (Mechanical Engineering) submitted in the Department of Mechanical Engineering at Sant
Longowal Institute of Engineering and Technology, Longowal, Punjab is an authentic record of my own
work carried out under the guidance of Dr. Vivek Kumar, Assistant Professor (ME).

Rupinder Singh (GME-2030774)

Abhishek Arya (GME-2030754)

Piyush Vashist (GME-2030744)

Parvinder Singh (GME-2030738)

Dr. Vivek Kumar

Assistant Professor (ME)

1
ACKNOWLEDGEMENT

I would like to express my gratitude to my supervisor Dr. Vivek Kumar for the useful comments, remarks
and engagement through the learning process of this project. Furthermore, I would like to thank Dr. Vivek
Kumar for introducing me to the topic as well for the support on the way.
In addition, I must express my very profound gratitude to my parents for providing me with unfailing
support and continuous encouragement throughout my years of study and through the process of
researching and building this project. This accomplishment would not have been possible without them.
Thank you.

Rupinder Singh (GME-2030774)

Abhishek Arya (GME-2030754)

Piyush Vashist (GME-2030744)

Parvinder Singh (GME-2030738)

2
ABSTRACT

The main function of the seat pad accelerometer is to measure the vibration in the X, Y and Z axis. the
sampling signals that measure real world physical conditions (voltage, current) and converting the
resulting samples into digital values that can be handled, for example, by a computer. This project is
developed to simple and cheap seat pad accelerometer for acquiring the accelerometer reading.

The main action of data acquisition systems fitted with seat pad accelerometers is the sampling signals
that measure real world physical conditions (voltage, current) and converting the resulting samples into
digital values that can be handled, for example, by a computer. This report describes the development of
a simple and easy data acquisition system intended for acquiring the MEMS accelerometer signal. The
system uses a Arduino board for converting analog signals to the digital one. This project focuses on
implementing the digital and analog components of such a device as well as to design the software
necessary for sampling, interpreting, visualizing and storing the signal. First two chapters will list project
aims and the problems to be solved and give an overview of some of the theories used during the
development of the measurement system.

KEYWORDS: Accelerometer, Seat pad, Vibrations, Data acquisition, Digital signal, Analog signal.

3
TABLE OF CONTENTS
Contents Page No.

Candidate’s Declaration 1

Acknowledgement 2

Abstract 3

Table of Contents 4

1. INTRODUCTION 5-6
1.1 SEAT PAD ACCELEROMETER 5
1.2 PROBLEM STATEMENT 6
2. THEORY 7
2.1 ACCELEROMTERS 7
2.2 ADXL335 7
3. ARDUINO STRUCTURE 8 - 10
4. ACCELEROMETER ADXL335 MODULE 11
5. ARDUINO AND ADXL335 CIRCUIT 13
6. ARDUINO PROGRAM 13 - 14
7. SEAT PAD ENCLOSURE OF ARDUINO AND ADXL335 15
8. STEADY STATE ACCELEROMTER GRAPH 16
9. CONCLUSION 17

4
INTRODUCTION

Seat pad accelerometers

The traditional approach to measuring the vibration at the seat cushion being delivered to the body is to
use seat pad accelerometers. Seat pad accelerometers are standardized in design . Seat pad accelerometers
are housed in a flexible disk in order to allow them to deform with the seat cushion and are fitted between
the occupant and the seat cushion. Seat pad accelerometers typically consist of a tri-axial piezoelectric
accelerometer Seat pad accelerometers serve the main purpose of providing a quantitative assessment of
ride quality and the dosage levels of vibrations. While using seat pad accelerometers, the APMS response
analysis will require units of force, so either an estimation of seat force will need to be performed or
additional force sensors will need to be included. Seat pad accelerometer sensors have been used to
provide measurements of the vibratory accelerations in 6-DOF. All studies that have used a single seat
pad transducer have measured the acceleration data for the purpose of assessing the dosage of vibration
and validating the performance of seating suspension systems. A force plate is often used to measure the
driving point force to the body system (between the seat and the thighs). The force input into the
biodynamic system can be used to calculate the DPMI and APMS. Thin film pressure sensors consist of
a variable resistor which is dependent on the force and these have been applied to provide a measure for
calculating the APMS response.

Triaxial ICP® seat pad accel., 100 mV/g, 0.5 to 1000 Hz, 5-ft integral cable, conforms to ISO 10326-1

▪ Sensitivity: (±10%)100 mV/g (10.2 mV/(m/s²))

▪ Measurement Range: ±10 g pk (±98 m/s² pk)

▪ Electrical Connector: Integral Cable

The price of the seat pad accelerometer is about to 2,00,000 Rupees.

5
Problem Statement

Aim of the project. To make seat pad accelerometer using Arduino and the ADXL335 Accelerometer.
That can sample three-axis analog accelerometer signal, visualize the data, perform preliminary Digital
Signal Processing (DSP) on the data and then store it on PC’s memory.

System requirements

• Low-cost. The data acquisition system is designed for academic purposes, especially for its use in
engineering university degrees. The reduced cost of parts that compose the system makes it affordable for
any student.

• Development based on basic knowledge. The theoretical design of the acquisition system has been
based on basic electrical/electronic engineering knowhow, as its design should be modified in future and
improved versions by Students. High-level elements, electronic designs or concepts have been avoided.

• User-friendly design. The interface with the user at both levels, hardware and software, has been
designed as much intuitive as possible in order to ease the initial experiences with the system.

• Finally, the following technical requirements were stated:

1. 500 Hz sampling rate per channel (at least).

2. reasonably for accelerometer ±3 g acceleration range.

Working of measurement System

The user will attach the accelerometer unit to a surface of the measurement object. A cable is connecting
the accelerometer unit to the laptop. From the laptop unit the user will operate the system and setup
measurements, view the data and save the data to files.

6
Theory

Accelerometers

An accelerometer is an instrument that senses the motion of a surface to which it is attached and produces
a signal that is proportional to this motion[14]. The accelerometer measures the change in motion, thus
the acceleration, of the surface or object it is attached to. Accelerometers can be built to measure
accelerations very precisely, which makes them able to measure everything from big motions down to
small vibrations. Accelerometers can be analog or digital. In the case of an analog accelerometer, it will
produce an electrical signal proportional to the motion. In the case of a digital accelerometer, the signal
can be read digitally via an interface such as SPI or I2C.

ADXL335

The ADXL335 is a complete 3-axis acceleration measurement system. The ADXL335 has a measurement
range of ±3 g minimum. It contains a polysilicon surface micromachined sensor and signal conditioning
circuitry to implement an open-loop acceleration measurement architecture. The output signals are analog
voltages that are proportional to acceleration. The accelerometer can measure the static acceleration of
gravity in tilt-sensing applications as well as dynamic acceleration resulting from motion, shock, or
vibration.

The ADXL335 is a so called MEMS (Micro-Electro Mechanical System) accelerometer. The sensor in
the ADXL335 is a polysilicon surface-micromachined sensor that is built on a silicon wafer. In the sensor
there is a proof mass called a seismic mass that is tethered to deflectable plates. When subjected to
acceleration the plates are deflected by the mass and this deflection is measured by a differential capacitor.
The differential capacitor is made of independently fixed plates and the plates that are connected to the
seismic mass. The fixed plates are driven by 180◦ out of phase square waves and when the plates are
deflected the differential capacitor gets unbalanced and gives an output signal of a square wave whose
amplitude is proportional to the acceleration.

By using demodulation techniques that are sensitive to the phase-magnitude and direction of the
acceleration can be determined. The signal is then amplified and taken through a 32 kW resistor and now
one signal for each axis is available. The user then sets the signal bandwidth of the device by adding a
capacitor. This filtering improves measurement resolution and helps prevent aliasing.

7
Arduino Structure

Arduino is an open-source electronics prototyping platform. It is based on the Atmel 8-bit AVR
microcontroller family that features functionalities like general-purpose I/O pins, serial communication,
3 timer/counters and a 10-bit analog to digital converter. Arduino started in 2005 as a project for students
at the Design Institute of Ivrea, Italy. It can be programmed using the Arduino IDE, a cross-platform
application written in java, with a language based on C. Instead of void main() the Arduino software
implements the void setup() function that is executed once on power-up, and void loop() that runs
continuously as long as the board is powered.

The Arduino hardware consists of a printed circuit board with a microcontroller (usually Atmel AVR),
analog input and output ports, a communication system for serial programming and communication, and
a 3.3 and 5 V power supply system. There is a great diversity of Arduino boards. Each of them has specific
characteristics. Table 3.1 shows the characteristics of four of the most commonly used models. Before
designing the data acquisition system, the characteristics that are to be

ATMega328 Analog to Digital Converter

The ATMega328 features a successive approximation ADC with 8-channels and 10-bit resolution
(±2LSB accuracy). This means that the output range is between 00000000 and 11111111 in binary (0 to
1023 in decimal). Therefore, the quantization error is 5V 2 10−1 = 4.88mV. Also, the ADC has an inherent
prescaler that generates a proper ADC clock frequency from the microcontroller’s clock signal. In order
to maintain 10-bit resolution, the ADC must use a clock signal between 50 and 200 kHz. Higher clock
frequencies result in faster samples but lower resolution.

The ADC contains a sample and hold circuit which ensures that the input voltage to the ADC is held at a
constant level during conversion. A block diagram of the ADC is shown in Figure 3.2.

The ADC has a separate analog supply voltage pin, AVCC. AVCC must not differ more than ±0.3V
from VCC.

The ADC converts an analog input voltage to a 10-bit digital value through successive approximation.
The minimum value represents GND and the maximum value represents the voltage on the AREF pin
minus 1 LSB. Optionally, AVCC or an internal 1.1V reference voltage may be connected to the AREF
pin by writing to the REFSn bits in the ADMUX register. The internal voltage reference may thus be
decoupled by an external capacitor at the AREF pin to improve noise immunity.

8
Figure 3.2: Analog to Digital Converter Block Schematic Operation

The analog input channel is selected by writing to the MUX bits in ADMUX. Any of the ADC input pins,
as well as GND and a _xed bandgap voltage reference, can be selected as single ended inputs to the ADC.

9
The ADC is enabled by setting the ADC Enable bit, ADEN in ADC Control and Status Register A
(ADCSRA.ADEN). Voltage reference and input channel selections will not go into e_ect until ADEN is
set.
The ADC does not consume power when ADEN is cleared, so it is recommended to switch on the ADC
before entering power saving sleep modes. The ADC generates a 10-bit result which is presented in the
ADC data registers, ADCH and ADCL.

The ADC has its own interrupt which can be triggered when a conversion completes. When ADC access
to the data registers is prohibited between reading of ADCH and ADCL, the interrupt will trigger even if
the result is lost. The operation modes of the ATMega328 ADC are single conversion, free running,
external interrupt request and timer/counter interrupt request modes.

Figure 3.3: ADC Auto Trigger Logic

10
Accelerometer ADXL335 Module

ADXL335 accelerometer measures ±3 g in three orthogonal axis labeled the X, Y and Z direction. It can
read in the range of 0.5 Hz to 1600 Hz for the X and Y axis while the Z axis has a range of 0.5 Hz to 550
Hz. However, The user selects the bandwidth of the accelerometer using the CX, CY , and CZ capacitors
at the XOUT , YOUT , and ZOUT pins. Bandwidths can be selected to suit the application.

Fig. 3.6 ADXL335(Accelerometer)

11
Arduino and ADXL335 circuit diagram

Figure 3.8: Connection Schematics

ADXL335 accelerometer module connection with Arduino uno is done by pin configuration table 3.6: In
all connections low capacitance cables are used.

Table 3.6:

Arduino Analog Input Pins Accelerometer Pin


0 ST
1 Z-OUT
2 Y-OUT
3 X-OUT
4 GND
5 VCC

12
Arduino Program

In software structure of this system there are two main parts, they are device layer and application layer.
The device layer is to drive hardware and the application layer is for the user for storing and visualizing
the accelerometer signal. For programming the microcontroller, integrated development environment
(IDE) provided by the Arduino platform is used. Arduino Nano _rmware is responsible for quantizing
accelerometer's analog signal for a given frequency and transferring the sampled values to laptop via serial
communication by using the (built in) UART module.

The Arduino program consisted of four functions. The function void setup() was executed once during
power up and was responsible for the initialization of the board. The function void loop() was repeatedly
called after the execution of void setup() for as long as the board was powered. SerialEvent() function
called when serial receiving data (start or stop command from GUI) is available. Finally, the interrupt
service routine defined by the macro ISR(ADC vect) responded to the Arduino ADC interrupt request (as
declared by the ADC vect argument) and performed the classification of the signal in real-time.

Setup() function of Arduino


This function initialized the serial interface of the board with a baud rate of 115200bps with 8 data bits 1
stop bit and no parity check. After serial connection established, sampling rate was received by function.
Then, the peripherals associated with the sampling of the accelerometer signal (i.e. the ADC and
timer/counter1) were initialized. The ADC was turned on, with a new conversion starting immediately
and with enabled interrupts. It was set to start each successive conversion every time the timer/counter1
Compare Match B event triggered. Its reference voltage was set to be external, i.e. by the Vref pin. The
timer/counter0 peripheral was set to run in CTC mode (Clear Timer on Compare match) and to use the
CPU clock signal, prescaled by 64 (250KHz). Any interrupts associated with timer/counter1 were
disabled, the initial counter value was set to zero and the Compare Match register was set to 82 in order
to trigger the ADC with a frequency of about 3KHz for three channels.

Loop() function of Arduino


The loop() function acted as the main loop of the program and was responsible for the transmitting of
converted digitized data. A adc Done ag, locked the execution in place until the ISR() function was called.
Then ADC value was sent through serial connection to a computer for further visualization and processing.
After transmitting the data, correct ADC multiplexer pin increment was done.

Arduino code used for data acquisition

const int groundpin = 18; // analog input pin 4 -- ground


const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = A3; // x-axis of the accelerometer
const int ypin = A2; // y-axis
const int zpin = A1; // z-axis (only on 3-axis models)
int xvalue;
int yvalue;
int zvalue;

13
void setup() {
Serial.begin(9600);

pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
}

void loop() {

xvalue = analogRead(xpin); //reads values from x-pin &


measures acceleration in X direction
int x = map(xvalue, 269, 401, -100, 100); //maps the extreme ends
analog values from -100 to 100 for our understanding
float xg = (float)x/(-100.00); //converts the mapped value
into acceleration in terms of "g"
Serial.print(xg); //prints value of
acceleration in X direction
Serial.print("g "); //prints "g"
yvalue = analogRead(ypin);
int y = map(yvalue, 267, 401, -100,100);
float yg = (float)y/(-100.00);
Serial.print("\t");
Serial.print(yg);
Serial.print("g ");

zvalue = analogRead(zpin);
int z = map(zvalue, 269, 402, -100, 100);
float zg = (float)z/(100.00);
Serial.print("\t");
Serial.print(zg);
Serial.println("g ");

delay(100);

14
Seat pad enclosure of Sensor and Arduino Board
The Adxl335 and the Arduino board are connected according to the circuit diagram above and are being
placed inside the seat pad which was made of nitrile rubber sheet. The sensor is placed exactly in the
center of the round seat pad, because it give most precise readings while placed in the center. The USB
cable which is connected to the Arduino board and other end is kept outside the seat pad for connecting
to the computer to get the readings.

(a.)

(b.)
Fig. 4.1 Seat pad accelerometer

15
Steady State Graph

The sensor is placed at a plane surface and steady surface there is no vibrations at all.
The sensor readings are as follows;

Fig. Graph-1

16
Conclusion

In this project work we proposed a simple and cost effective seat pad accelerometer using Arduino uno
and AXDl335 tri-axial accelerometer. It is a easy to use and low cost and the table shows the total cost to
make this accelerometer.

Sr. No. Accelerometer components Price(Rs)


1. Arduino Uno Board 1000
2. ADXL335 Accelerometer 800
3. Rubber Sheet 350

17
18
19

You might also like