BLDC motors have 3 hall effect sensors place at particular degrees apart - 60, 120 etc.
Hall effect sensors are analog in nature in most BLDC motors.
It is difficult to read when the sensor turned full on/off. Interrupt wont work on analog devices properly. You will get big numbers when you increment a counter in interrupt handler routine.
Step 1: Define three pins as input, one for each sensor.
Step 2: Attach an interrupt on one of the sensor on RISING state.
Step 3: When the interrupt handler is called, check the status of other two sensors.
Step 4: Since only two of the sensors are HIGH at a given time, there is no way that all three sensors will have HIGH output. If they have, then that is invalid state. Ignore this state.
Step 5: Since the pin that caused the interrupt is already HIGH, check if one of the other pin connected to other two sensors are HIGH. If so, increment your counter.
Step 6: Calculate RPM in your main loop()
DigitalSpeedometer.ino (1.67 KB)