Accelerometer ADXL327 Sensor Communication with Arduino

This blog will demonstrate how to connect accelerometer sensor with arduino boards (Arduino UNO here) and communicate with them. In this tutorial, I am using ADXL327 which is an acclerometer manufactured by Analog Devices. The ADXL327 is a  3-axis accelerometer with signal conditioned voltage outputs. It’s output is an Analog voltage which is proportional to the acceleration.

Before going further, I am assuming that you have already gone through the Arduino Basics and familiar with programming Arduino boards using Arduino IDE.

If not, go through my previous blogs Arduino Basics and LED Blinking on Arduino.

Making ADXL327 Sensor Connection with Arduino Pins

Below is the pin out of ADXL327 sensor

ADXL327.png

Below connection has to be done between ADXL327 and Arduino Board

Pin 3, 5, 6, 7 (COM) of ADXL327 should be connected with GND pin on Arduino Board

Pin 14, 15 (Vs) of ADXL327 should be connected with 3.3v on Arduino Board

Pin 8 (Zout) of ADXL327 should be connected with A3 on Arduino Board

Pin 10 (Yout) of ADXL327 should be connected with A2 on Arduino Board

Pin 12 (Xout) of ADXL327 should be connected with A1 on Arduino Board

p.s. Make sure that Vs of ADXL327 should not be connected with 5 v on Arduino board otherwise it may damage ADXL327 completely.

Program on Arduino Software

//Program starts here

const int zout = A3; // z-axis of the accelerometer
const int yout = A2; // y-axis
const int xout = A1; // x-axis

void setup() {
// put your setup code here, to run once:
//initialize serial communication at 9600 bps
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
// print the sensor values:
Serial.print(analogRead(zout));
// print a tab between values:
Serial.print(“\t”);
Serial.print(analogRead(yout));
// print a tab between values:
Serial.print(“\t”);
Serial.print(analogRead(xout));
Serial.println();
// 3 sec delay before next reading:
delay(3000);

}

// Program ends here

Explanation of Program

3 axis (Z-axis, Y-axis and X- axis) acceleration are defined to pins A3, A2 and A1, the anolog I/O pins of Arduino Boards.

in the setup() function, we open a serial communication for seeing the data on Serial Monitor with Serial.begin(9600);

in the loop() function, using a new function called analogRead(#definedpin) reading the data received from that analog pin. reading data from each of the three analog pins one by one and displaying it on serial monitor with delay of 3 sec.

Demo of Program

Here is the snapshot of the serial monitor output (all 3 axis output of ADXL327) observed on Arduino

accel_out

Please look at the whole demonstration on Youtube.

-Signing Off, Arduino Novice

Please do follow my Blog and subscribe to my Youtube Channel for more demos and videos related to Arduino.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s