Issue using a Hall Sensor

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)(rpmcount*1.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: 1. Is this sensor appropriate for what I am trying to achieve? 2. Is the coding flawed/inefficient for measuring RPM's? 3. 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)? 4. 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.

That sensor requires a pullup resistor, and from your description, I don't think you have one. You should power the sensor from the +5V pin and connect the sensor output directly to the digital input pin. Also either connect a pullup resistor (e.g. 1K) between the sensor output and +5V, or enable the internal pullup resistor on the digital input pin.

Using this arrangement, with no magnet near the sensor, the sensor output should be +5V. With a magnet close to the sensor and the right way round, the output should drop to about 0.1V. Get that much working before you try to count RPM.

Hello dc 42

Thank you for your input, I have applied the 1K Ohm pull-up resistor and I am pleased to say that it now works perfectly fine.

Again thank you, as I had been struggling with this issue for months.