CSE 466 Final Project - Accelerometer Driven Car
by Kelvin Lau and Mike Quinn

Home | Accelerometer Use | Servo Use | Building Car | Problems Faced
Stepper Motor | THE CODE | THE SCHEMATIC

The Accelerometer

The Accelerometer was used to control the car.  In the picture at right, you can see the accelerometer mounted on a small breadboard that can be held in the hand.

The accelerometer is a device that measures the acceleration on both the x and y axis's.  The output is a pulsed signal of set frequency.  The frequency of the output is determined by the size of resistor used in the circuit ( we used a 1.2 MOhm ).  This resistor resulted in a 130.5 Hz signal.

The % amount of time that the pulse is high vs low determines the angle at which the accelerometer is currently positioned.  Of course this will need to be calibrated, but it can easily be measured on an oscilloscope.  For example, our measured Duty Cycles were between 35% and 60% high signal. 

The next tricky part is translating this signal into something meaningful for the microprocessor.  To do this we have a clock on the 8051 interrupt on a high-to-low transition and count the machine cycles that the pulse stays high for during one pulse.  This count has a direct correlation with the angle we tilted.

With a little bit of averaging you have a pretty consistent and accurate representation of what position the accelerometer is currently in.