Mirko Pavleski
Published © GPL3+

HPDL1414 Micro Clock

Small Retro-look Clock with HPDL1414 displays, as well as the way in which static and moving text can be written on it.

BeginnerFull instructions provided1,428
HPDL1414 Micro Clock

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
HPDL1414 , 14 segment Led Display
×2
DS3231M - ±5ppm, I2C Real-Time Clock
Maxim Integrated DS3231M - ±5ppm, I2C Real-Time Clock
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Schematic diagram

Code

Code with Scrolling text

Arduino
#include  <HPDL1414.h>
#include <RTClib.h>
#include <Wire.h>
const  byte  dataPins [ 7 ]  =  { 2 ,  3 ,  4 ,  5 ,  6 ,  7 ,  8 } ;  // Segment data pins: D0 - D6 
const  byte  addrPins [ 2 ]  =  { A1 ,  A2 } ;               // Segment address pins: A0, A1 
const  byte  wrenPins [ ]  =  { A0 ,  A3 };        // Write Enable pins (left to right) 
RTC_DS3231 rtc;

char msg[] = "         *** MICRO CLOCK - MIRCEMK ***        ";
char t[32];
HPDL1414  hpdl ( dataPins ,  addrPins ,  wrenPins ,  sizeof ( wrenPins ) ) ;
void  setup ( )  { 
  Serial.begin(9600);
  Wire.begin();
  hpdl.begin ( ) ;
  hpdl.clear ( ) ;

  for (byte i = 0; i < (sizeof(msg) / sizeof(char)); i++) {
    for (byte j = 0; j < 16; j++) {
      hpdl.setCursor(j);
      if (i + j < (sizeof(msg) / sizeof(char))) {
        hpdl.print(msg[i + j]);
      } else {
        hpdl.print(" ");
      }
    }
    delay(200);
  }
  rtc.begin();
  //rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));
  //rtc.adjust(DateTime(2022, 8, 26, 23, 07, 0));
}
void  loop ( )  { 
    DateTime now = rtc.now();
   sprintf(t, "%02d-%02d-%02d",  now.hour(), now.minute(), now.second());
   hpdl.clear();
   hpdl.print(t);
}

Code with *Time* String

Arduino
#include  <HPDL1414.h>
#include <RTClib.h>
#include <Wire.h>
const  byte  dataPins [ 7 ]  =  { 2 ,  3 ,  4 ,  5 ,  6 ,  7 ,  8 } ;  // Segment data pins: D0 - D6 
const  byte  addrPins [ 2 ]  =  { A1 ,  A2 } ;               // Segment address pins: A0, A1 
const  byte  wrenPins [ ]  =  { A0 ,  A3 };        // Write Enable pins (left to right) 
RTC_DS3231 rtc;
char t[32];
HPDL1414  hpdl ( dataPins ,  addrPins ,  wrenPins ,  sizeof ( wrenPins ) ) ;
void  setup ( )  { 
  Serial.begin(9600);
  Wire.begin();
  hpdl.begin ( ) ;
  hpdl.printOverflow(true); 
  hpdl.clear ( ) ;
  hpdl.print("*-TIME-*");
  delay(3000);
  hpdl.clear();
  rtc.begin();
  rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));
 //rtc.adjust(DateTime(2022, 8, 226, 20, 19, 0));
}
void  loop ( )  { 
    DateTime now = rtc.now();
    sprintf(t, "%02d-%02d-%02d",  now.hour(), now.minute(), now.second());
    hpdl.clear();
    hpdl.print(t);
}

Credits

Mirko Pavleski

Mirko Pavleski

149 projects • 1279 followers

Comments