2 State Analogue Servo Controller, possible?

I want a circuit that would toggle a mini servo from one fixed position to the other depending on a certain pin being set HIGH or LOW.

For example:
PIN X HIGH = SERVO 50 Degrees
PIN X LOW = SERVO 0 Degrees

I dont want to use a microcontroller, and was thinking along the lines of a 555 timer to generate the control signals. Can it be done? can someone point me in the right direction?

Cheers :slight_smile:

Should be easy. I would suggest two 555's (i.e., a 556) and some logic gates to switch between them.

Thanks for your help!

I understand i need to use two 555's and ive got the circuits from google, im a bit stumped on the Logic Gate part :~. Can you elaborate?

Look at reply 7 in Automatic Switcher - General Electronics - Arduino Forum


A single 555 can be made to change behaviour by adding a resistor to the RC timing
part of the circuit that goes to a CMOS logic signal - if the other end is HIGH the capacitor
will charge up faster, if low it will discharge faster - the tricky bit would be getting
it to only affect the pulse-on-time (though pulse rate isn't crucial so that might not matter).

Feed your 555 signals into two AND gates. On the one you want to activate the other input is high. On the one you don't want the signal is low, reverse that to switch signals. (An inverter on the input line will make that easy). Feed the outputs of the AND gates to an OR gate to get a single output .

The big problem with just using a logic gate output to switch timing on a 555 via the resistors is that when the resistor is pulled LOW, it makes timing difficult to calculate.

So use a diode in series with the extra resistor. Or use a PNP transistor as a high side switch, better because of the very low saturated VCE if designed/selected well.


R1 + R2 controls the ON time, the time that determines the servo position.
R2 merely controls the OFF time. It should be longer than the ON time, so we’ll use a diode to make it so only R1 controls ON time.

Put a diode in parallel with R2, cathode to pins 2 and 6 (triangle pointing down in the schematic above).

Now OFF time is about 0.7R2C1, and ON time is 0.7R1C1 (slightly longer because of the diode drop).

Then connect a diode, cathode to an incoming digital signal, anode to a resistor we’ll call R3, the other end of the resistor to the junction of R1, pin7, and R2. Now when the input signal is HIGH, R3 is placed in parallel with R1 so ON time is (slightly more than) equal to 0.7(R1//R3)C1. Where // means “in parallel with”.

Now you just need to figure out if the pulse must be longer or shorter for the servo positions you need, then calculate and adjust R1 and R3 accordingly. As a start, servo mid position is about 1.5ms, with 1ms and 2ms being the limits of travel (roughly, depending on the servo).

For time between pulses, OFF time 0.7R2C1, I’d go with about 10ms.

You could also do this by altering the voltage at pin 5, but that gets a bit more difficult, math-wise.

Hey everyone, thank you for your help!

In the end i just decided to use a Attiny85. Takes an input and pulses out the servo with ease :slight_smile:

When it makes little or no difference to the outcome, you go with what is simpler/easier/faster/cheaper for you. For quite a long time, a 555 timer would be the simpler method, now an ATTiny85 doesn't even require an external oscillator and so takes fewer parts by far.