198Views9Replies

Author Options:

What is the best way to use the DC motor outputs as analog inputs for a micro controller? Answered

I am trying to connect my RC car to a Genie E18 micro controller, so that I can control some PWM and digital outputs. However, I am not sure how I can detect the voltage of the DC motor with the micro controller. I am a high school student in the UK and the best I can think of is to use a potential divider, would that be sufficient? Thanks, jack

9 Replies

user
mpilchfamily (author)2012-04-28

Do you want to detect voltage that the motor generates itself when the car is pushed or do you want to detect the voltage being applied to the motor to make the car move.

Select as Best AnswerUndo Best Answer

user

I would like to detect the voltage being applied to the motor and use that value to either increase or decrease the PWM rate.

Select as Best AnswerUndo Best Answer

user

I'm not familiar with that micro controller but i see it operates at 4.5V to 6V. How many volts is the car able to apply to the motor? If it uses more the 6V then yes you will need to use a voltage divider between the motor and the micro controller to bring the max voltage down to a level the analog input can safely read.

Select as Best AnswerUndo Best Answer

user

And a LOT of voltage spike supression, motors are EVIL to a microcontroller

Select as Best AnswerUndo Best Answer

user

Okay, thanks for your responses :) I just thought that it might take a bit more circuitry that a potential divider. The car it's self can run off 3v, so the motors won't receive any more than that (multimeter is unavailable at the moment). I'll let you know how it goes pretty soon :)

Jack

Select as Best AnswerUndo Best Answer

user

Beware, you can get a LOT more off the motors than the supply voltage.

Select as Best AnswerUndo Best Answer

user

Why ? Its a fixed quantity, DERIVED from your PWM cycle ?

Select as Best AnswerUndo Best Answer

user
rickharris (author)2012-04-28

Use a potential divider such that the maximum voltage the micro sees is 5 volts.

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2012-04-28

Why do you want to "detect" it ? Do you just want to know its present ?

Select as Best AnswerUndo Best Answer