I am wondering if I can control 20 different servo motors with only a single Arduino Uno board. My motors must be able to rotate in both directions and I also should be able to define the speed for each of them independently. Also I am able to use integrated circuits or a device that connects to my Arduino board.

Is this a possible scenario?

  • Surely you can implement it using shift registers to effectively increase your pin count? – Makoto Nov 3 '16 at 15:16
  • @Makoto Will I be able to control any of my pins independently using shift registers ? Lets say I want 2,7 and 16th pin to be high and others low. Will I be able to do this ? It always confuses me to be able to do these kind of things with only controlling couple pins. – 0014 Nov 3 '16 at 15:21
  • Yes, shift registers usually have a memory stage and an output stage. You can shift the levels you want in to the memory and then latch all of them to the output at the same time. You can also do this fast enough to pwm each pin independently – Makoto Nov 3 '16 at 15:23
  • You may modify Servo.h with #define SERVOS_PER_TIMER 20 and attach a servo to every single pin of your Uno – which may give slightly jerky movements due to the high CPU load. Or you may use another chip just to drive the servos. Or you could use another Arduino/ATmega/ATtiny and volunteer to test my Tiny Servo Controller program. – Edgar Bonet Nov 9 '16 at 9:12
  • You could use GPIO expanders like the MCP23008. Very easy to use over an I2C bus and you can have 4 of them per bus, or you could use the 16 bit version. – Code Gorilla Nov 9 '16 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy