Adequate Circuit?

I’m working on a project that consists of 32 dc motors and 32 servos. I don’t have any electrical engineering experience, but I’ve attached a circuit diagram I drew (showing only 4 dc motors and 4 servos) of how I imagine I would want to wire everything:

  • I purposely used a separate breadboard for each pair of motors, because each pair of motors will be spaced fairly far apart, and I don’t want to deal with a bunch of long wires going in to a single board (alternative suggestions are welcome).

  • Wiring all the dc motors in parallel is best, right? I’ll probably use a 5v 4a power supply.

  • Am I correct that since servos run off ~5v and minimal current, I can just wire them all in parallel to the same power supply?

  • Since I only need to control servos, an Arduino Mega will allow me to control 32 servos at once, correct?

  • Am I missing any other essential components/connections (such as resistors, etc.) needed to prevent problems like overheating, short-circuiting, etc.?

Thanks for your help.

EDIT: I’ve resized the PNG, but getting a schematics may take longer as I’m still learning Fritzing.

Sketch.fzz (8.07 KB)

A schematic would be easier to read. I also suggest resampling that down to a more viewable size.

You will need a common ground, the motors have to be driven with drivers (search logic level mos FET transistor), the use of the breadboard is not correct (search how to use a bread board), the DC motors should be driven separately with subbing diodes across them.

LarryD:
You will need a common ground, the motors have to be driven with drivers (search logic level mos FET transistor), the use of the breadboard is not correct (search how to use a bread board), the DC motors should be driven separately with subbing diodes across them.

A little more specificity would be appreciated, unless what you mean to say is that my circuit is beyond all hope of correcting.

  • I've already tried to create a common ground, so I'm not sure where you mean to say I went wrong.
  • What would be the problems with controlling one servo per pin? I've seen someone mention jittering. And if I can't control multiple servos with one per pin (is this false then? Arduino Playground - MegaServo) then can't I just find the appropriate shield to let me control 32 servos from one arduino?
  • I'm pretty certain I understand the connections on a breadboard, so how exactly am I using it incorrectly? Does it have to do with the power plug, because that's the only thing I can think of that I probably have wrong?
  • Do you mean a snubbing diode? And if so, can't I still drive all the motors off one power source if I just add the snubbing diodes?

You need a ground between the Arduino and the drive components.
Google is your friend:

http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/

And HERE

8016442759_69de090078_z.jpg

LarryD:
You need a ground between the Arduino and the drive components.
Google is your friend:
http://electronics.stackexchange.com/questions/112035/turning-off-servos-with-a-mosfet
bildr High-Power Control: Arduino + TIP120 Transistor - bildr
http://en.wikipedia.org/wiki/Snubber
http://www.buildcircuit.com/building-a-circuit-on-breadboard/

And HERE

  • Ok, now I understand what you mean about the ground. Does this solve my problem (attached)? Also, just checking, this change doesn’t supply any power to my arduino, correct?
  • I did want to avoid as much additional baggage as possible, but I forgot about the mosfet and how small and simple it is, so I’ll look into it.
  • However, I’ve already seen the breadboard diagrams you’re showing me, and I still don’t see your point. Perhaps you’re thinking that I’m using a full-size board, so there would be a break in the connection on the rows on each size, but since I’m using a half-size board, there is no break. Other than that, I’ve doubled checked my circuit, and I don’t see any problems (and neither does Fritzing’s auto-check).
  • Also, I do know what a snubbing/flyback diode is, and I will added them after I revisit tutorials I’ve seen on them. I was asking instead whether I can still maintain the same single power supply after I add a diode to each motor?

  • The way you have the servo and DC motors wired to the breadboards has the power leads shorted together.
  • The Arduino in your diagram is not powered.
  • You have to use a driver between the Arduino and the motors.
  • Doing some experimenting with a single MOS FET driving a servo.
  • Get one servo working first, when you get experience with it, experiment with a DC motor example.
  • Once you become more experienced with how the hardware works then and only then expand your circuit to drive more than one motor circuit.

Aside all hardware problems, sufficient computing power to update the 32 servos with a pulse of 1 ms + - 0.5 ms?
You needs lots of timers.

Pelle

LarryD:

  • The way you have the servo and DC motors wired to the breadboards has the power leads shorted together.
  • The Arduino in your diagram is not powered.
  • You have to use a driver between the Arduino and the motors.
  • Doing some experimenting with a single MOS FET driving a servo.
  • Get one servo working first, when you get experience with it, experiment with a DC motor example.
  • Once you become more experienced with how the hardware works then and only then expand your circuit to drive more than one motor circuit.

Ok, now I see. I did not correctly wire my motors in parallel. I'll have a new circuit up soon. And I've seen many servo tutorials that don't use a driver, so I looked into it; doesn't the arduino code, specifically the attach(int), make each pin a servo driver, as the Arduino Playground Servo page says: Arduino Playground - Servo ? Also, of course I plan to test out a prototype part of my project consisting of one dc motor and one servo, but while I'm waiting for some parts to come in the mail, I want to just start thinking about how I'll expand my circuit.

Pelleplutt:
Aside all hardware problems, sufficient computing power to update the 32 servos with a pulse of 1 ms + - 0.5 ms?
You needs lots of timers.

It sounds like you are also saying that what I'm reading on the Arduino Playground Servo and Mega pages, which mention nothing more than using the arduino and coding to control up to 48 servos, is inaccurate. Is that right?

Definitely draw your circuit diagram, for just one servo and one motor and post
a photo of that drawing, a circuit schematic and a wiring diagram are not the same
thing. Circuit diagram/schematic is an abstract representation of whats connected and
how that is easy to reason about. A wiring diagram is used solely for wiring.

Schematic attached. Is this right, or do I need a flyback diode for each of the servos, too?

No

It's not right, all servos have reversed polarity.
The diodes are not necessary att all.
Much better with a decoupling capacitor, 1-100 uF perhaps.

Pelle

You are also switching the positive of the supply directly onto the ground rail
and connect the negative of the supply to positive of everything.

Just draw the circuit for one motor and one servo clearly and without all
the looping about, keep things linear and simple - +ve supply at the top,
ground / -ve supply at the bottom, signal flow from left to right. Rather
that draw every single wire label connections clearly and keep the diagram
uncluttered.

You seem to have motors separate from the Arduino, just powered all the
time, and servos under Arduino control - is this the intention?

MarkT:
You are also switching the positive of the supply directly onto the ground rail
and connect the negative of the supply to positive of everything.

Just draw the circuit for one motor and one servo clearly and without all
the looping about, keep things linear and simple - +ve supply at the top,
ground / -ve supply at the bottom, signal flow from left to right. Rather
that draw every single wire label connections clearly and keep the diagram
uncluttered.

You seem to have motors separate from the Arduino, just powered all the
time, and servos under Arduino control - is this the intention?

Is this schematic better? (And yes, I’m just controlling the dc motors with the circuit switch and not with my arduino.) Thanks.

EDIT: Schematic with switch changed to positive.

NO
NO
NO
NO
<<<< Edit, the external supply are only 5 V so all will survive, BUT switch the positive, others can look at in this tread and change to 12 V >>>>>>>
You gona burn the servo or the arduino

You MUST have a common arduino-motor-servo-ext. power sup.

Move your power switch to positive from the external power supply

Pelleplutt:
NO
NO
NO
NO
<<<< Edit, the external supply are only 5 V so all will survive, BUT switch the positive, others can look at in this tread and change to 12 V >>>>>>>
You gona burn the servo or the arduino

You MUST have a common arduino-motor-servo-ext. power sup.

Move your power switch to positive from the external power supply

Is this what you mean? Thanks.

JohnLincoln:
Motors and servos draw a high current when they start up, or when they are loaded. You will need a power supply capable of supplying much more than 4 amps.

I have minimal loads (my servo motors' arm will only function as a gate for ping pong balls, and my dc motors will only accelerate the ping pong ball forward), but how much current do you think I would need to compensate for current drawn on start-up? I think my dc motors are rated 10-20 mA, and I can't find a current rating for my TowerPro SG90 Micro Servo. Thanks.

JohnLincoln:
From what I've read, it seems that it is at least 500mA per servo.

I see. In that case,

  • Is this where incorporating mosfets would allow me to drive 32 servos without resorting to a 20a power supply?
  • And if I incorporate mosfets, then I would also need flyback diodes, correct?

After thinking about this some more, I realized I overlooked the fact that current drawn will depend on load, so if my servo draws 500mA on start-up, how much do you think it would draw while idle? I do not expect to have more than 3 servos moving at any given moment, and I already checked on a disconnected servo that its natural resistance is plenty to hold closed as a gate. Depending on the servos’ idling current usage, I may still be fine with 4A, but I would not expect to need more than 10A.

WorldWiz:
I do not expect to have more than 3 servos moving at any given moment,

Never, never forget Murphy's law.

Figure out the total stall current, and specify the power supply for that. That is the current that will be drawn as the system starts.