Skip to content

ESP-01 ESP8266 NTP Clock with LCD Display

It is possible to make a digital clock out of an ESP-01 ESP8266 module synchronized with NTP (Network Time Protocol) and using a 20×4 LCD for displaying the current date and time.

At first glance, it looks like an impossible task because the ESP-01 module has only a few GPIO pins. The ESP-01 module has only 8 pins: two (2) for the power supply, one for reset, one for CH_PD (Chip Enable/Power Down), and four (4) GPIO pins.

The four (4) GPIOs available on the ESP-01 are the GPIO-0, GPIO-1, GPIO-2, and GPIO-3. GPIO-1 is used as the TX line and GPIO-3 is the RX line of the ESP8266’s UART. GPIO-0 and GPIO-2 also have special functions. They select the boot modes of ESP8266.

The project is possible if two conditions are met:

  • we use an LCD display with I2C interface (two-wire interface)
  • we use the LiquidCrystal_I2C library that was modded to use non-I2C pins of ESP8266

Since an LCD display with I2C interface uses only two pins, it can be connected to the ESP-01 module using GPIO-0 and GPIO-2. There is a LiquidCrystal_I2C library version that turns GPIO-0 as SDA pin and GPIO-2 as SCL pin for the I2C communication channel.

Wiring diagram of ESP-01 ESP8266 NTP Clock with LCD Display showing the SDA and SCL lines for connecting an LCD display

The circuit above shows the schematic diagram of an ESP-01 connected with a USB to TTL converter. With this connection, the ESP-01 module can be programmed thru the USB converter. The diagram also shows the SDA and SCL connection points where an LCD using an I2C interface can be connected.

Arduino IDE Program

Related Articles on ESP-01 ESP8266 NTP Clock with LCD Display

Arduino Reference and Resources
How to Set up Arduino IDE for ESP8266 Programming
NodeMCU V3 ESP8266 Pinout and Configuration
How to Test NodeMCU V3 Using Esptool
How to Install Arduino IDE on Windows 10
How to Save and Restore ESP8266 and ESP32 Firmware
NodeMCU ESP-32S Pin Configuration
How to Use MCP4725 Module with Arduino
How to Use ADS1220 ADC Module with Arduino

References on ESP-01 ESP8266 NTP Clock with LCD Display

Arduino IDE
ESP8266 on Wikipedia

1 thought on “ESP-01 ESP8266 NTP Clock with LCD Display”

  1. Careful with that sync interval time. It is in milliseconds. So setting it to 60 does NOT set it to 5 minutes. It sets it to hit up the server quite frequently. Essentially every time it want to update the time. Multiple times per second is possible. This can get your IP banned by

Leave a Reply

Your email address will not be published. Required fields are marked *