Go Down

Topic: Newbie Needs help!!! (Read 864 times) previous topic - next topic

jryan818

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

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

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

AWOL

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

//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!

AWOL

#5
Apr 09, 2013, 07:03 pm Last 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

Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

jryan818

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


2rps not 20

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

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....
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

wildbill

#10
Apr 09, 2013, 07:16 pm Last 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

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
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.
"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


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


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 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;
  circumference = 2*3.14*radius
  pinMode(reed, INPUT);

JimboZA

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
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

Go Up