Hello,
I am using arduino motorshield with arduino uno r3 in a project.
I have powered arduion uno board with 6 rechargeable double a nimh batteries. and connected the motorshield to a variable ac to dc power adapter (set to 9v) to control a 6-12v dc motor to spin for few second, stop and spin in reverse direction. I used this code to control the dc motor. the problem is after 5 minutes there was a burning smell from my variable power adapter and it was extremely hot.
was there something wrong with my wiring or was I supposed to use some kind of jumper since I am using 2 source of power...
I would appreciate your feedback..
Thanks.
void setup() {
//Setup Channel A
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin
}
void loop(){
//forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at full speed
delay(8500);
digitalWrite(9, HIGH); //Eengage the Brake for Channel A
delay(2500);
//backward @ half speed
digitalWrite(12, LOW); //Establishes backward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at half speed
delay(8500);
digitalWrite(9, HIGH); //Eengage the Brake for Channel A
delay(2500);
}