calebzulawski wrote:exartemarte wrote:calebzulawski wrote:I'm curious, what's the benefit of using the Arduino motor shield? I always had the motors plugged right into the arduino.... If it's just about voltage, I think I'll use some transistors, but i dunno if that's good enough!
A microcontroller will not normally deliver enough current to drive motors, unless they're very tiny. Arduino output ports are limited to a few tens of milliamps: the motors on the Magician chassis that
Mikeyl has used have a stated stall current of approximately 1 Amp. You can build your own motor control circuit using transistors, and that is quite easy if all you want is to turn the motors on and off, but if you want bidirectional control you will end up building something like an h-bridge anyway and it might be quicker and easier to use a chip such as an L293D or a n L298N. For
Mikeyl's chassis I would choose L298N, which I believe is available on an Arduino extension board ("shield", if you must...).
I'm using servos, so I don't need to mess with polarity or anything like that to change speed and direction, since the servos are PWM. Could I just use transistors to boost the PWM output of the arduino to 6V and supply more current?
I don't have a lot of experience with servos, although I have used them - it might help if you have a look at page 19 of
this manual. The code example won't help much, since it's for a Picaxe, but the description and the diagram apply equally to an Arduino or the Pi.
This may also help to clarify the issues:
RC-type servos generally have three connections:
Black. This must be connected to the common ground/0v. (Common, that is, to the servo, the Arduino, the Pi and the power supply / battery.
Red. This is where the servo gets its power from and it should be connected to the positive side of the (4.5-6v) supply.
You should not connect this line to the 5v output on either the Arduino or the Pi - these boards have on-board voltage regulators which cannot supply the current the servo will need.
White or yellow. This is the signal input: it will be connected to an output port on the Arduino or the Pi. Power is not an issue with this connection - it draws very little current. The 5v signal from an Arduino output port will control the servo quite satisfactorily. I don't know whether the 3.3v signal level from the Pi will be adequate to control the servo - my guess is that it will, but I haven't tried it.
Some people would argue that the servos should have their own, separate battery, since they generate a lot of electrical noise. I can only say that in my limited experience that hasn't been a problem.
I hope some of this helps.