228Views9Replies

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

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
mpilchfamily
mpilchfamily

8 years ago

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.

0
5225jackiechanman
5225jackiechanman

Answer 8 years ago

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

0
mpilchfamily
mpilchfamily

Answer 8 years ago

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.

0
steveastrouk
steveastrouk

Answer 8 years ago

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

0
5225jackiechanman
5225jackiechanman

Answer 8 years ago

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

0
steveastrouk
steveastrouk

Answer 8 years ago

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

0
steveastrouk
steveastrouk

Answer 8 years ago

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

0
rickharris
rickharris

8 years ago

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

0
steveastrouk
steveastrouk

8 years ago

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