read output of dc motor

If i'm not mistaken motors can work both ways and output electricity as well as receive it.

if so, is there a way to connect a small dc motor (from a cheap rc car) and read the values that are output by turning the gear?

thnx

If it is a permanent magnet DC motor then yes it can act like a generator and generate a DC voltage that could be read by the Arduino analog input pins.

However you would have to make sure that the generated voltage could not raise above 5vdc or below 0 volts (no negative voltages allowed). A simple series resistor between the motor output and the analog input pin would probably protect for both cases.

Lefty

Note it's also AC out of a motor so you would need a diode to rectify it and a capacitor to smooth it. Then the reading would be proportional to how fast you are turning the motor.

how do i find out what my diode, resistor and capacitor need to be? maybe just finding something with a hall sensor would be easier

maybe just finding something with a hall sensor would be easier

NO!

how do i find out what my diode, resistor and capacitor need to be?

Diode 1N4001, resistor 1K capacitor 1uF

Note it's also AC out of a motor

It's a DC motor, so it'll work as a DC generator, surely?

Yes, a permanent magnet DC motor will generate pulsating DC voltages only, not AC voltages, as the commutator routes current flow to one direction only. The amount of the DC ripple voltage would depend on the number of commutator windings.

Lefty

It's a DC motor, so it'll work as a DC generator, surely?

and when you turn it the other way ::slight_smile:

You could do a diode bridge (4 diodes - see wikipedia). That would give the same voltage either direction, but no indication of which direction.

So (check me guys) couldnt you

  1. voltage limit with a 5 volt zener to ground from each side of the motor. seems like a good idea anyway.
  2. use a diode bridge to an analog pin.
  3. detect direction by running each zener protected side of the motor directly to a digital pin. Of course it would only show direction when the voltage reached logic high.

"and when you turn it the other way "

If will still be DC, just of the opposite polarity :wink:

Lefty

You could do a diode bridge (4 diodes - see wikipedia). That would give the same voltage either direction, but no indication of which direction. Yes that would work, however you would not get any reading until the speed generated a voltage above a two diode forward voltage drop = 1.4vdc. That's a pretty large loss of information.
So (check me guys) couldnt you

  1. voltage limit with a 5 volt zener to ground from each side of the motor. seems like a good idea anyway.

Not really, one side of the motor has to wire to ground so why would you put a zener from ground to ground :wink: 2) use a diode bridge to an analog pin.
3) detect direction by running each zener protected side of the motor directly to a digital pin. Of course it would only show direction when the voltage reached logic high.

I think you first have to spin the motor to the maximum speed you think it will be subjected to and read the maximum DC voltage generated with a DVM meter to find out what values we are looking at. Also is the application such that the motor can or will spin in both directions?

Lefty

If will still be DC, just of the opposite polarity

;D

Sorry I always thought that was what AC was, just DC changing polarity but what do I know?

The real answer is if you want to detect direction just have two half wave rectified circuits feeding into different inputs. You have three states to detect, still , moving clockwise and moving anti clockwise. Therefore you can't detect that in less than two logic inputs.

As for over voltage protection please see:-

http://www.thebox.myzen.co.uk/Tutorial/Protection.html

Thanks for the voltage protecton tutorial.

You are right about the second zener. I got my wires crossed....