I am trying to make a tachometer with an AVR, a magnet, and a hall effect sensor. The hall effect sensor I have is this one
. When there is no magnetic field it outputs around 2V that goes up or down if there is a positive or negative field applied.
Originally I though of using an opamp and the AVR ADC to check when the magnet went by. The problem with this is I will be polling the hall effect sensor. Do you think it would be better to use a comparator and a pin change interrupt? If I used a comparator then I would have to use two and a OR gate to detect both + and - fields so I don't have to worry about which way I install the magnet. The magnet will not pass the sensor more then 450 times per second (~27,000 RPM), usually under 250.
Is it better to use one opamp and the AVR ADC, comparators and a OR gate, or something I have not mentioned?