G-Force Meter ProjectThe aim is to build a meter which measures the lateral acceleration force in car, also called g-force or centrifugal force. This is the force which pushes the driver or passenger to the left in a fast right hand turn. The force is normally expressed in g, 1 g (9.8 m/s/s) corresponds to the acceleration due to gravity.A normal car can handle approximately 0.8 g, above this values, the tires cannot handle the sideways force anymore and the car will move sideways. The best sports cars can handle up to approximately 1 g. A very interesting discussion on the forces in a car can be found here. The ideaThe g-force will be measured with an accelerometer mounted with its sensitive axis perpendicular to the driving direction. The sensor will be read out using a microcontroller. 30 LEDs are used to indicate the current g-force.I have chosen the Atmel ATtiny26 microcontroller. It has some interesting features for this project:
The boardThis is version 2 of the board made using Eagle, the first version had the option to use a Freescale accelerometer also, but I needed the space for the logo :-): The following parts are can be seen:
Of course the board could be improved with a proper ground plane etc., but this is the first board that I ever made. Also a very good accuracy is not needed. Part list:
The eagle brd file can be found here The SoftwareThe software for the ATtiny26 was written in C and is rather straightforward. There is a lookup table which indicate the needed values of P1 and P2 to light one of the 30 LEDs. In the main loop the ADC is read out and the value is converted to a LED number. LED 1 corresponds to 1 g to the left, LED 30 to 1 g to the right. The maximum and minimum LEDs are remembered and also lit.The hex file can be found here The resultThis is Version 1 of the board (without Hack A Day logo). The middle LED indicates the current G-force, the left and right the maximum values to the left and right. In the car, the G-force meter functioned well. You do not need to keep an eye on the meter all the time because the maximum values are kept. It is a lot of fun, trying to improve the maximum values. Possible improvements: Ideas Remarks or questions? Send me a mail |