I am working on a multi servo project using the Arduino Zero. I want to be able to switch the servos on and off from the Arduino code and intend to implement this using a transistor and relay as in the attached diagram.
The power source is 12v wired supply (no batteries) which I intend to plug into the arduino jack and access via VIN. The 12v will then be separately stepped down to 7.4v and 6v for different servos.
The 3v relay is switched using a transistor and the 3.3v output from the arduino zero board.
Obviously the diagram is not showing the PWM signal wires.
I would appreciate any comments on whether this is the best setup, especially as I have some expensive servos here that I don't want to damage.
In particular I have a couple of questions:
Given it's only 12v being switched, do I actually need the relay at all or can a transistor alone do this?
Am I fine accessing the 12v from the arduino VIN pin, or is there any reason I should access it from the supply before it goes into the arduno to reduce load on the arduino?
Should this setup reliably keep the servos off when the board is powered up until the control pin is set to HIGH?
Should i consider adding capacitors for the servos, or is the need for these eliminated by using the external power?
Will there be any problem controlling servos on two separate voltages from the PWM outputs on one board? My understanding is this is fine since the grounds are all connected.
Hello everyone. I thought I'd post back to this topic with a related question. I have a working implementation of the above circuit (http://i.imgur.com/Y8jDcCv.png). It's basically working, the only problem is that when the power is introduced the servos inevitably jolt very harshly to whatever position they are being given. This is inevitable because it's impossible to stop them from moving slightly when the power is switched off (I'm working with a robotic arm, so gravity does its work).
I would like to have them smoothly restore the position when switched on. I don't think this can be done with the code because there's no way of 'reading' the servo position at the point the power is reintroduced. So instead I was wondering whether I could smoothly introduce the voltage when the power comes on, so that the servos move gradually to their position as they reach full power. I have two questions on this:
is this wise/could it damage the servos? I.e. if the servos are designed for 6-7v, could a rising voltage between 0 and 7 do damaage in the 0-6v range?
what would be the be the recommended way of adapting the above circuit to achieve this?
If this isn't a good idea, how else might I achieve my objective?
Yes, cheap hobby servos don't allow you to do this. If you bring the voltage up slowly nothing will happen
until the servo gets enough voltage to be working, then it will immediately move to the target position, that's
all its designed to do.
More complex and expensive robotics servos may have such a feature, certainly the ability to read the
current actual position is available I believe.
You can get servos with a fourth wire so you can read the internal pot with analogRead() and set servo.write() to the current position before attaching.