Accelerometers are cheap today, but they are great for many projects where acceleration and motion is present.
This simple project demonstrates the reading of ADXL330 3-axis accelerometer by AVR Atmega48 microcontroller. 3D accelerometer has three analogue outputs that can be read via ADC module. Each accelerometer axis has two dedicated LED indicators – red and blue. Idea is simple – if there is no acceleration, both LED’s are off. If there is acceleration in one direction, then one LED lights on, it other direction – different colour LED lights on. This board also can serve as tilt sensor, because of gravity acceleration effect. Program code for AVR-GCC can be downloaded here.