I'm trying to control 8 servos (tower pro sg90 micro servo) using a shift register (74hc595) . I planned on giving the pwm and ground pins common to all the motors and then controlling vcc via the shift register. The IC by itself cannot drive the motor so I need a make an additional drive circuit to power the motors via the output pins of the shift register. I was thinking of using a simple transistor switch. What transistor would be cheapest and best to drive the servo ?. Would it be better to just use a 5V relay controlled by the shift register ?. Will the shift register provide enough current to the coils of the relay ?

I only need to control one servo at a time. Also I only have very few pins left on the arduino.

  • \$\begingroup\$ Look around the site for one on the zillions of questions on driving relays from digital circuits. It isn't hard, but if you do it wrong you can destroy whatever is generating the switch signal. \$\endgroup\$
    – JRE
    Apr 1, 2017 at 9:56
  • \$\begingroup\$ As @Michael mentions, servos don't hold position if turned off or not receiving the PWM signal. \$\endgroup\$
    – JRE
    Apr 1, 2017 at 9:57
  • \$\begingroup\$ "I'm trying to control 8 servos (tower pro sg90 micro servo) using a shift register (74hc595)." Certainly doable: by controlling the value sent to the shift register. but there are other ways to do what you want to do, without the use of a shift register. one approach I favor is here: dannyelectronics.wordpress.com/2017/02/18/… The load on the cpu is minimal, and the only limitation here is the servo characteristics - the link above provides a few variations. \$\endgroup\$
    – dannyf
    Apr 1, 2017 at 11:46
  • \$\begingroup\$ apparently there are power logic shift registers with greater drive capability, also a simple npn transistor switch did the trick , thanks for all the help people. \$\endgroup\$ Apr 2, 2017 at 14:09

1 Answer 1


While you may only need to control one servo at a time, are you sure you don't need to hold all the servos, all the time?

A PWM expander will give you independent control of many PWM channels over I2C.

  • \$\begingroup\$ if by hold you mean 'not moving' them , then won't not giving power to the pin do the job ? \$\endgroup\$ Apr 1, 2017 at 11:29
  • \$\begingroup\$ @PaulsonPaul it depends how you're loading your servos. if they have to resist a load, removing power means they can no longer produce a torque to hold a load. The only torque keeping the servo in place is the friction in the gearbox. I've just recommended a very conventional and convenient way to control all your servos. It's definitely not the cheapest, but possibly the easiest. \$\endgroup\$
    – Michael
    Apr 1, 2017 at 23:15

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.