# Newbie Needs help!!!

Hello Arduino world!

I am trying to do a project and failing miserably in the Arduino aspects! I would like to have LEDs be controlled by how quickly an object is decelerating. I was hoping to use a hall effect sensor to measure the speed by having the sensor toggle every time a magnet did a full rotation on the wheel. Could anyone help me with where to begin and go with this?

Thanks so much!

What is "the wheel"? How fast is it turning?

The wheel is literally the wheels to a power wheels childrens toy and it will be going as fast as 5MPH

The vehicle will be travelling at 5mph, but how fast will the wheel be turning?

//tire radius ~ 7 inches //circumference = 2*pi*r=~43.6 inches //max speed of 5mph=~88inches/second //max rps=~19.8

I am more or less trying to make a brake light that will illuminate the brake lights with more intensity if the brakes are slammed. I have an idea, but just cannot figure out how to do the programming!

with more intensity if the brakes are slammed.

So why not measure the speed of the brake pedal?

(I'm no great shakes at Imperial measure, but I think you need to revisit your arithmetic)

2rps not 20

I had a similar thought in the beginning, but since in real life brake pedals wear out and sensitivity is different from car to car it seems more realistic to use the actual rate of deceleration to decide how many LEDs would be illuminated.

JimboZA: 2rps not 20

Thanks! Looking back, I'm not sure how I even managed that mistake!!

Have a look at this thread from yesterday. It seems to need some work still, but should be adaptable to use a Hall sensor.

It will give you the rpm, which you can convert to speed. Then the difference between two successive speed measurements, and the time between them, will let you get the deceleration....

How long does the vehicle take to stop, or what is the stopping distance? From 5mph, it may be stopping so quickly that you'll need multiple magnets on the wheel to establish the deceleration in tim to light the leds.

Edit: spelling

but since in real life brake pedals wear out and sensitivity is different from car to car it seems more realistic to use the actual rate of deceleration

I don't see your point. If a MIDI keyboard can measure key velocity, why not a brake pedal? Surely you want to know the intent, not the outcome, which could depend on other factors like recipient ad surface condition.

wildbill: From 5mph, it may be stopping so quickly that you'll need multiple magnets on the wheel to establish the deceleration in tim to light the leds.

How would you go about telling the Arduino that there are multiple spots being measured?

AWOL: If a MIDI keyboard can measure key velocity, why not a brake pedal? Surely you want to know the intent, not the outcome, which could depend on other factors like recipient ad surface condition.

That's a very good point. How would you go about doing this if you were just to measure the pressure in the brake pedal?

JimboZA: Have a look at this thread from yesterday. It seems to need some work still, but should be adaptable to use a Hall sensor.

It will give you the rpm, which you can convert to speed. Then the difference between two successive speed measurements, and the time between them, will let you get the deceleration....

Thank you for the reference. I am having a bit of trouble making sense of all of the programming and lingo that is taking place on that forum, but it will be useful, I'm sure! This is the programming I came up with when I was thinking of using a reed sensor. I have not completed it because I simply got lost and was not sure what to do next... Maybe you have some advice?

``````//calculations
//tire radius ~ 7 inches
//circumference = 2*pi*r=~43.6 inches
//max speed of 5mph=~88inches/second
//max rps=~2

#define reed A0//pin connected to reed sensor

//storage variables
int reedVal;
long timer;// time between one full rotation
float mph;
float radius = 7;// tire radius (in inches)
float circumference;

int maxReedCounter = 100;//min time of one rotation (for debouncing)
int reedCounter;

void setup(){

reedCounter = maxReedCounter;