LCD digital Clock using PIC16F628

8,276

Circuit Image

The reason why I am using an LCD display is because it allows me to display many characters and it doesn't need to be refreshed as 7-segment LED displays. Also, the interface requires less I/O pins. For this project, I used a 16x1 LCD Display with a 4-bit interface. More: 22pF capacitors keep the clock accurate. Read the XTAL specifications to determine what capacitor value is indicated for it. Time and date are displayed as HH:MM:SS x mmm dd, where: HH = Hours, MM = Minutes, SS = Seconds, x = AM/PM, mmm = Month (Jan, Feb, Mar), dd = Day. I/O pins A2, A3, A4, and A5 of the 16F628 are not used. I reserved these pins to connect a LM75 (LM75 uses I2C communication) and display the temperature. Actually, I am not developing any application using communication, so any modification will be done until next year. (The name will change to LCD clock with Thermometer and Calendar). Another way to build a thermometer without using any protocol is using a thermistor. Unfortunately, thermistors are not accurate and need calibration. However, the microcontroller doesn’t need an A/D converter to connect it.

The project utilizes a 16x1 LCD display configured in a 4-bit mode, which significantly reduces the number of required I/O pins compared to a traditional 8-bit interface. This is particularly advantageous in microcontroller applications where pin availability is limited. The display is capable of showing time and date in the format HH:MM:SS x mmm dd, providing a clear and concise readout for users.

To maintain accurate timekeeping, 22pF capacitors are employed in conjunction with a crystal oscillator (XTAL). It is essential to refer to the specific XTAL specifications to select the appropriate capacitor values, ensuring optimal performance and stability of the clock circuit.

The microcontroller used in this project is the PIC16F628, which features several I/O pins. Notably, pins A2, A3, A4, and A5 are reserved for future expansion, specifically for interfacing with a LM75 temperature sensor via I2C communication. This allows for the integration of temperature monitoring capabilities into the clock system. Currently, no communication applications are being developed, but future modifications are planned to enhance the functionality of the device, potentially renaming it to "LCD Clock with Thermometer and Calendar."

As an alternative to the LM75, a thermistor could be utilized to measure temperature. However, thermistors typically require calibration due to their inherent inaccuracies, and they do not necessitate an analog-to-digital converter (A/D) for interfacing with the microcontroller. This characteristic may make thermistors a simpler option for basic temperature sensing, albeit with trade-offs in precision. Overall, the design aims to create a multifunctional timekeeping device while maintaining flexibility for future enhancements.The reason why I'm using a LCD display is because it allow me to display many characters and it doesn't need to be "refreshed" as 7-segment Led displays. Also, the interface requieres less I/O pins. For this project I used a 16x1 LCD Display with 4-bits interface.

22pF capacitors keeps the clock accurate. Read the XTAL specifications to determine what capacitor value is the indicated for it. Time and date are displayed as HH:MM:SSx mmm dd, where: HH = Hours MM = Minutes SS = Seconds x = AM/PM mmm = Month (Jan, Feb, Mar) dd = Day. I/O pins A2, A3, A4 and A5 of the 16F628 are not used. I reserved these pins to connect a LM75 (LM75 uses I2C communication) and display the temperature. Actually, I'm not developing any application using communication, so, any modification will be done until next year.

(The name will change to LCD clock with Thermometer and Calendar). Another way to build a thermometer without using any protocol is using a thermistor. Unfortunately, thermistors are not accurate and need calibration. However, The microcontroller doesn't need an A/D converter to connect it.

🔗 External reference