Go Down

Topic: Using a motor as a sensor (Read 2191 times) previous topic - next topic


I'm interested in using a DC motor as a sensor to measure hand-cranking speed. It seems like I could wire one lead of the motor to ground, wire the other lead to the sensor input with a resistor going to +5V. Is additional circuitry needed?

Also, this method only measures one direction of rotation. Are there suggested methods for sensing both directions of motor rotation?

(I also am using a rotary encoder as a sensor, but for reasons of touch and response I would like to have a separate motor sensor.)

Thank you very much.


If its a brushed motor you can measure the EMF which is proportional to speed (but rather noisy).  connect one terminal to a potential divider consisting two 10k resistors to 0V and +5V, and the other to an input pin.  You may want protection against overvoltage on that pin (I use a high resistance potential divider to limit current).

Then so long as the voltage is in the +/- 2.5V range it will be measurable on the analog input.  I'd also put a few uF across the motor terminals to reduce noise.   Higher voltages will need another potential divider across the motor terminals.

Other types of motor like brushless and stepper tend to give AC waveforms that will be a bit harder to deal with.

If you need any true accuracy a shaft-encoder would be better.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


It probably "could" be done... but you "can" drive a screw with a hammer.

What downside is there to using a simple rotary encoder, if you mean by that what I mean by it? (A simple little thing that gives you ons and offs when the object rotates) With two of them, knowing which way the wheel is turning is a doddle.

If you go the motor route, be sure to include a diode to clamp voltage spikes.


Yes.. that tutorial is about clamping voltage spikes from relay coils. What you are talking about will create the same spikes.


Apr 29, 2011, 05:19 pm Last Edit: Apr 29, 2011, 06:28 pm by redw Reason: 1
Thanks very much for the helpful replies.

The motors I've experimented with are common brushed DC motors. The potential divider suggestion works fairly well, although with the motors I have here the output range is fairly small.

I initially was drawn to the idea of using motors because of their feel while cranking -- they are smooth and have very little friction, resulting in continued motion after cranking and releasing, for instance.

However, perhaps a better idea would be to use as smooth as possible a detentless rotary encoder? Are there specifications addressing this which I could consult on a data sheet to find an appropriate model? Or are there specific suggestions for such an encoder? Thanks again.


Well, it is to be used as part of a hand-operated crank -- imagine, for instance, something like a hurdy gurdy's wheel.


Whoops, obvious typo! You're right, I meant to say brushed! Thanks.


I'd like to have direction sensing as well -- this is for an audio synthesis application, and the direction will be utilized as an additional control parameter. I've ordered a detentless rotary encoder to experiment with, but if you have further suggestions or ideas they are most welcome!

Go Up