what input pin is it using?

So you have three sensors and you increment all three counters when any one goes off!!!

You don't use the pin change interrupt like that anyway.

ok could you show me a beter way of doing it?

Just check the pins with a port read at the start of loop() and don't fart around with delays or other blocking code. A fast loop() can read and evaluate, and report/store data for 3 pins many times per millisecond. Is > 1000 checks per second fast enough?

i could do it in a port read like you said but this will be linking up with some other code i already have, there is no delays in it will it still be fine as this might be seeing some high rpm's?

ok could you show me a beter way of doing it?

Better than "totally wrong and will not work at all", is easy.

This project:-
http://www.thebox.myzen.co.uk/Hardware/Crazy_People.html
Uses the pin change interrupt to monitor 6 pulse inputs. Maybe looking at that code would help you.

now im more confused looking at that lol any one got a simple example thay can post?

New to forum, check your private messages... look upper right under the Search box.

yes and i do not have any new messages?

OOOOPS! Sorry, wrong thread!

How many reads/second will the high rpm's require? Assuming 1 magnet on a shaft at 10000 rpm I get ~167 reads/second giving 6 milliseconds per cycle though the sensor will be high for a much shorter time.
An Arduino running spare code can make digital reads with minor processing in under 5 microseconds. I have sensor code that does a digital read, unsigned long increment and unsigned long compare ( if statement ) is just over 1 usec per while loop. I give an extra 60 cycles for 5 usecs.

The code you showed in the first post has no foot-dragging parts and uses millis for timing.

You know that if you pass a magnet under a coil that the speed of the magnet will affect how much power is induced in the coil? So maybe you don't have to count rpms.

well my hall sensor is going to be an abs sensor on a car so theres quite a few triggers per revolution havent counted exactly but were looking at about 60, and the revolutions will depend on how fast the car is. so what do you think?

ABS as in the braking system? So rpm is rpm of the wheel?

Do you have multiple sensors or multiple magnets activating a single sensor?

ABS as in the braking system? So rpm is rpm of the wheel?

yes

Do you have multiple sensors or multiple magnets activating a single sensor?

3x sensors with approxmatly 60 triggers per revolution

basically what im trying to do is for my arduino to look at 2 of the sensors and pick the fastest travelling one and compare it against the 3rd one if it is going slower than the 3rd sensor then to execute another piece of code

3 sensors on 1 wheel? Well, it's for ABS... how to know what they measure?

Do they all measure rotation of the same wheel?
Do you have data (including time and maybe speed) from any 1 sensor?

A 28" diameter wheel turns about 12 times a second at 60 mph (88 f/s).

12 rps x 60 magnets is only 720 pulses per second, but again how long are the pulses? The hall sensor only detects the magnet for a limited time, not 1/720th of a second so you have less time than that to catch the signal.
That stated, you might be able to use pulseIn to know the speed of the wheel from just one magnet going by one (but maybe not just any one) sensor.

If I was trying to find answers, I would collect related data first.

no 3 sensors one on the left wheel and one on the right and one on the prop shaft what is on 1 to 1 ratio

if i have to use a different sensor so we now what it is that is fine
maybe somthing like this;

this is the trigger wheel


or i can use somthing like this to
http://www.millersmule.com/MillersMuleStore/45-177-thickbox_default/trigger-wheel-mounting.jpg

That first link --- anyone who pays that much for a Hall sensor has more money than knowledge. Holy cow, what a ripoff!

You have sensors in place though I'm not clear what you want the data for... is it to know speed?

Again, I would gather data and see which is suitable before even starting to design a final package.

ok then what sort of data should i be gathering?
like travelling down the road with one of the sensors connected to an oscilliscope? (which i dont have lol)

I would use an Arduino to read 1 sensor on 1 pin to maybe fill an array at the tap of a button with timestamps showing state change times just to see if I get useful data.

If I didn't have a laptop to save those to then maybe I'd have them go to SD or EEPROM for later retrieval. Perhaps I'd think of a way to get speedometer data in there or just write that on paper.

You could have it read a pin and light up one of a row of leds to show data within different ranges. You don't have to be exact, just look for a suitable match to what you need.

What have you tested already? Do you need more complete or better data?
What can I say? I still don't know what this is for anyway.

sounds like more code i dont understand, or know how to write lol currently havent done any testing but i do have a sensor and trigger wheel to play around with.
basically this is for a 4wd system in a car i have written a code already to control it manually but i want to now be able to conrtol it automatically so to look at the 2 rear wheel speeds and pick the fastest travelling one and compare it to the speed of the propshaft and if it is going slower execute it into another piece of code to lock the diff up.

Joes:
look at the 2 rear wheel speeds and pick the fastest travelling one and compare it to the speed of the propshaft and if it is going slower execute it into another piece of code to lock the diff up.

That seems unnecessarily complex. Unless your diff has broken you know that the propshaft speed is proportional to the average of the two wheel speeds so all you need to do is look at the ratio of the two wheel speeds.

If the car is not going in a straight line the outer wheel will turn faster than the inner wheel.

I have been assuming that you have done at least a few of the example projects that came with your IDE. They do require some hands-on to teach basics.

Suppose you hook up the sensor and wheel you have and see what you can get from that?
The sensor is digital right? It's either on or off, LOW or HIGH, 0 or 1?

So write code to read the sensor and if it is HIGH you turn a led on (UNO has built-in led on pin 13, I dunno about the MEGA) and if it is LOW you turn the led off. Then turn the wheel and see how the led flickers. If it does not then it's time to check the wiring and the code.

All that does is to ensure that you can read the sensor and get meaningful data.

That seems unnecessarily complex. Unless your diff has broken you know that the propshaft speed is proportional to the average of the two wheel speeds so all you need to do is look at the ratio of the two wheel speeds.

i disagree the car is normally a front wheel drive car, when slip is detected it will lock up the rear diff (as it doesnt have a centre diff) to transfer the power to the back wheels. in its original state the car will decide how much lock to put on by looking at the outside temperature, steering angles, throttle position, G force meter and overall speed. so this will be a simple system compared to the original

If the car is not going in a straight line the outer wheel will turn faster than the inner wheel.

yes it will this is why i want the arduino to pick the fastest moving wheel

I have been assuming that you have done at least a few of the example projects that came with your IDE. They do require some hands-on to teach basics.

yes i have so my knowlege is very limited

Suppose you hook up the sensor and wheel you have and see what you can get from that?
The sensor is digital right? It's either on or off, LOW or HIGH, 0 or 1?

So write code to read the sensor and if it is HIGH you turn a led on (UNO has built-in led on pin 13, I dunno about the MEGA) and if it is LOW you turn the led off. Then turn the wheel and see how the led flickers. If it does not then it's time to check the wiring and the code.

yes i would of thought so i will have to try that
but i am on the understanding that it is a hall sensor
i will do that and let you no what i get