Hack an Old DC Motor to Provide Rotary Input

3D Printing & Imaging Arduino Digital Fabrication Technology
Hack an Old DC Motor to Provide Rotary Input


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.

YouTube player

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

  1. Jonathan Smith says:

    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.

    1. David Scott says:

      In the video it does work in both directions, and with a single pin.

      1. Florence King says:

        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 .


  2. James Greer says:

    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?

    1. Judith Young says:

      .❝my neighbor’s mom is making $98 HOURLY on the internet❞….A few days ago new McLaren F1 subsequent after earning 18,512$,,,this was my previous month’s paycheck ,and-a little over, $17k Last month ..3-5 h/r of work a day ..with extra open doors & weekly paychecks.. it’s realy the easiest work I have ever Do.. I Joined This 7 months ago and now making over $87, p/h..Learn More right Here….
      ➤➤➤ http://GlobalSuperEmploymentVacanciesReportTiptop/GetPaid/$97hourly… ❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦.❦

Comments are closed.

Discuss this article with the rest of the community on our Discord server!

Jeremy is an engineer with 10 years experience at his full-time profession, and has a BSME from Clemson University. Outside of work he’s an avid maker and experimenter, building anything that comes into his mind!

View more articles by Jeremy S Cook


Ready to dive into the realm of hands-on innovation? This collection serves as your passport to an exhilarating journey of cutting-edge tinkering and technological marvels, encompassing 15 indispensable books tailored for budding creators.

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).