Microcontroller sensor interfacing exercises
ADXL1002 acceleration sensor
- sensitivity: 40 mV/g; offset: 2.5 V at 0 g
- output voltage range: 0.5 V to 4.5 V
ADC
- Voltage reference: 2.5 V
- Number of bits: 8
- Jusfitication: left
Signal conditioning
- voltage divider
- division ratio: 15/27
To do:
- Write a function that calculates the sensed value as a function of the ADC code!
Test data:
| sensor input | sensor output | ADC input | ADC output | calculated sensor input |
|---|
| 39 g | 4.06 V | 2.25556 V | 59136 | 39.0137 g |
| 33 g | 3.82 V | 2.12222 V | 55552 | 32.8613 g |
| -38 g | 0.98 V | 0.544444 V | 14336 | -37.8906 g |