Go Down

Topic: read output of dc motor (Read 1 time) previous topic - next topic

action_owl

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

retrolefty

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

Grumpy_Mike

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.

action_owl

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

Grumpy_Mike

#4
Jan 27, 2009, 07:25 pm Last Edit: Jan 27, 2009, 07:25 pm by Grumpy_Mike Reason: 1
Quote
maybe just finding something with a hall sensor would be easier


NO!

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

Diode 1N4001, resistor 1K capacitor 1uF

Anachrocomputer

Quote
Note it's also AC out of a motor


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

retrolefty

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

Grumpy_Mike

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


and when you turn it the other way  ::)

drspectro

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.  

retrolefty

"and when you turn it the other way  "

If will still be DC, just of the opposite polarity  ;)

Lefty

retrolefty

#10
Jan 28, 2009, 08:41 am Last Edit: Jan 28, 2009, 08:42 am by retrolefty Reason: 1
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  ;)  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

Grumpy_Mike

Quote
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://
http://www.thebox.myzen.co.uk/Tutorial/Protection.html

drspectro

Thanks for the voltage protecton tutorial.

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

Go Up