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);
Serial.begin(9600);
}
void loop()
{
digitalWrite(pin, state);
Serial.println(tcnt);
}
void blink()
{
tcnt = tcnt + 1;
state = !state;
}
Thanks!