
Redditor and indie game designer “Critters,” unhappy with the price of free-spinning optical encoders on the market, decided on a simple, but novel solution: use a DC motor as an encoder. As you might know, DC generates an electrical current, so the idea behind this project was to calibrate the voltage generated with how fast the motor is turning.
This makes sense on some level, but before seeing this I wouldn’t have thought that you could get any sort of accuracy out of this method. In the video below, a 3.3V motor is hooked up to a voltmeter, where positive voltage is generated when spun in one direction and negative voltage in the other. As Critters puts it, this method is “Accurate enough for some projects, but not enough for others.” Probably a good reminder not to over-engineer things, since most of us don’t have an unlimited supply of money!
After the voltmeter, the motor was hooked up to an Arduino to test out. This setup isn’t capable of reading negative voltages, but the solution to this was accomplished by using pull-up resistors to set the analog pin voltage to a nominal value. The motor would then add or subtract voltage from this.

To compliment this, Critters came up with a knob to allow for easier spinning. He notes that he’s not a professional, and though it’s probably safe with very small motors, if a larger one is used, a method for limiting the current should probably be examined so as not to cause any damage.
Seeing this, I’m reminded of how cool I thought the spinner — with its knurled metal outside and what seemed to be one or more ball bearings on this inside — on Arkanoid arcade games was growing up. Though video games have improved exponentially since the 80s, I still miss some of the custom controller schemes of that era!
[via Reddit]
5 thoughts on “Hack an Old DC Motor to Provide Rotary Input”
Comments are closed.
Actually both directions can be used. Run the output through a diode bridge to get the absolute value and then use two diodes to get the direction. Takes additional inputs but gets the job done.
In the video it does work in both directions, and with a single pin.
When I looked at the draft which was of 7159 dollars, I accept that my friend’s brother was like really generating cash in their spare time with their pc. . their aunts neighbor has done this for only 10 months and by now repaid the mortgage on their home and bought a new Car .
http://www.tradingeconomics.vz.lc
☯77
I have some teleprompter controls at my job that use optical encoders. I checked them out and all they are is a sensor from an optical mouse turned upside down. Optical mouses are “cheap as chips” , as you Brits say. Has anyone tried to hack one?