Professional Documents
Culture Documents
Modules Integrated
The iMEMS Accelerometer(ADXL345)
MCU (ATmega328)
Audio Buzzer
Piezoelectric Energy Source (Demo
Grid)
Configuring ADXL345
(ADXL345 Features A brief Recap)
3-axis accelerometer with digital output
Selectable measurement range 2-g,4g,8-g or 16-g
Resolution up to 13 bits
Fixed sensitivity 4mg/LSB
Programmable interrupt pins
INT1 and INT2 with 8 interrupt
functions
(simplifies algorithm)
Configuring ADXL345
(Interface build up and Interrupt enabling)
Setting up 4-wire SPI communication
Writing appropriate control words into
registers to enable interrupts which can
detect
Free fall
Activity
Inactivity
Configuring ADXL345
(4-wire SPI communication)
The device that controls the system
is called master (Atmega32)
Any peripheral device that
communicates with MCU is slave
(ADXL345)
4-wire SPI operates as full duplex
synchronous link
SCLK should be supplied by master
Configuring ADXL345
(Data and control lines of SPI)
Out of 4 lines
2 are data lines(MOSI,MISO)
1 is a control line(CS)
1 is clock(SCLK)
Configuring ADXL345
(I2C Communication)
Configuring ADXL345
Setting up SPI(4-wire)
Pin to pin connection for setting up SPI
After physical connection, SPI is enabled in
ADXL345 by writing 0x08 in DATA_FORMAT
Configuring ADXL345
(Setting up I2C)
CS is tied to 5V
Supports standard 100KHz and fast
400KHz data transfer modes
With ALT ADDRESS pin high, 7 bit I2C
address is 0x1D,followed by R/W bit
With ALT ADDRESS pin low, 7 bit I2C
address
is 0x53,followed by R/W bit
Configuring ADXL345
(Writing Appropriate control worlds)
List of registers to be modified to configure
accelerometer to detect fall:
1.THRESH_ACT (Activity Threshold)
2.THRESH_INACT(Inactivity Threshold)
3.TIME_INACT(Inactivity Time)
4.ACT_INACT_CTL (Activity control register)
5.THRESH_FF (Free fall Threshold)
6.TIME_FF (Free fall Time)
7.INT_ENABLE
8.INT_MAP
9.INT_SOURCE
Configuring ADXL345
(Writing Appropriate control worlds)
Algorithm Flowchart