i need to measure the air resistance and roll resistance of a vehicle. I plan on using a toothed disc with a proximity sensor which will output a square wave signal in to an arduino. Then I will drive until I reach a certain speed, after which I will disconnect the drive from the wheels and let the vehicle roll until it has reached another certain speed (2 or 3 kph lower than the speed at which I started). By measuring the time it takes to decelerate I can calculate the air and rolling resistance.

I want to use an arduino as the brain box. Once the frequency of the sensor signal drops below a given value the arduino should start measuring time. Once the frequency drops below a second given value the arduino should stop measuring. For example between 25Hz and 20Hz. I would like to change the Frequency (that corresponds to a speed) so i can test at different speeds. I would then want to log the time it took to my pc on the serial monitor. I plan on using an Arduino Mega 2560.

My knowledge of coding in C is very limited so I'm a bit stuck on how I would write such a program. Anybody got any ideas on how to program something by using interrupts? The vehicle on which I want to do this is an Urban Concept car for the Shell Eco-marathon efficiency race.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.