Adafruit Industries ADXL345 Manual de usuario

ADXL345 Digital Accelerometer
Created by Bill Earl
Last updated on 2018-12-07 07:32:33 PM UTC

2
3
3
3
5
5
5
6
6
6
8
8
8
8
9
9
9
9
10
10
10
10
11
11
11
13
14
14
14
14
14
14
15
16
16
16
Guide Contents
Guide Contents
Overview
How it Works:
(https://adafru.it/c5f)MEMS - Micro Electro-Mechanical Systems
Assembly and Wiring
Assembly:
Position the Header:
Add the Breakout:
And Solder!
I2C Wiring:
Programming and Calibration
Install the Library:
Test:
Calibrate:
Gravity as a Calibration Reference
Calibration Method:
Mount the Sensor:
Load the Calibration Sketch:
Position the Block:
Reposition the Block:
(https://adafru.it/c5g)
Repeat:
(Hint:)
Calibration Results:
Calibration Sketch:
Typical Calibration Output:
Library Reference
Constructor:
Initialization()
Sensor Details:
Getting and Setting the operating range:
Getting and Setting the Data Rate:
Reading Sensor Events:
Downloads
Files
Schematic & Fabrication Print
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 2 of 17

Overview
The ADXL345 is a low-power, 3-axis MEMS accelerometer modules with both I2C and SPI interfaces. The Adafruit
Breakout boards for these modules feature on-board 3.3v voltage regulation and level shifting which makes them
simple to interface with 5v microcontrollers such as the Arduino.
The ADXL345 features 4 sensitivity ranges from +/- 2G to +/- 16G. And it supports output data rates ranging from 10Hz
to 3200Hz.
ADXL345 datasheet (https://adafru.it/c5e)
How it Works:
(https://adafru.it/c5f)MEMS - Micro Electro-Mechanical Systems
The sensor consists of a micro-machined structure on a silicon wafer. The structure is suspended by polysilicon
springs which allow it to deflect smoothly in any direction when subject to acceleration in the X, Y and/or Z axis.
Deflection causes a change in capacitance between fixed plates and plates attached to the suspended structure. This
change in capacitance on each axis is converted to an output voltage proportional to the acceleration on that axis.
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 3 of 17

© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 4 of 17

Assembly and Wiring
The board comes with all surface-mount components pre-soldered. The included header strip can be soldered on for
convenient use on a breadboard or with 0.1" connectors. However, for applications subject to extreme accelerations,
shock or vibration, locking connectors or direct soldering is advised.
Assembly:
Position the Header:
Cut the header to size if necessary. Then plug the
header - long pins down - into a breadboard to stabilize
it for soldering.
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 5 of 17

Add the Breakout:
Align the breakout board and place it over the header
pins on the breadboard.
And Solder!
Be sure to solder all pins to assure good electrical
contact.
I2C Wiring:
The ADXL345 Breakout has an I2C address of 0x53. It can share the I2C bus with other I2C devices as long as each
device has a unique address. Only 4 connections are required for I2C communication:
GND->GND
VIN->+5v
SDA->SDA (Analog 4 on "Classic Arduinos")
SCL->SCL (Analog 5 on "Classic Arduinos")
The Adafruit breakout has level shifting and regulation circuitry so you can power it from 3-5V and use 3V or 5V logic
levels for i2c
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 6 of 17

© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 7 of 17

Programming and Calibration
Install the Library:
Download the ADXL345 library (https://adafru.it/aZn) and install it. You will also need the Adafruit Sensor
Library (https://adafru.it/aZm) if you do not already have it installed.
This guide (https://adafru.it/aYM) will help you with the install process.
Test:
Click "File->Examples->Adafruit_ADXL345->sensortest" to load the example sketch from the library.
Then click on the compile/upload button to compile and upload the sketch to the Arduino. You should see output
similar to below. Watch the values change as you move the board around.
Calibrate:
The ADXL chips are calibrated at the factory to a level of precision sufficient for most purposes. For critical applications
where a higher degree of accuracy is required, you may wish to re-calibrate the sensor yourself.
Calibration does not change the sensor outputs. But it tells you what the sensor output is for a known stable reference
force in both directions on each axis. Knowing that, you can calculate the corrected output from a sensor reading.
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 8 of 17

Gravity as a Calibration Reference
Acceleration can be measured in units of gravitational force or "G", where 1G represents the gravitational pull at the
surface of the earth. Gravity is a relatively stable force and makes a convenient and reliable calibration reference for
surface-dwelling earthlings.
Calibration Method:
To calibrate the sensor to the gravitational reference, you need to determine the sensor output for each axis when it is
precisely aligned with the axis of gravitational pull. Laboratory quality calibration uses precision positioning jigs. The
method described here is simple and gives surprisingly good results with just a block of wood.
Mount the Sensor:
FIrst mount the sensor securely to a block or a box. The size is not important, as long as all the sides are at right
angles. The material is not important as long as it is fairly rigid.
Load the Calibration Sketch:
Load and run the Calibration sketch below. Open the Serial Monitor and wait for the prompt.
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 9 of 17

Position the Block:
Place the block on a firm flat surface such as a sturdy
table. Type a character in the Serial Monitor and hit
return. The sketch will take a measurement on that axis
and print the results.
Reposition the Block:
Turn the block so a different side is flat on the table and
type another key to measure that axis.
(https://adafru.it/c5g)
Repeat:
Repeat for all six sides of the block to measure the
positive and negative aspects of each axis.
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 10 of 17
Tabla de contenidos
Manuales populares de Unidad de control de otras marcas

Festo
Festo Compact Performance CP-FB6-E Manual de lista de piezas

Elo TouchSystems
Elo TouchSystems DMS-SA19P-EXTME Manual de usuario

JS Automation
JS Automation MPC3034A Manual de usuario

JAUDT
JAUDT SW GII 6406 Series Guía rápida

Spektrum
Spektrum Air Module System Manual de usuario

BOC Edwards
BOC Edwards Q Series Manual de usuario











