Accelerometers
Introduction
Accelerometers are used in many portable devices like smart phones, to detect if the device is held vertically or horizontally, in fitness watches as step counters or in some smart portable hard disks where free fall is detected and the device is secured before hitting the ground.
Two diifferent devices are easily available for bread board use:
- the MMA8452q from NXP Semiconductors
- the LIS3-DH from ST Microelectronics
Both are 12 bit accelerometers with similar functionality and both use the
I2C bus for acquisition and control.
|
|
lis3dh |
mma8452 |
Both devices are rather complex, have numerous functions and applications and have a large number of registers. They are therefore not easy to understand and program. However, both come with a data sheet and an application note explaining them in great detail.
Here are the references:
In addition to its use as accelerometer the lis3dh also implements a 12 bit ADC for general use and a temperature sensor, which however only measures relative temperature changes and must thus be cross calibrated with another device if absolute temperature values are desired.
The access library
In order to make it easier for the students to interact with the devices I wrote share libraries with a number of access functions which hides most of the complexity. All accesses to the chip registers pass through the library functions. The library is not really complete as many chip functions like free fall detection, access to the FiFo or to the filter configuration registers are not implemented. In addition to the library itself test programs using the library are provided demonstrating its use.
https://afnog.iotworkshop.africa/pub/Embedded_Systems/3-axisAccelerometers/mma8452.tar.gz
--
Uli Raich - 2018-11-27
Comments