Requirements
- Arduino IDE: Version 1.8.13 or later
- Hardware: Arduino-compatible microcontroller (AVR, ARM, ESP32, etc.)
- Wire Library: Built-in; used for I2C controllers (included with Arduino IDE)
- Display Module: One of the supported LCD displays
Installation
Option 1: Arduino Library Manager (Recommended)
- Open Arduino IDE
- Go to Sketch → Include Library → Manage Libraries...
- Search for
SegLCDLib
- Click Install
Option 2: Manual Installation
- Download or clone: https://github.com/petrkr/SegLCDLib
- Copy the
SegLCDLib folder to your Arduino libraries folder:
- Windows:
Documents\Arduino\libraries
- macOS:
~/Documents/Arduino/libraries
- Linux:
~/Arduino/libraries
- Restart Arduino IDE
First Project: 4-Digit Display with Degree Symbol (HT1621)
This example uses the 4-digit LCD with degree symbol (integrated HT1621 controller). This is a ready-made module commonly found on AliExpress, no soldering needed.
Wiring
Connect 3 GPIO pins and power to your Arduino:
| Module Pin | Arduino Pin |
| CLK | Pin 5 |
| DATA | Pin 6 |
| CS | Pin 7 |
| VCC | 3.3V |
| GND | GND |
Note: Adjust pins 5, 6, 7 if they conflict with other components.
Code
void setup() {
lcd.init();
}
void loop() {
int temp = 23;
lcd.setCursor(0, 0);
lcd.print(temp);
lcd.showDegree();
delay(1000);
}
HT1621 driver for 4-digit LCD with degree symbol and colon.
4-digit 7-segment LCD with degree symbol and colon (HT1621).
Definition SegLCD_HT1621_4SegDegree.h:19
Running
- Select your board: Tools → Board → Choose your Arduino
- Select COM port: Tools → Port
- Upload: Sketch → Upload (Ctrl+U)
- Display should show "23°" with degree symbol
Choosing Your LCD Display
Use this table to find the right display for your project:
| Your Need | Controller | LCD Module | Wiring |
| Simplest | PCF85176 | RAW LCD | I2C only |
| Show digits | PCF85176 | 6-digit with battery/signal | I2C, 4 pins |
| Temperature | PCF85176 | Temp/Humidity | I2C, 4 pins |
| Small display | HT1621 | 4-digit with degree | 3 pins |
| Many digits | HT1621 | 6-digit with battery | 3 pins |
| 16-segment | HT1622 | 10-digit 16-segment | 3 pins |
| Advanced | VK0192 | 5-digit with battery | 3 pins |
For detailed specifications and purchase links, see Supported LCDs.
Basic API Reference
Display Control
lcd.init();
lcd.clear();
lcd.on();
lcd.off();
lcd.home();
Positioning and Output
lcd.setCursor(row, col);
lcd.print(value);
lcd.write(byte);
Features (display-dependent)
lcd.setBattery(level);
lcd.setSignal(bars);
lcd.showDegree();
See Architecture for class hierarchy and full API Reference for complete method documentation.
Common Issues
Display not showing:
- Verify I2C address: Use example sketch
PCF85176/RawLCD to scan addresses
- Check wiring: SDA, SCL, VCC, GND connections
- Confirm board selection and COM port in Arduino IDE
Wrong I2C address:
- PCF85176 I2C address is set by SA0 pin: 0x38 (SA0=0) or 0x39 (SA0=1)
- A0-A2 are subaddresses in the protocol, not I2C address pins
- HT1621/HT1622/VK0192 use 3-wire serial (no I2C address)
Library not found:
- Restart Arduino IDE after installation
- Verify installation path: Check
Arduino/libraries/SegLCDLib/ exists
Next Steps
Resources