AW9523 16-bit I/O expander and LED driver with ESP32
Supply 3.3-5 V
Bus I2C
I2C address
0x58 / 0x59 / 0x5A / 0x5B
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| VIN | Power | 3V3 | 2.5 to 5.5 V |
| GND | Ground | GND | |
| SCL | I2C clock (SCL) | D22 | |
| SDA | I2C data (SDA) | D21 | |
| INT | Interrupt | D35 | Interrupt output, optional |
| RST | Not wired to the ESP32 | — | Reset, active LOW, pulled up. Leave unconnected |
| AD0 | Not wired to the ESP32 | — | Address bit, default LOW |
| AD1 | Not wired to the ESP32 | — | Address bit, default LOW |
| P0_0 | Not wired to the ESP32 | — | Expander I/O: to your LEDs or buttons, not to the ESP32 |
| P0_1 | Not wired to the ESP32 | — | |
| P0_2 | Not wired to the ESP32 | — | |
| P0_3 | Not wired to the ESP32 | — | |
| P0_4 | Not wired to the ESP32 | — | |
| P0_5 | Not wired to the ESP32 | — | |
| P0_6 | Not wired to the ESP32 | — | |
| P0_7 | Not wired to the ESP32 | — | |
| P1_0 | Not wired to the ESP32 | — | |
| P1_1 | Not wired to the ESP32 | — | |
| P1_2 | Not wired to the ESP32 | — | |
| P1_3 | Not wired to the ESP32 | — | |
| P1_4 | Not wired to the ESP32 | — | |
| P1_5 | Not wired to the ESP32 | — | |
| P1_6 | Not wired to the ESP32 | — | |
| P1_7 | Not wired to the ESP32 | — |
Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.
Check it is the real chip
Read register 0x10: a genuine part answers 0x23. BoardPilot does this automatically in “Debug a problem”.
Starter code (Arduino)
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
Wire.beginTransmission(0x58);
bool found = Wire.endTransmission() == 0;
Serial.println(found ? "AW9523 16-bit I/O expander and LED driver found at 0x58" : "Not found: check power, GND and SDA/SCL");
}
void loop() {}
Sources
- Awinic AW9523B datasheet, Address 10110 AD1 AD0 (0x58 to 0x5B); ID register 0x10 reads 0x23; constant-current LED mode
- Adafruit AW9523 GPIO expander and LED driver guide, Pinouts. Check the silkscreen for the header order
Try it in 3D in BoardPilot
Related parts
AT24C256 I2C EEPROM moduleDRV2605L haptic motor driver (I2C)MB85RC256V I2C FRAM breakout (32 KB)MCP23008 8-bit I/O expander (DIP-18)MCP23017 16-bit I/O expanderMCP4725 12-bit DAC breakout
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.