The Adafruit 12-Channel 16-bit PWM LED Driver is an electronic component designed for controlling multiple LEDs with high precision. Utilizing the Serial Peripheral Interface (SPI) for communication, this driver can manage up to 12 individual channels, making it ideal for complex lighting projects, including architectural lighting, digital signage, and custom LED installations. With its 16-bit PWM resolution, it offers fine-grained control over the brightness and color of each connected LED, enabling smooth transitions and a wide range of dimming options.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (2.7V - 5.5V) |
2 | GND | Ground connection |
3 | SCLK | SPI Clock input |
4 | MOSI | SPI Master Out Slave In data input |
5 | ~OE | Output enable (active low) |
6 | ~LAT | Latch input (active low) |
7-18 | OUT0 - OUT11 | LED output channels |
19 | ~RST | Reset input (active low) |
#include <SPI.h>
// Define the SPI pins for Arduino UNO
const int latchPin = 10; // ~LAT pin
const int oePin = 9; // ~OE pin
void setup() {
// Set pins to output
pinMode(latchPin, OUTPUT);
pinMode(oePin, OUTPUT);
// Begin SPI communication
SPI.begin();
// Disable output to start
digitalWrite(oePin, HIGH);
}
void loop() {
// Enable output
digitalWrite(oePin, LOW);
// Start SPI transaction
SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
digitalWrite(latchPin, LOW);
// Send PWM data for each channel (example values)
for (int i = 0; i < 12; i++) {
SPI.transfer(highByte(65535)); // Send the high byte
SPI.transfer(lowByte(65535)); // Send the low byte
}
// Latch the data onto the output pins
digitalWrite(latchPin, HIGH);
SPI.endTransaction();
// Disable output
digitalWrite(oePin, HIGH);
// Wait before updating again
delay(1000);
}
Q: Can I chain multiple LED drivers together? A: Yes, you can chain multiple drivers by connecting the MOSI output of the first driver to the MOSI input of the next driver, and so on.
Q: How do I adjust the current output for each channel? A: The current output can be adjusted through external resistors connected to the driver or by using the driver's internal registers if available.
Q: What is the maximum number of LEDs I can connect to each channel? A: The maximum number of LEDs per channel depends on the LEDs' forward voltage and the driver's maximum output voltage. Ensure the total forward voltage does not exceed the driver's limit.