Go Down

### Topic: Newbie Needs help!!! (Read 1 time)previous topic - next topic

#### jryan818

##### Apr 09, 2013, 06:41 pm
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!

#### AWOL

#1
##### Apr 09, 2013, 06:46 pm
What is "the wheel"?
How fast is it turning?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### jryan818

#2
##### Apr 09, 2013, 06:50 pm
The wheel is literally the wheels to a power wheels childrens toy and it will be going as fast as 5MPH

#### AWOL

#3
##### Apr 09, 2013, 06:51 pm
The vehicle will be travelling at 5mph, but how fast will the wheel be turning?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### jryan818

#4
##### Apr 09, 2013, 07:00 pm
//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!

#### AWOL

#5
##### Apr 09, 2013, 07:03 pmLast Edit: Apr 09, 2013, 07:06 pm by AWOL Reason: 1
Quote
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)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### JimboZA

#6
##### Apr 09, 2013, 07:08 pm
2rps not 20
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### jryan818

#7
##### Apr 09, 2013, 07:08 pm
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.

#### jryan818

#8
##### Apr 09, 2013, 07:09 pm

2rps not 20

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

#### JimboZA

#9
##### Apr 09, 2013, 07:14 pm
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....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### wildbill

#10
##### Apr 09, 2013, 07:16 pmLast Edit: Apr 09, 2013, 07:21 pm by wildbill Reason: 1
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

#### AWOL

#11
##### Apr 09, 2013, 07:19 pm
Quote
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
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### jryan818

#12
##### Apr 09, 2013, 07:37 pm

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?

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?

#### jryan818

#13
##### Apr 09, 2013, 07:41 pm

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?

Code: [Select]
`//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 variablesint reedVal;long timer;// time between one full rotationfloat 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;  circumference = 2*3.14*radius  pinMode(reed, INPUT);`

#### JimboZA

#14
##### Apr 09, 2013, 07:42 pm
Quote
How would you go about telling the Arduino that there are multiple spots being measured?

That's implicit in your calculation.... instead of the time between interrupts being a full rotation, it's a half or a quarter or whatever, and you just allow for that in the calc
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

Go Up

Please enter a valid email to subscribe