2

I am currently working on a robotics project that requires 16 PWM outputs to control 16 servos. Is it possible to use Arduino Uno's digital pins as PWM output pins through code?

If it is not possible, what microcontrollers do you suggest to use on such a project?

2
  • 6
    “The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega.” Commented Jan 29, 2018 at 14:32
  • 3
    You can get a PCA9685 servo controller card to multiplex 16 servos through I2C. e.g.: adafruit.com/product/815
    – Dave X
    Commented Jan 29, 2018 at 14:35

2 Answers 2

2

Only specific Digital Pins marked with ~PWM can generate a PWM signal. In the case of arduino Uno the pins 3,5,6,9,10,11 are all hardware PWM driven, and are marked on the Uno with a ~ or something. Others can be driven with software PWM(though I wouldn't recommend it). As the Arduino Uno uses the ATMEGA328P, the number of pins is same with other boards using same processor.

On the other hand if you want to run 16pins for PWM, its best if you use Arduino MEGA 2560 because its processor supports more than 6 Hardware pins for PWM. Also you get the advantage of a higher memory storage for your code

0

PWM is not used to control servos. Servos need a pulse that is 1 to 2 ms wide, with 1.5 ms wide being the center position, that occur every 20 ms (50 Hz).

A 2560 has enough timers and the library to control up to 48 servos.

1
  • 1
    It is a form of PWM, though not the PWM generated by analogWrite(). Commented Feb 8, 2018 at 8:31

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.