Raspberry Pi Digital Clock with 16×2 LCD

Raspberry Pi based Digital Clock with 16×2 LCD display is a relatively simple project.It requires only a small set of components and can be completed in less than an hour. Previously I’ve published similar designs based on other popular platforms like Arduino and PIC micro-controller. You’ll need a basic 16×2 LCD display with parallel interface and 3 push buttons for time adjustment. Python code can be downloaded at this link. I’ve imported and installed Adafruit_CharLCD module for interfacing the display. It looks like it’s not compatible with Python 3 but running it with Python 2 works fine. The code itself is basically a set of 4 counters for each digit running in continuous loop. Time base for the clock is generated by a standard sleep() function, no additional software modules are needed.  In the next figure project schematic is shown. LCD and push button I/O mapping can be changed in code.

Raspberry Pi Digital Clock with 16x2 LCD Schematic

Pressing Time Set button together with Minutes or Hours Adjust button will update the current time. It may be a good idea to decrease the time it takes to update each digit, for now it is relatively slow. You can see the clock in action in the short video at the bottom of the page.

Raspberry-Pi-Digital-Clock-with-16x2-LCD-Board