PWM outputs

How can i have 18 pwm outputs using Arduino Uno? i know that The Arduino Uno has only 6 PWM outputs but i'm lookink for a external circuit to add in order to solve the problem.

Use WS2803, buy on e-bay from company in Niagara Falls. 18 channels of PWM output. Sinks current, intended for driving LEDs.

If the PWM doesn't need to be too fast, can create the outputs in software. Browse for my post "piano tones micros" for an example where I created 13 outputs using micros for timing. You can do similar; get rid of the button pushes, enable the outputs all the time, use add some code to read serial port and update the frequency array with the desired 1/2 periods.

Nb:I need that to controll 18 servo Motors

toto10900: Nb:I need that to controll 18 servo Motors

You don't use Arduino PWM (analogWrite() ) to control servos. You use the servo library. Servo signals are not limited to the Arduino PWM pins.


'328P chips support 12 servos.
For 18, you need a bigger chip.

48 on a '2560.

1284 - probably same as 328 as it has the same # of timers.

Looks like 6 servo’s per timer?
“The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins. On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.”

With that many servos to control, you might want to consider using a dedicated servo controller, such as the Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface