Hello everyone,
I am attempting to measure RPM's using the fallowing sensor: Hallogic Hall Effect Sensor Type 0H090U, with the Arduino Mega AT1280 MC board. I am displaying the RPM's using a SainSmart LCD Keypad Shield, which will also display the desired RPM's that the user has selected. As of now, only the hall sensor is still giving me issues.
Link for the hall sensors information: http://www.newark.com/pdfs/datasheets/Optek/OH090U.pdf
I am running 7.1V to the board, and I am powering the hall sensor using the 5V output pins which I have checked to see if it is putting out what is labeled, which it is. The fallowing situations illustrate what I have tried and what the results are. I have also checked multiple times that I am wiring the sensor up correctly with multiple friends, unless we all are making the same mistake.
Sensor is powered by Arduino 5V output pins:
Hall tach readings: Very inconsistent, will range from 0 to 5 digit values and everything in between with no effect by a passing magnet.
Handheld optical tach readings: 2000 RPM
Sensor is powered by 9V battery with output signal to Arduino board, use a 250 Ohm resistor over signal wire:
Hall tach readings: Very inconsistent, will range from 0 to 5 digit values and everything in between with no effect by a passing magnet.
Handheld optical tach readings: 2000 RPM
Sensor is powered by 9V battery with out signal split, one to ground with a 500 Ohm resistor and the other to the Arduino board with a 400 Ohm resister. The thought in doing this was another method to reduce the 9V coming off of the sensor to 5V (4/9 resistance with 5/9 resistance to ground).
Hall tach readings: 0
Handheld optical tach readings: 2000 RPM
The code for the tach looks like this:
//Tach subroutine
void tachometer() {
rpmcount = 0; //resets pulse count
tachrpms = 0; //resets calcuated RPM
timeold = millis(); //sets up new time to be calculated
attachInterrupt(0,rpm_fun, RISING); //interrupt used to count pulses
delay(958);
detachInterrupt(0);
tachrpms = int(15.1000./((millis() - timeold)1.0)(rpmcount1.0)); //formula used to calculate RPM's
}
// Interrupt function for rpm pulses
void rpm_fun() {
rpmcount++;
}
I have also attempted using LOWERING as the interrupt condition with no change in outcome.
Here are my questions:
- Is this sensor appropriate for what I am trying to achieve?
- Is the coding flawed/inefficient for measuring RPM's?
- Is there more to the set up needed with this particular sensor to be used with the Arduino board other than the resistor/capacitor that is listed with this sensor (like transistors, op-amps)?
- What would be (in your opinion) the best magnetic sensor to be used as a tachometer if this current sensor isn't the correct one for this situation?
I am contemplating to move to a optical tachometer in the event this one just doesn't work out, but I would really like to get a magnetic tachometer up and running.