|
ADXL335BCPZ-RLAnalog Devices
|
x 1 | |
|
741C083510JPCTS Resistor Products
|
x 1 | |
|
227CKS035MIllinois Capacitor
|
x 1 | |
|
16 pin male header |
x 1 |
ADXL335 Accelerometer For Arduino
This Accelerometer module is based on the popular ADXL335 three-axis analog accelerometer IC, which reads off the X, Y and Z acceleration as analog voltages. By measuring the amount of acceleration due to gravity, an accelerometer can figure out the angle it is tilted at with respect to the earth. By sensing the amount of dynamic acceleration, the accelerometer can find out how fast and in what direction the device is moving. Using these two properties, you can make all sorts of cool projects, from musical instruments (imagine playing and having the tilt connected to the distortion level or the pitch-bend) to a velocity monitor on your car (or your children’s car). The accelerometer is very easy interface to an Arduino Micro-controller using 3 analog input pins, and can be used with most other micro controllers, such as the PIC or AVR.
For most accelerometers, the basic connections required for operation are power and the communication lines. Accelerometers with an analog interface show accelerations through varying voltage levels. These values generally fluctuate between ground and the supply voltage level. An ADC on a microcontroller can then be used to read this value. These are generally less expensive than digital accelerometers.
ADXL335 is 3 axis accelerometer with on board voltage regulator IC and signal conditioned Analog voltage output. The module is made up of ADXL335 from Analog Devices. The product measures acceleration with a minimum full-scale range of ±3 g. It can measure the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration.
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, with a range of 0.5 Hz to 1600 Hz for the X and Y axis, and a range of 0.5 Hz to 550 Hz for the Z axis.This is the latest in a long, proven line of analog sensors – the holy grail of accelerometers. Accelerometers are generally low-power devices. The required current typically falls in the micro (μ) or milli-amp range The ADXL335 is a triple axis accelerometer with extremely low noise and power consumption – only 320uA! The sensor has a full sensing range of +/-3g.
There is an on-board voltage regulation, which enable you to power the board with 3V to 6V DC. Board comes fully assembled and tested with external components installed. The included 0.1uF capacitors set the bandwidth of each axis to 50Hz.
Features:
3V-6V DC Supply Voltage
Onboard LDO Voltage regulator
Can be interface with 3V3 or 5V Microcontroller.
All necessary Components are populated.
Ultra Low Power: 40uA in measurement mode, 0.1uA in standby@ 2.5V
Tap/Double Tap Detection
Free-Fall Detection
Analog output
Specifications:
description of 3 Axis Accelerometer with Regulator – ADXL335 is as given below
Input Voltage Range (VCC) = 3V3- 6V
How To Test1. 3 Axis Accelerometer with Regulator – ADXL335 using Arduino
Here is the guide illustrates how to connect an Arduino to the ADXL335 Triple Axis Accelerometer. The following picture describes which pins on the Arduino should be connected to the pins on the accelerometer:
Testing with Arduino board, sample program is shown below. Using this program we are reading output from X,Y and Z axis during vibration.
int x; // x axis variable
int y; // y axis variable
int z; // z axis variable
/**************************************************************************************
Function : setup()
Description : Use it to initialize variables, pin modes, start using libraries, etc.
The setup function will only run once, after each power up or reset of the Arduino board.
***************************************************************************************/
void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
/**************************************************************************************
Function : loop()
Description : Loops consecutively, allowing your program to change and respond.
Use it to actively control the Arduino board.
***************************************************************************************/
void loop()
{
x = analogRead(0); // read the 0th analog input pin
y = analogRead(1); // read the first analog input pin
z = analogRead(2); // read the second analog input pin
Serial.print("X = "); // print x adc value
Serial.println(x);
Serial.print("Y = "); // print y adc value
Serial.println(y);
Serial.print("Z = "); // print z adc value
Serial.println(z);
delay(100);
}
Connect ADXL335 module with Arduino and upload the Arduino example code. Then open the serial monitor, ADXL335 will output the accel
2. Testing 3 Axis Accelerometer with Regulator – ADXL335 using PIC16F877A
When interfacing 3 Axis Accelerometer with Regulator – ADXL335 with PIC16F877A micro-controller, The X,Y,Z pins of the sensor is connected to Port A of the micro-controller. Here X,Y,Z pins are connected to RA1, RA2, RA3 respectively. Connection diagram is shown bel
Testing 3 Axis Accelerometer with Regulator – ADXL335 with PIC16F877A, sample program is shown below. Using this program we are
#include<pic.h>
#include"delay.c"
int X_Value=0;
int Y_Value=0;
int Z_Value=0;
void ADC_init() ;
void send(char);
int adc_conv(int);
void SerialPortInit() ;
void SendData(char);
void display(int value );
void MSdelay(unsigned int);
static void Send2USART(const char *CPtr1);
void main()
{
TRISC=0X80;
TRISE=0X07;
SerialPortInit() ;
ADC_init();
while(1)
{
Send2USART("X-axis:");
X_Value=adc_conv(1);
display(X_Value );
SendData(' ');
Send2USART("Y-axis:");
Y_Value=adc_conv(2);
display(Y_Value );
SendData(' ');
Send2USART("Z-axis:");
Z_Value=adc_conv(3);
display(Z_Value );
SendData('\n');
SendData('\r');
}
}
/*******************************************************************************
* Function : Send2USART
* Description : Group of data send serially
******************************************************************************/
static void Send2USART(const char *Cptr1)
{
while(*Cptr1 != '\0')
{
SendData(*Cptr1);
Cptr1++;
}
}
/*******************************************************************************
* Function : display
* Description : Display adc value function
******************************************************************************/
void display(int value )
{
char k=1;
char array[4];
for(k=1;k<=4;k++)
{
array[k]=value%10;
value=value/10;
}
for(k=4;k>=1;k--)
{
SendData(array[k]+'0');
}
}
/*******************************************************************************
* Function : SerialPortInit
* Description : Usart Initialization function - Baud Rate 9600
******************************************************************************/
void SerialPortInit()
{
GIE=1;
SYNC=0;
TXEN=1;
BRGH=1;
SPEN=1;
CREN=1;
PEIE=1;
RCIE=1;
SPBRG=129;
}
/*******************************************************************************
* Function : ADC_init
* Description : Adc Initialization function
******************************************************************************/
void ADC_init()
{
ADFM=1;
PCFG3=0;
PCFG2=0;
PCFG1=0;
PCFG0=0;
}
/*******************************************************************************
* Function : adc_conv
* Description : Adc Conversion function
******************************************************************************/
int adc_conv(int channel)
{
int ab;
ADCON0=0x81|channel<<4; //channel selection
DelayMs(1);
ADGO=1; //start AD conversion
while(ADGO!=0); //wiating for competion of AD conversion
ab=ADRESH; //assign 2bit value ADRSH register to variable ab
ab=ADRESH<<8; //8 times shift variable ab value
ab=ab|ADRESL; //combine ADRESL & ab value
return(ab);
}
/*******************************************************************************
* Function : SendData
* Description : Send a data serially
******************************************************************************/
void SendData(char sdata)
{
TXREG=sdata;
while(TRMT!=1);
}
/*******************************************************************************
* Function : MSdelay
* Description : Generate 1ms delay
******************************************************************************/
void MSdelay(unsigned int val)
{
unsigned int del,del1;
for(del=1;del<=val;del++)
{
for(del1=0;del1<=331;del1++);
}
}
When PIC16F877A micro-controller receives 3 Axis Accelerometer with Regulator – ADXL335 datas and are displayed on serial monitor as
.:
Converting ADXL335 Output to Acceleration(g)
?
The following code snippet is the most important part of the program. It maps and converts the analog output voltages from the sensor to gravitational acceleration(G).
The IDE’s built-in map() function does the actual mapping. So, when we call map(xRaw, RawMin, RawMax, -3000, 3000), value of RawMin would get mapped to -3000, a value of RawMax to 3000 and values in-between to values in-between.
The values -3000 and 3000 are not arbitrary. They actually represents the gravitational acceleration (in milli-g which is 1/1000 of a g) measured by the sensor i.e. ±3g (-3000 milli-g to 3000 milli-g).
For example,
When the sensor outputs 0 volts on x-axis i.e. xRaw=0, the map() function will return -3000 representing -3g.
When the sensor outputs 3.3 volts on x-axis i.e. xRaw=1023, the map() function will return 3000 representing +3g.
When the sensor outputs 1.65 volts on x-axis i.e. xRaw=511, the map() function will return 0 representing 0g.
The term Ratiometric will make more sense now as the output voltage increases linearly with acceleration over the range.
// Convert raw values to 'milli-Gs"
long xScaled = map(xRaw, RawMin, RawMax, -3000, 3000);
long yScaled = map(yRaw, RawMin, RawMax, -3000, 3000);
long zScaled = map(zRaw, RawMin, RawMax, -3000, 3000);
Finally, the sensor’s output is scaled down to fractional Gs by dividing it by 1000 and displayed on the serial monitor.
// re-scale to fractional Gs
float xAccel = xScaled / 1000.0;
float yAccel = yScaled / 1000.0;
float zAccel = zScaled / 1000.0;
Serial.print("X, Y, Z :: ");
Serial.print(xRaw);
Serial.print(", ");
Serial.print(yRaw);
Serial.print(", ");
Serial.print(zRaw);
Serial.print(" :: ");
Serial.print(xAccel,0);
Serial.print("G, ");
Serial.print(yAccel,0);
Serial.print("G, ");
Serial.print(zAccel,0);
Serial.println("G");
ADXL335 Accelerometer For Arduino
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(1)
- Engineer Jul 10,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Sreeram.zeno
- Esp12-F Cluster V1.0 The ESP8266 is a low-cost Wi-Fi microchip, with built-in TCP/IP networking software, and microcontro...
- TB6612FNG Motor Driver The TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A (3.2A peak)...
- Sunny Buddy Solar Charger v1.0 This is the Sunny Buddy, a maximum power point tracking (MPPT) solar charger for single-cell LiPo ba...
- Diy 74HC4051 8 Channel Mux Breakout Pcb The 74HC4051; 74HCT4051 is a single-pole octal-throw analog switch (SP8T) suitable for use in analog...
- Diy RFM97CW Breakout Pcb IntroductionLoRa? (standing for Long Range) is a LPWAN technology, characterized by a long range ass...
- ProMicro-RP2040 Pcb The RP2040 is a 32-bit dual ARM Cortex-M0+ microcontroller integrated circuit by Raspberry Pi Founda...
- Serial Basic CH340G Pcb A USB adapter is a type of protocol converter that is used for converting USB data signals to and fr...
- Mp3 Shield For Arduino Hardware OverviewThe centerpiece of the MP3 Player Shield is a VS1053B Audio Codec IC. The VS1053B i...
- MRK CAN Shield Arduino The CAN-BUS Shield provides your Arduino or Redboard with CAN-BUS capabilities and allows you to hac...
- AVR ISP Programmer AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology ...
- Diy Arduino mega Pcb The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/ou...
- Max3232 Breakout Board MAX3232 IC is extensively used for serial communication in between Microcontroller and a computer fo...
- Line Follower Pcb The Line Follower Array is a long board consisting of eight IR sensors that have been configured to ...
- HMC6343 Accelerometer Module The HMC6343 is a solid-state compass module with tilt compensation from Honeywell. The HMC6343 has t...
- RTK2 GPS Module For Arduino USBThe USB C connector makes it easy to connect the ZED-F9P to u-center for configuration and quick ...
- Arduino Explora Pcb The Arduino Esplora is a microcontroller board derived from the Arduino Leonardo. The Esplora differ...
- Diy Stepper Motor Easy Driver A motor controller is a device or group of devices that can coordinate in a predetermined manner the...
- Diy Arduino Pro Mini The Arduino Pro Mini is a microcontroller board based on the ATmega168 . It has 14 digital input/out...
-
-
Helium IoT Network Sensor Development board | H2S-Dev V1.2
80 0 0 -
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
175 1 1