I'm making a POV project and need to count the RPM of the DC Motor.

I purchased a Hall Effect Sensor and it seems to work perfectly at slow speeds, however once the motor speeds up, the sensor doesn't pick up the magnet at all.

The datasheet for the sensor is at: http://cdn.shopify.com/s/files/1/0045/8932/files/AH180.pdf?100744

This is one of my first projects and I'm not sure what I should be looking for on the datasheet.

The sensor came as part of this product: http://www.freetronics.com.au/pages/hall-effect-magnetic-and-proximity-sensor-module-quickstart-guide#.VZ0Zs_meDGc

There doesn't seem to be a problem with the code:

int pin = 13;
volatile int state = LOW;
volatile int tcnt = 0;

void setup()
  pinMode(pin, OUTPUT);
  attachInterrupt(1, blink, CHANGE);

void loop()
  digitalWrite(pin, state);


void blink()
  tcnt = tcnt + 1;
  state = !state;


1 Answer 1


From the datasheet of the hall effect sensor, the thing is only checking for 125usec in every 125msec - so if your magnet whizzes by in <100msec it will miss it.

Obviously you haven't stated the speed your magnet passes your sensor, but as it's only active 0.1% of the time, this seems the likely reason to miss.

Can you put it nearer the shaft/axle ?

  • Wow, 125 milliseconds is way too long. I've put the magnet as close as I can to the sensor and it hasn't made a difference. From what I can tell, the motor is doing 12 revolutions a second. Should I be using another kind of sensor? Would something as simple as 2 wires touching be a better way of doing this?
    – Daniel Gee
    Jul 8, 2015 at 13:38
  • There are faster hall effect sensors out there. Just check you regulator suppliers for hall effect sensors and check their datasheets. E.g. US1881 can handle 10kHz Switching Frequency (note that this is a latching sensor, so not ideal for you application (would require 2 magnets)).
    – Gerben
    Jul 8, 2015 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.