NOOB HERE: Controlling DC motor via digital pin HELP

Hi Everyone !

University project is underway and we need to build a robot for a specific action. We have decided to use 3 dc motors and 2 of them are working fine at the moment and we shouldnt have any problems.

We are using arduino UNO and a motor shield. 2 DC motors are being controlled by channels A and B on the motor shield and now we are at the stage of working out how to control a third DC motor via a digital pin (either pin 5,6,10).

We have been told to investigate MOSFET as we will need one of them to make this happen ?

Any suggestions or help on controlling a dc motor (small one- 12V or less) via a digital pin would be appreciated.

Cheers

BTW- We are noobs and want to keep this as simple as possible.

THANKS 8)

One of these:

across the motor leads with the banded cathode end of the diode on the + terminal of the motor , and the other end on the - term of the motor,
and one of these:

Connect motor + terminal to motor power + terminal
Connect motor - terminal to DRAIN of mosfet
Connect SOURCE of mosfet to motor power GND
Connect arduino GND to motor power GND
Connect arduino PWM output (for speed control) to mosfet GATE
analogWrite(MosfetGate,100); (39% duty cycle) (1/3 rd power) (Warp 2 for you trekies)
analogWrite(MosfetGate,255); (100% duty cycle) (FULL power) (Warp 6 for you trekies)
Connect arduino DIGITAL output to mosfet GATE
For simple ON FULL/OFF control use

digitalWrite(MosfetGate, HIGH);

It's a mosfet not a transistor so it doesn't need a current limiting resistor but many designers like to use a 1k series resistor just
to protect the gate anyway.

IRL640A-87605.pdf (774 KB)

FQPF30N06L-244348.pdf (831 KB)

If the third motor needs to run in both directions then another H-bridge is needed, perhaps
a separate L298 board (cheap on eBay), although they aren't efficient at low voltages.

Its work looking to see if anyone makes a 4-channel motor shield, that would clearly be
ideal.

now we are at the stage of working out how to control a third DC motor via a digital pin (either pin 5,6,10).

@MartT,
Yes, I thought of that and the only reason I didn't say the same thing was the OP's use of this wording:

via a digital pin

which I interpreted to imply simple on/off one direction control. I may have made a HUGE assumption there....

hey guys,

thanks for your input.

yes we most likely only need 1 direction control.

it has recently come to my attention that the two orange Tinerkit connections (orange) are pwm outputs and all you need to do it to connect a servomotor to them and it all works ?

if connecting a servo is as simple as that ^ then would you suggest getting a servo and plugging it in or trying to connect a dc motor ? its not possible to connect a dc motor via Tinerkit connection ?

thanks for your help guys !

I don't think we have any Tinkerbot schematic or wiring documentation. We would need that to answer the question.

Hey guys,

as the project rolls on we are sort of making it all work.. somehow.

we are running 12v from batteries into the arduino motor shield. then controlling the 2 dc motors is all good- one in channel a and one in channel b.

but i know that the motor shield only gives max 2A per channel. the motor in channel b is a 12v dc motor and we need more torque out of it but still want to run it through arduino.

the question now arises:

is it possible to hook up another battery in between the arduino motor shield and the dc motor ?

aka- have 12v into the arduino to power it. then have seperate battery in between the motor shield and the dc motor ?

i read that it is possible to hook up an external power source for a servo- do you just hook up the battery to the power cable and ground to ground ??

thank you

Draw a schematic of what you are proposing and post a photo of it

it has recently come to my attention that the two orange Tinerkit connections (orange) are pwm outputs and all you need to do it to connect a servomotor to them and it all works ?

No a servo needs a PPM signal not a PWM signal.

then have seperate battery in between the motor shield and the dc motor ?

No not in between. If the shield only has a 2A rating there is nothing you can do to increase it.

do you just hook up the battery to the power cable and ground to ground ??

And the batteries ground to the arduino's ground as well.

Draw a schematic of what you are proposing and post a photo of it