Skip to content

nulllaborg/4_digit_clock_display_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

VK16K33 4-Digit 7-Segment Display Module

Table of Contents

  1. Product Overview
  2. Module Parameters
  3. Pinout Definition
  4. Hardware Design and Schematics
  5. Arduino Programming Guide

Product Overview

0.4 inch

loading-ag-266

0.8 inch

The VK16K33 is a multi-function LED driver control device with a memory mapping feature. It is designed to drive a 4-digit 7-segment clock display. By using the I2C (Two-Wire) bus interface, it significantly reduces the number of MCU pins required for numeric display tasks.

  • Integrated Chip: VK16K33 (High-performance LED driver).

  • Interface: Standard I2C serial communication.

  • I2C Address: 0x70.

Module Parameters

Parameter Specifications
Operating Voltage 5V DC
Communication I2C Protocol (SDA, SCL)
I2C Address Default 0x70 (Configurable via solder pads)
Dimensions 38.4 x 22.4 mm
Mounting 4 x M3 screw holes (33.4 x 17.4 mm spacing)

Pinout Definition

The module features a 4-pin header for easy connection:

Pin Label Name Description
G GND Ground (Negative Power Supply)
V VCC 5V Power Supply Input
SDA SDA I2C Serial Data line
CLK SCL I2C Serial Clock line

Hardware Design and Schematics

loading-ag-295

Schematics

loading-ag-297

Click here view schematics

3D Files

Download VK16K33 3D files

Arduino Programming Guide

Download Libs and Examples for VK16K33 Display Module

Example

1. Displaying Integers

#include <Arduino.h>
#include <Wire.h>

// Include header file: digit_display.h
#include "digit_display.h"

// Initialization,i2c address 0x70 (DigitDisplay::kDeviceI2cAddress)
DigitDisplay digital_display(DigitDisplay::kDeviceI2cAddress);

void setup() {
  Serial.begin(115200);

  // Initialization: This will also clear any existing content on the display
  digital_display.Setup();
  // Set brightness level to 15 (Range: 0 - 15, where higher values are brighter)
  digital_display.SetBrightness(15);
}

void loop() {
  // Display decimal value 9876 (Default: Base 10)
  digital_display.ShowNumber(9876);
  delay(1000);

  // Display negative decimal value -123
  digital_display.ShowNumber(-123);
  delay(1000);

  // Display value 1000 in Hexadecimal format (using DigitDisplay::kHex)
  digital_display.ShowNumber(1000, DigitDisplay::kHex);
  delay(1000);

  // Display value 0xABCD in Hexadecimal format
  digital_display.ShowNumber(0xabcd, DigitDisplay::kHex);
  delay(1000);

  // Error Handling: If an integer exceeds 4 digits (e.g., 10000), 
  // the display will show "----" to indicate an overflow.
  digital_display.ShowNumber(10000);
  delay(1000);

  // Clear the display content (turn off all segments)
  digital_display.Clear();
}

2. Displaying Decimal

#include <Arduino.h>
#include <Wire.h>

// Include header file: digit_display.h
#include "digit_display.h"

// Initialization,i2c address 0x70 (DigitDisplay::kDeviceI2cAddress)
DigitDisplay digital_display(DigitDisplay::kDeviceI2cAddress);

void setup() {
  Serial.begin(115200);

  // Initialization: This will also clear any existing content on the display
  digital_display.Setup();
  // Set brightness level to 15 (Range: 0 - 15, where higher values are brighter)
  digital_display.SetBrightness(15);
}

void loop() {
  // Display float 12.34: Defaults to 2 decimal places; excess digits will be rounded
  digital_display.ShowNumber(12.34);  
  delay(1000);

  // Display negative float -12.34: Defaults to 2 decimal places with rounding
  digital_display.ShowNumber(-12.34);  
  delay(1000);

  // Display 12.34 with 1 decimal place: Specified precision; excess digits are rounded
  digital_display.ShowNumber(12.34, 1);  
  delay(1000);

  // Display 12.34 in Hexadecimal format: Defaults to 2 decimal places with rounding
  digital_display.ShowNumber(12.34, DigitDisplay::kHex);  
  delay(1000);

  // Display 12.34 in Hexadecimal with 1 decimal place precision and rounding
  digital_display.ShowNumber(12.34, DigitDisplay::kHex, 1);  
  delay(1000);

  // Overflow Handling: If the integer part exceeds 4 digits after rounding (e.g., 9999.99 -> 10000), 
  // it cannot be displayed and will show "----"
  digital_display.ShowNumber(9999.99);  
  delay(1000);

  // Clear the display content
  digital_display.Clear();  
  delay(1000);
}

3. Positional Digit Control

#include <Arduino.h>
#include <Wire.h>

// Include header file: digit_display.h
#include "digit_display.h"

// Initialization,i2c address 0x70 (DigitDisplay::kDeviceI2cAddress)
DigitDisplay digital_display(DigitDisplay::kDeviceI2cAddress);

void setup() {
  Serial.begin(115200);

  // Initialization: This will also clear any existing content on the display
  digital_display.Setup();
  // Set brightness level to 15 (Range: 0 - 15, where higher values are brighter)
  digital_display.SetBrightness(15);
}

void loop() {
  // ShowDigitNumber(Position, Number, ShowDecimalPoint)

  // Display '1' at index 0 (Leftmost digit), Decimal Point: OFF
  digital_display.ShowDigitNumber(0, 1, false);
  // Display '2' at index 1, Decimal Point: ON (shows as "2.")
  digital_display.ShowDigitNumber(1, 2, true);
  // Display '3' at index 2, Decimal Point: OFF
  digital_display.ShowDigitNumber(2, 3, false);
  // Display '4' at index 3 (Rightmost digit), Decimal Point: ON (shows as "4.")
  digital_display.ShowDigitNumber(3, 4, true);
  delay(500);

  digital_display.Clear();
  delay(500);
}

4. Show or Hide Colon

#include <Arduino.h>
#include <Wire.h>

// Include header file: digit_display.h
#include "digit_display.h"

// Initialization,i2c address 0x70 (DigitDisplay::kDeviceI2cAddress)
DigitDisplay digital_display(DigitDisplay::kDeviceI2cAddress);

void setup() {
  Serial.begin(115200);

  // Initialization: This will also clear any existing content on the display
  digital_display.Setup();
  // Set brightness level to 15 (Range: 0 - 15, where higher values are brighter)
  digital_display.SetBrightness(15);
}

void loop() {
  // Enable the central colon display (Useful for clock applications)
  digital_display.ShowColon(true);

  // Display the number 1234
  digital_display.ShowNumber(1234);
  delay(500);

  // Disable/Hide the central colon
  digital_display.ShowColon(false);
  delay(500);
}

5. Blink Rate

#include <Arduino.h>
#include <Wire.h>

// Include header file: digit_display.h
#include "digit_display.h"

// Initialization,i2c address 0x70 (DigitDisplay::kDeviceI2cAddress)
DigitDisplay digital_display(DigitDisplay::kDeviceI2cAddress);

void setup() {
  Serial.begin(115200);

  // Initialization: This will also clear any existing content on the display
  digital_display.Setup();
  // Set brightness level to 15 (Range: 0 - 15, where higher values are brighter)
  digital_display.SetBrightness(15);
}

void setup() {
  Serial.begin(115200);
  digital_display.Setup();

  digital_display.SetBrightness(15);

  /** * Enable the blink feature and set the frequency to 2Hz.
   * 2Hz means the display will flash twice per second.
   * Note: The blink feature is disabled by default.
   */
  digital_display.SetBlinkRate(DigitDisplay::kBlinkRate2Hz);
}

void loop() {
  // Display the number 8888 (The entire display will blink at 2Hz)
  digital_display.ShowNumber(8888);
}

Download ESP32 Micropython Example

Download Microbit Micropython Example

emakefun-makecode-extensions/emakefun_vk16k33

Click Here View Makecode Example

About

vk16K33 digit clock display module

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors