Created Sat, 10 Mar 2012 19:34:32 +0000 by fastlater_pro
Sat, 10 Mar 2012 19:34:32 +0000
I still trying to connect a small DC motor but it rotate slowly,anyone know what happen. I am using a external 9v,0.6A power supply connected to chipkit and my motor is connected to JP9 in I/O shield. This is my code:
int motor1Pin1 = 3; // int motor1Pin2 = 5; // int sw4 = 79; int swState =0;
void setup() {
pinMode(motor1Pin1, OUTPUT); pinMode(motor1Pin2, OUTPUT); pinMode(sw4,INPUT);//slide switch
}
void loop() {
swState = digitalRead(sw4);
if(swState == HIGH){ delay(2000); digitalWrite(motor1Pin1, LOW); // digitalWrite(motor1Pin2, HIGH); // } else{ delay(2000); digitalWrite(motor1Pin1, HIGH); // digitalWrite(motor1Pin2, LOW); // }
}//end loop
Sat, 10 Mar 2012 21:54:59 +0000
The delays is too large 2000ms is a full two seconds. Also if you are powering this motor using an io pin there may not be enough current or voltage for the motor to run well. As it is it should be full speed for 2 seconds then off for 2 seconds.
Sun, 11 Mar 2012 08:49:28 +0000
Open drains will be better? Where I need to connect motor terminals? Can I use the same code?
Sun, 11 Mar 2012 09:10:04 +0000
I don't know motor control isn't something I have tackled yet, but I would think that connecting the motor straight to the board would be a mistake because of current draw and back emf. I would think that you would at least want a blocking diode, a blocking diode and a transistor, or a full fledged motor controller.
Sun, 11 Mar 2012 11:56:26 +0000
5 3 9 6
but in the scheme sheet (pdf) pins are marked as
FROM WIRE VCC5V0 (I think it is the positive )
WIRE TO GND (I think it is the negative)
3
5
6
9
this don't have sense.
which is correct?
moreover, in the scheme of VCC5V0 puts as a switch to JP1. I have to change the JP1 switch position (REG -->BYP)?
Thu, 22 Mar 2012 19:55:11 +0000
Hello,
The silk screen is correct. If you look at the underside of the IO Shield and take a look at the traces the one labeled as + goes to the capacitor and the unloaded JP1 jumper as indicated by the schematic.
the JP2 jumper on the Uno is used to change VCC5V0 to the regulated 5V (REG) or to the external power supply (BYP, in this mode the external power supply has to be less than 6V). The JP1 jumper on the IO Shield allows you to output VCC5V0. If you plan to connect an external supply to J6 you should leave JP1 unjumpered.
Best Regards, Ryan K