meta data for this page
lamaPLC: HT16K33 display controller
The HT16K33 is a memory-mapped, multi-function LED controller driver. The device supports a maximum of 128 display segments (16 segments and 8 commons) and a 13×3 Maximum matrix key scan circuit. The software-configurable features of the HT16K33 make it suitable for a wide range of LED applications, including LED modules and display subsystems. The HT16K33 is compatible with most microcontrollers and communicates via a two-line bidirectional I²C bus.
HT16K33 IC Feature
- Operating voltage: 4.5V–5.5V
- Integrated RC oscillator
- I²C-bus interface
- 16×8-bit RAM for display data storage
- Max. 16×8 patterns, 16 segments, and eight commons
- R/W address auto-increment
- Max. 13×3 matrix key scanning
- 16-step dimming circuit
- Supports 20/24/28-pin SOP package types
I²C addressing
The base I²C address for an HT16K33 is 0x70, but it can be changed to one of seven other addresses by setting the four address pins (A0-A3) via hardware. Each HT16K33 chip can have a unique address from 0x70 to 0x77. If multiple HT16K33 devices are used on the same bus, each must have a distinct address, and if you use more than one, their addresses must be sequential, such as 0x70, 0x71, 0x72.
If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.
Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.
Schema
Arduino Wiring Diagram
The HT16K33 uses standard I²C pins. Connect your display as follows:
| HT16K33 Pin | Arduino Uno Pin | Arduino Mega Pin | Description |
|---|---|---|---|
| VCC | 5V | 5V | Power (4.5V–5.5V) |
| GND | GND | GND | Ground |
| SDA | A4 | 20 | Serial Data |
| SCL | A5 | 21 | Serial Clock |
Required Libraries
You will need two libraries from Adafruit:
- Adafruit LED Backpack Library
- Adafruit GFX Library
Install these via the Arduino Library Manager (Tools > Manage Libraries…).
Arduino Example Code
This sketch demonstrates basic numeric display and colon control using the Adafruit_LED_Backpack library.
#include <Wire.h> #include <Adafruit_GFX.h> #include "Adafruit_LEDBackpack.h" // Create the display object (Default I2C address is 0x70) Adafruit_7segment matrix = Adafruit_7segment(); void setup() { matrix.begin(0x70); // Initialize with I2C address matrix.setBrightness(10); // Set brightness from 0 to 15 } void loop() { // 1. Display a whole number matrix.print(1234, DEC); matrix.writeDisplay(); delay(2000); // 2. Display a floating point number matrix.print(12.34); matrix.writeDisplay(); delay(2000); // 3. Simple Counter with blinking colon for (uint16_t counter = 0; counter < 100; counter++) { matrix.println(counter); matrix.drawColon(counter % 2 == 0); // Blink colon every other tick matrix.writeDisplay(); delay(200); } }
Sources
I²C topics on lamaPLC
This page has been accessed for: Today: 4, Until now: 5



