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: 1.1 V
- Number of bits: 8
- Jusfitication: left
Signal conditioning
- voltage divider
- division ratio: 22/90
To do:
- Write a function that calculates the ADC code as a function of the sensed value!
Test data:
sensor input | sensor output | ADC input | ADC output | calculated sensor input |
---|
-29 g | 1.34 V | 0.327556 V | 19456 | -29.1016 g |
38 g | 4.02 V | 0.982667 V | 58624 | 38.1348 g |
15 g | 3.1 V | 0.757778 V | 45056 | 14.8438 g |