A PWM chip is a dedicated integrated circuit that generates precise pulse-width modulated signals to control power delivery to loads like LEDs or servos, independent of the main microcontroller's CPU. When you run out of hardware timer pins on an Arduino Nano or need to drive 16 high-power LEDs without flickering, you stop relying on the MCU's internal timers and add a dedicated silicon brain for the job. Instead of your microcontroller firing thousands of interrupts per second to toggle GPIO pins, a pwm chip handles the square-wave generation locally, freeing up your processor for actual logic.
What a PWM Chip Actually Does (And What It Doesn't)
In a real circuit, adding a dedicated PWM driver fundamentally changes the timing architecture. It shifts the timing burden from the microcontroller's CPU to the peripheral IC. Instead of the ESP32 managing microsecond-level toggle delays, the MCU sends a single I2C or SPI command (e.g., "set channel 4 to 50% duty cycle"). The PWM chip's internal oscillator and registers handle the actual waveform generation continuously, even if the MCU goes to sleep or gets busy handling WiFi stack operations.
What people commonly confuse it with: Makers frequently confuse constant-voltage PWM drivers with constant-current PWM drivers. A constant-voltage chip (like the ubiquitous NXP PCA9685) simply switches the supply rail on and off; if you connect LEDs to it, you still need external current-limiting resistors. A constant-current PWM chip (like the Texas Instruments TLC5940) actively regulates the milliamp output per channel using internal current sinks. This eliminates the need for resistors and ensures uniform brightness across varying LED forward voltages.
The Math: Resolution, Frequency, and Duty Cycle
To use a PWM chip effectively, you need to understand how its bit-resolution translates to physical movement or light output. Let's look at a worked numeric example using the 12-bit PCA9685 to drive a standard hobby servo.
Standard RC servos expect a 50 Hz signal, which means a total period of 20 ms. The pulse width dictates the position: typically 1 ms for 0 degrees and 2 ms for 180 degrees. Because the PCA9685 uses 12-bit resolution, it divides each period into 4,096 discrete steps.
20 ms / 4096 steps = 0.00488 ms (4.88 µs) per step.
1 ms (0°) / 0.00488 ms = 205 steps
2 ms (180°) / 0.00488 ms = 410 steps
This means you only have 205 discrete positions (410 - 205) across the entire 180-degree sweep. If you need finer control for a robotic arm joint, you must either increase the PWM frequency (which breaks standard servo compatibility) or use a mechanical gear reduction. This hard mathematical limit is why 12-bit resolution is perfect for servos but sometimes inadequate for ultra-smooth, high-end LED fading at very low brightness levels.
Where You Meet This in Practice
You will typically reach for an external PWM IC in three specific scenarios:
- High-Channel Robotics: Hexapods, robotic arms, or animatronics requiring 12 to 18 servos. An ESP32 has plenty of pins, but routing that many hardware timer channels without causing interrupt conflicts is a software nightmare.
- Architectural LED Lighting: Driving RGBW strips or under-cabinet pods where you need high-frequency (>1 kHz) dimming to avoid camera flicker, and you want to offload the SPI/I2C translation to a dedicated chip.
- High-Power Motor Control: Using the PWM chip to drive the EN (Enable) pin on a high-power motor driver like the BTS7960. This isolates the noisy, high-current motor environment from your sensitive microcontroller logic pins.
Bench Scenario: Driving 16 Servos on an ESP32
Here is a real-world walkthrough of a common failure mode when scaling up with a PWM chip.
The Setup: An ESP32 DevKit V1 connected via I2C (GPIO 21/22) to a generic blue PCA9685 breakout board. The board is driving 16x MG996R metal-gear servos, powered by a 5V 10A switching power supply plugged into the board's barrel jack.
The Numbers: An MG996R draws about 20 mA at idle but spikes to ~1.2A at stall. If all 16 servos start moving simultaneously under load, the theoretical peak draw is 19.2A. Our supply is rated for 10A continuous.
The Outcome: The ESP32 boots, the I2C scanner finds the chip at address 0x40, and servos 1 through 8 sweep smoothly. But when the code commands servos 9 through 16 to sweep simultaneously, the ESP32 instantly brownouts and reboots.
What Went Wrong: Two distinct hardware failures occurred. First, the PCB traces on cheap clone breakout boards and the 2.1mm barrel jack are only rated for about 4 to 5 amps continuous before they overheat and act as fuses. Second, the massive transient current draw caused a severe voltage sag on the 5V rail. This sag pulled the input to the ESP32's onboard 3.3V LDO below its dropout threshold, triggering a brownout reset.
The Fix:
- Cut the V+ jumper trace on the back of the PCA9685 board (if using a shield) or simply ignore the barrel jack.
- Solder heavy 16 AWG silicone wire directly to the V+ and GND green screw terminal blocks on the PCA9685.
- Feed those thick wires straight from the 5V 10A power supply, completely bypassing the breakout board's internal power routing.
- Solder a 470µF electrolytic capacitor directly across the ESP32's 5V and GND header pins to act as a local energy reservoir, riding out the transient microsecond sags when the servos stall.
Choosing the Right PWM IC for Your Build
Selecting the wrong PWM chip is the most common reason projects fail at the prototype stage. Use this matrix to pick the right silicon for your load.
| IC Model | Output Type | Interface | Resolution | Best Application | Approx. Cost (2026) |
|---|---|---|---|---|---|
| PCA9685 | Constant Voltage | I2C (Up to 1MHz) | 12-bit | Servos, relays, logic-level MOSFET gates | $12 (Breakout) / $1.50 (Raw IC) |
| TLC5940 | Constant Current (120mA) | SPI / Serial | 12-bit | High-power LED matrices, RGB strips | $15 (Breakout) / $3.50 (DIP IC) |
| LP5523 | Constant Current (30mA) | I2C | 8-bit | Wearables, PCB indicator LEDs | $2.50 (Raw IC) |
| TCA9539 | GPIO Expander (Software PWM) | I2C | N/A (Bit-banged) | Simple on/off relays, low-speed fans | $8 (Breakout) / $1.20 (Raw IC) |
FAQ: PWM Chip Debugging
Q: Why are my servos jittering randomly even though I'm using a dedicated hardware PWM chip?
A: Jitter on a hardware PWM chip is almost never a timing issue; it is a power or signal integrity issue. Check your I2C bus. If you are using long wires between the ESP32 and the PCA9685 without pull-up resistors, electromagnetic interference from the servo motors will corrupt the I2C packets, causing the chip to receive garbage duty-cycle values. Add 4.7kΩ pull-up resistors to the SDA and SCL lines, and keep I2C runs under 30 cm.
Q: Can I use a PCA9685 to dim 12V LED strips directly?
A: No. The PCA9685 outputs are limited to the VCC voltage (usually 5V) and can only sink about 25mA per pin. To dim a 12V LED strip, you must use the PCA9685's output pins to drive the gate of a logic-level N-channel MOSFET (like the IRLZ44N), which then switches the 12V power to the LED strip.
Q: My TLC5940 constant-current chip is getting incredibly hot. Is it broken?
A: Not necessarily. Constant-current LED drivers like the TLC5940 dissipate excess voltage as heat. If your power supply is 12V but your LED forward voltage is only 3V, the chip must burn off the remaining 9V as heat per channel. Multiply that by 16 channels, and the IC will easily exceed 100°C. Lower your supply voltage to match the LED forward voltage plus a 0.5V headroom, or attach a heatsink to the IC's exposed thermal pad.
Q: Do I need to initialize the PWM chip every time the ESP32 wakes from deep sleep?
A: Yes. When the ESP32 enters deep sleep, the I2C bus powers down. While some PWM chips retain their register states if VCC remains powered, it is best practice to send the reset and initialization sequence (setting the prescaler for your desired frequency) in your setup() function every time the MCU wakes up to ensure predictable behavior.






