Ardunio Motor Control

Hello all

just a quick note on building a motor control board for your Ardunio, use the following circuite:

 

l293dmotorboard.jpg

This will allow you to drive two motor forward and reverse using just a L293D, a 7404 and a few caps and resistors.

Note this is good for about 600ma continuious, so don't cook it!

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

The frequency of the PWM signal is approximately 490 Hz.

If you Connect (I have a Duemilanove):

DIR_A to pin5

PWM_A to pin3

As for software:-

int dirPin = 5;
int pwmPin = 3;

void setup()
{
pinMode(dirPin, OUTPUT);
pinMode(pwmPin, OUTPUT);
}

void loop()
{
digitalWrite(dirPin, LOW);

analogWrite(pwmPin, 64);

}

 

http://servo.texterity.com/servo/200502/?pg=67

Thanks!

thank you man! been looking for this all day.

Just a quick question- instead of PWMing, can you just write "high 1, low 2" to make a motor go forward, like in the PICAXE Start Here robot?

High or Low Control of motor

Hi Dent,

yes you could write just a high or low, the function here is digitalwrite.

This will give you full speed on the motor, be careful of the current through the L293D, they do cook