Pages: [1] 2   Go Down
Author Topic: Newbie Needs help!!!  (Read 478 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24353
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24353
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24353
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
« Last Edit: April 09, 2013, 12:06:20 pm by AWOL » Logged

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

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

2rps not 20
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

2rps not 20
Thanks! Looking back, I'm not sure how I even managed that mistake!!
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

New Jersey
Offline Offline
Faraday Member
**
Karma: 48
Posts: 3417
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 09, 2013, 12:21:07 pm by wildbill » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24353
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//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);
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Pages: [1] 2   Go Up
Jump to: