Hi, I am thinking about getting started with using Arduino for one of my robotics projects. I have done some research about Arduino, and am familiar with most of the hardware available (Arduino boards, motor shields, etc)
However, I was wondering if I could attach 6 DC motors, and a servo to an Arduino Uno. Four of these motors require speed and directionality control. The other two just need directionality control. The servo also only needs directionality control.
Is it possible to make all of these motors work using only an Arduino Uno? If possible, can I use an even smaller Arduino Board to fulfill the same purpose (I am on a size crunch)? Also, I am aware that I can probably make this possible with a motor shield, but I do not want to take up too much space with different hardware components.
A Nano has the same capabilities as an Uno, but in a much smaller package.
There are motor driver shields available (for Uno), but they often use the ancient and inefficient L29x drivers. Though they are cheap they are not good by modern standards. The L29x drivers will drop 2V to over 4V of the motor supply and dissipate (waste) that power as heat.
Pololu has a good line of motor drivers. I am not affiliated with Pololu, but am a customer. They have good tech support, reasonable pricing and provide educational pages for each of their products.
Choose the motor driver based on the stall current of the motor and the motor supply voltage. The stall current can be several times the running current. The stall current will be drawn, briefly, every time that the motor is started. The stall current should be listed in the motor data sheet.
Some motor driver come with current limit circuitry built in. You don't need to supply stall current when using those drivers. See >> Client Challenge
You will need a power supply or supplies that can provide the correct voltages and the combined stall currents of the motors. No Arduino is a power supply.
That means an H-bridge driver for each motor and a PWM pin per motor to contol speed.
So just H-bridges.
An Uno or Nano has enough pins. Remember that the analog inputs are really digital pins with analog input as a special purpose so can be used just like any other digital pin (except A6 and A7 on Nano, those are analog only).
Servos need any digital pin.
Be aware that PWM is disabled on pins 9 and 10 if using the Servo library on Uno or Nano. See the Servo library reference.
No, you cannot unless you can find a motor with a stall current less than 20mA (recommended max pin current).
Even the servo needs an external power supply, despite what is shown on some pages on the internet. It may "work", but you are asking for trouble and can actually damage the Arduino by trying to power the servo with the Arduino.
Can you post data sheets for the motors? You must know the stall current to intelligently choose a driver.
I don't see the stall currents for the motors. The currents mentioned may be no load currents. Stall currents will be up to 10 times or more the no load or running current.
Ok... I tried looking for the stall currents but couldn't find them. Assuming the stall currents are up to ten times more than the no-load currents listed, do you think I can use an Arduino UNO to run all of these?
It is not good to guess. Underestimation can cause damage to drivers and power supplies.
Do you have a DMM (Digital MultiMeter)?
In the absence of a data sheet, the stall current can be estimated. To estimate the stall current, measure the motor winding resistance. Zero your meter lead resistance[*] before measuring the motor coil resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.
[*] Short the meter leads together and note the reading. Subtract the noted reading from subsequent winding resistance readings to get the corrected measured winding resistance.
And like @jremington says, you will need external power supply(s) that can handle the stall currents.
The motor power supply should be capable of providing 3 or more Amperes, if you want to power all those motors at once.
It is probably OK to plan on the stall current being at least 10X the free running current and sum them up. Make sure that the power supply can easily provide more than the total.
You can find "wall warts" (discarded plug in power supply modules) at thrift shops for next to nothing, and they are required by law to state voltage and current on the label.