woensdag 10 maart 2010

Arduino & Cordless Drill

This week I managed to control the speed of a cordless drill with an Arduino and a potentiometer. Thanx to Ron!
Because this drill uses 1,3A and 14,4V the machine is to strong to power with an Arduino. As external power source I used the DC adapter of the drill.

I use this Arduino code to control the motor:

int motor = 10;
int sensorPin = 0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor


void setup()
{
analogWrite(motor, 0);
}
void loop()
{
// read the value from the sensor:
sensorValue = analogRead(sensorPin);

sensorValue = map(sensorValue, 0, 1023, 0, 255);

analogWrite(motor, sensorValue);

delay(200);

}

Next motor will be a washing machine motor, I hope :). This technical research is part of my neglected pet-robot project.

Cordless Drill from Snow on Vimeo.