Go Down

Topic: Speed control brushed dc motor with arduino using radio signal (Read 697 times) previous topic - next topic

prashant_k_2006

Hi ,

I want to control brushed DC motor with arduino using radio signal.I have Fly sky CT6B 6 channel transmitter.I know that we can use pulsin() to read signal from receiver but i didnt find any code on how to output this signal to dc motor.

Please help me out.Thanks in advance.

regrads,
Prashant

OldSteve

If you're talking about reading the receiver's servo PWM output, you'll be getting pulseIn values between about 1000uS and 2000uS.
You should be able to convert those using map(), to values between 0 and 255, then use PWM with 'analogWrite()' to control the speed of your DC motor, using a suitable (MOSFET?) driver and separate power supply.
Code: [Select]
pwmVal = map(pulseWidth, 1000, 2000, 0, 255);
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

prashant_k_2006

Thank you very much for your reply.That helped a lot. One more question? Do we need a separate power supply? Actually i didnt want to make my assembly heavy with extra power source.I need it to fly of the ground.Is there any way to use common power supply.

OldSteve

Thank you very much for your reply.That helped a lot. One more question? Do we need a separate power supply? Actually i didnt want to make my assembly heavy with extra power source.I need it to fly of the ground.Is there any way to use common power supply.
You haven't provided details of the DC motor, ie running current under load, and stall current, or the number of motors.
Also the batteries. Their voltage may pull down to an unacceptable level, especially when the motors start or accelerate quickly. What other loads do you have connected besides motor(s) and the Arduino itself?

Generally, you cannot power DC motors directly from an Arduino. It's asking for problems, even with small motors, because more than likely, the startup current surge will exceed the ratings of the Arduino. It can cause unexpected behaviour, and can even reset the Arduino.

You might get away with powering the motor(s) directly from the battery via transistor/MOSFET drivers, with the battery also feeding the Vin of the Arduino, but separate power is the best.

And note that the 1000uS to 2000uS valuesthat I gave are only approximate. You'll need to measure the actual range of pulsewidths from your receiver and set the values in 'map()' appropriately.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

Go Up