At one point I was winding coils on my lathe and I needed an accurate way to keep track of the hundreds or thousands of turns on each coil. An early attempt to do this using a magnetic sensor connected to a benchtop frequency counter worked, but it wasn't very robust or easy to use.
I disassembled the motor drive electronics on the lathe and found that it was easy to tap into the hall effect sensors used to control the BLDC motor. I designed a small board to fit inline with the sensor wire harness. Software counts the revolutions forward and backward and adjusts for the gear ratio of the transmission. The count is stored in EEPROM using a wear-leveling mechanism so it is not lost when the power is shut off (which happens whenever the chuck guard is lifted).
I also added a measurment of spindle speed and AC current draw.
The software runs on the ATMEGA32U4 of an Arduino Micro that is soldered to the board. A backlit LCD display is also soldered to the board, making for a compact assembly. It is mounted inside the lathe housing, with a single multifunction button used for control.
Project files are available on github.