Quick refresher on servo control: High pulses are 20ms apart and last between 1ms and 2ms.

I know this could be done with a microprocessor very easily, but I want to do it without one because the power supply is shared with the drive engine and spikes that would disturb the processor might occur. Other than that, the circuit is provided with stabilized +5V.

I need a circuit that would check if the incoming servo signal is in a given range (1,7-1,8ms), if it is, the output is to be High, if it is not, then Low. Idealy it would also hold the High for about 0,5s after the pulses are out of range, to ensure that the output is High for a while even if the pulse length is rapidly changing, however that is not a requirement.

The circuit doesn't have to be super precise, as it is only meant for cosmetic enhancement and not crucial functionality of any kind.

Also, this question could use a length-related tag, I have no right to create them and found no existing ones.

  • 1
    \$\begingroup\$ A length-related tag? To signify what, exactly? \$\endgroup\$
    – Finbarr
    Nov 6, 2017 at 18:06
  • 2
    \$\begingroup\$ While you can do this in various analog ways, or with some discrete digital logic, in reality it will be easier to make a processor-based solution tolerate likely signal issues. Just design it right, with filtered power, couple the signal through a resistor and diode clamps, etc. \$\endgroup\$ Nov 6, 2017 at 18:10
  • \$\begingroup\$ I agree, there's no reason an MCU design would be unstable if designed correctly. On that note, I just answered about controlling servos here: electronics.stackexchange.com/questions/337931/… \$\endgroup\$ Nov 6, 2017 at 19:06
  • \$\begingroup\$ length-related to signify that I'm interrested in the length of the pulse \$\endgroup\$ Nov 7, 2017 at 6:39

1 Answer 1


If you have spikes that would disturb a micro, they will probably disturb any digital logic circuit. You'll need to clean those up into any circuit. Your best bet is probably a linear regulator from a 5V source and step the voltage down to 3.3V. This 1.7V headroom will allow the linear regulator to absorb any of the transient spikes and keep a clean 3.3V output.

That being said, whenever I use logic I like to make it programmable. That way, in case I make a mistake, it's just a fix in the program. You can get eval boards for different programmable logic chips that probably have a linear regulator as part of the board. You didn't mention if this was a one-off or if you're meaning it for any sort of mass production - that will drive the solution.

If it is a one-off, Lattice makes a $35 eval board that is in stock at Digi-key. You would have to learn their GUI & how to program the chip, but in the end it might be easier than wiring up a bunch of counters, clocks, latches, and comparators. Here's a link to that: https://www.digikey.com/product-detail/en/lattice-semiconductor-corporation/LCMXO2-7000HE-B-EVN/220-2625-ND/3906092

If you'd rather go the hard-logic route, it gets more difficult. You'll need a low-frequency clock (100kHz?) that you would tie into a clock input on a counter. Then your PWM signal gets tied into the count-enable pin. Basically when your PWM signal goes high, you start counting, then when it goes low, you stop. This latched-in value is fed into a comparator, and if it falls in the right range, you output that signal to an LED or some other down-stream logic. Of course, it is more complicated than this, because you also have to reset the counter after your count value gets latched in. Lots of little details to work out, which is why I prefer programmable logic.

Hope this helps - perhaps if you let us know what you're more comfortable with (discrete logic vs. programmable) we can set you on a good path.

  • \$\begingroup\$ It is a one off, I was contemplating using Picaxe as I have the equipment and processors, but from my experience with another circuit installed in the same model (only taking input from different channel that this one would and acting funky when current in circuit changed quickly (sudden full throttle), I assume the stabilizer just couldn't keep up) I wanted something more stable. Other than that, I'm a programmer and have no major problem with programming as such. \$\endgroup\$ Nov 7, 2017 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.