Thanks for your responses! I have additional details on the vehicle in another post:
http://arduino.cc/forum/index.php/topic,98632.0.htmlThere is a brake pedal for the hydraulic brake system with a switch. The issue is that you can slow down (and stop) very quickly using the speed control which does not activate the brakes lights. In fact, the hydraulic brakes are more for emergency or fast stops. I use the bar in parades and motorcycle rallies and have caught people off guard as I slow down.
After thinking about it I have come up with a solution that might work best. Accelerometers, tilt switches, and pendulums would all be affected by vibration. The bar does not have any suspension and although low speed, still jostles around a bit if you are on rough terrain. What I came up with is linking a potentiometer to the speed control and read the voltage change. If the voltage drops as I decrease the speed control I know I am slowing. I could control the brake light output one of two ways:
1. Each time the voltage drops by a certain factor I can activate the brake lights for a certain time period.
2. Each time the voltage drops I can measure the rate of voltage drop over time and activate the brake lights. I could also add another potentiometer to make the rate adjustable. This way a gradual slowing down does not activate the brake lights, but a faster rate of slowing down does turn on the brake lights.
Or I could program both methods and add a switch to select between them and see which seems to provide the best results.
Scott