I’m attempting to test the motor for my Autonomous robot kit and have the gearbox built and the wires stripped and prepared. I hooked up 1 of the 2 motors to the arduino using the wire supplied and loaded up the full speed ahead program given with the instructions
int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control
void setup()
{
int i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int leftspeed = 255; //255 is maximum speed
int rightspeed = 255;
analogWrite (E1,255);
digitalWrite(M1,LOW);
analogWrite (E2,255);
digitalWrite(M2,LOW);
delay;
}
But nothing happens? I just want to test my motor works before I screw it all together and attach encoders etc.
How is the motor powered? Do the connecting wires to the arduino power it? I don’t see any ports for a power supply
You need to successfully upload the code to the board (ensure you have the drivers installed correctly, the right board type “Uno” and COM port).
The battery pack needs to be connected, as well as the motors. If you are using the 4xAA pack, remove the LiPo jumper at the left rear of the board.
The On/Off switch needs to be set to ON.
As soon as you upload the code, the motors should start rotating. If not, can you provide an image or two of your setup, and detail if you saw errors when uploading?
Ah I was under the impression that the USB would power the board and thus the motors. I have a LiPo battery + the battery pack for the AA batteries. I assume I can only use 1 of these at a time so which is best?
Using 4x double AA alkaline will provide you with 6V nomial and enough current to drive the Rover. The pros of using a LiPo, assuming it is rechargeable and you have a charging station, you will save money over time.
In terms of run time, that will be dictated by the amp-hour rating of your batteries (not to be confused with the amount of discharge current it can supply).
Your typical alkaline battery will be rated at ~ 2800 mAH which means you will get 2.8 hours of use if you system draws 1 A continuous. I think constantly replacing 4x AA can be expensive.
However, if you decide to go with the LiPo battery, ensure you aware of how to safety deal with LiPos. Cell failure can lead to toxic fumes and fire. Also never charge a LiPo unattended or near flammable things.
I do a lot of heavy duty UAV and I can tell you that I personally keep my LiPos in explosive bags in an ammo container. The reason for this is a lot of people in the UAV community have lost houses from LiPos.
I’m not trying to scare you but ensure you use best practices and never leave a charging LiPo unattended.
Finally, to extend the life time of LiPo batteries in storage, charge them to 80% and let them discharge to 20% before repeating the cycle.