Help with DC Motor

Hello

I just want to know how i can make a DC Motor drive? Do you know a nice tutorial?

I got the Starter Kit from Earthshine Design (http://www.earthshinedesign.co.uk/index.php?route=product/product&product_id=81)

I know there is a guide in the ASK Manual that comes with the kit, but in the guide is there an Potentiometer included. I want to drive the motor with out the Potentiometer.

Thanks!

The potentiometer is there to control the speed of the motor. Leave it out if you just want the motor to run full speed, or at some programmed speed.

Change the sketch to not perform an analogRead. Instead, set the variable valued by analogRead to your specific value.

Try this, it’s a ramping motor test.

// Ramps the motor down in speed until half way and then sets it back again
int transistorPin = 11;      // connected to the base of the transistor 
int speedValue = 255; // speed to go at

void setup() { // set the transistor pin as output: 
pinMode(transistorPin, OUTPUT);
}
void loop() { 
speedValue--;
if(speedValue < 128) speedValue=255; // when it gets to half speed make it full speed again
analogWrite(transistorPin, speedValue);
delay(50); // controls the speed of the cycle

}

or this if you want to use the serial terminal to control motor speed. sending a digit from 0 through 9 sets the speed:

const int motorPin = 11; 

void setup(){ 
  Serial.begin(9600);  
}

void loop(){
  if ( Serial.available()) {
    char ch = Serial.read();

    if(ch >= '0' && ch <= '9')        // is ch a digit?  
    {
      int speed = map(ch, '0', '9', 0, 255);        
      analogWrite(motorPin, speed);
      Serial.println(speed);
    }
  }      
}