Accelerometer is a electronic and mechanical device that can measure acceleration due to gravity , motion , vibration . A calibration mechanical part (in most case it is piezo effect sensor )is fitted inside it so that it can give the correct output . Accelerometer are highly used in android mobiles (when you rotate your mobile the video or image rotate automatically 🙂 ) ,smart watch to detect motion and direction .
How piezoelectric effect accelerometer works ?
Piezoelectric Effect is the ability of certain materials to generate an electric charge in response to applied mechanical stress . It means when accelerometer moves the piezoelectric sensor generates some charge in that direction and by calculating the generated amount of charge we can measure how much it moves in perticular direction .
for example if an accelerometer is moved in spherically in perticular amount of time then the value given by accelerometer will look like
How to interface accelerometer on microcontrollers to measure value ?
accelerometer generally gives value in all direction in spherical cor-dinate system it means in three direction so that we can measure everything in all direction . In most commercial accelerometer that are made for microcontroller use SPI serial communication protocal . I do not want to explain everything in this section of learning electronics because we have a different section of microcontroller you can search there for more information .