home project

hi i am trying to build a 4wd rc toy car controlled by ps3. i am new to arduino and have no idea how to go about it. basically i have an uno and say, 2 dual motor controller and a usb shield.

dual motor controller: MDV 2x2A DC Motor Controller - DFRobot

usb shield: Funduino USB Host Shield Module Supports UNO MEGA for Google Android ADK - Blue - Free shipping - DealExtreme

understand that with 2 dual motor controller, i would have used up all my pwm pins on the uno so i cannot add on a servo to it.

where can i get the extra pwm pin for the servo or is there another arduino with more than 6 pwm pins that is compatible to the motor controller and usb shield?

4 motors only take 4 pins for PWM and that leaves you 2 for servo which only takes one each.
There's 15 pwm on the board you should be using for your USB shield

Arduino Mega 2560 (recommended)

There are 15 PWM wins on the Arduino Mega.

I'm pretty sure servos can be controlled from any I/O pin. They don't need to be used on PWM pins.

The h-bridge requires one PWM pin per motor as well as one digital pin (per motor) to control direction. I think there are still plenty of I/O pins left.

Hi all tks for the valuable advise. is there a difference between the above dual motor controller and this dual motor contorller?

http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/

so far I have managed to source for the dfrobot code but not this tronixlab code. Are the codes the same?

You don't need a PWM pin for a servo. Any I/O pin will work. Note that the servo library disables PWM on pin 9 on the Uno - see the documentation.

...R

Appreciated your advice, but i wouldn't have any other pins left beside the analog pins after I add in the usb shield.

Some analogue pins can be used for digital I/O

Groove:
Some All :wink: analogue pins can be used for digital I/O

At least on an Uno

terrance72sg:
Hi all tks for the valuable advise. is there a difference between the above dual motor controller and this dual motor contorller?

http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/

so far I have managed to source for the dfrobot code but not this tronixlab code. Are the codes the same?

Don't pay more than $4 for a L298N module. They're ubiquitous on ebay. The first one you linked to has the advantage of using an inverter on the direction pins is you can control direction with a single I/O pin. You can add your own inverter to the cheap L298N boards as save a lot of money.

Here's my L298N tutorial (I used a different microcontroller but the principles apply to the Arduino).

If you are content with a motor voltage below 10volts then the Pololu DRV8833 is much more convenient than an L298N.

...R