Some days ago I found the follwing page from Alsan Parajuli who did create a NTP-Clock with a ESP8266-NodeMCU and a 16×2 HD44780-LCD-Display.
In the past I had also thinking about a GPS or NTP-Clock and his creation seems to be easy to recreate and the ARDUINO-Sketch is also short 😉
The second thing I do like about this configuration is that I had 2 hardware-modules available at home which does the same as his Breadboard-Build but only whith connection my 2 modules 🙂
The first module is a ESP8266 in a Arduino-format – named the LOLIN (WeMOS) D1 R2
The second module is a widely available 16×2 HD44780-Keypad-LCD-Shield.
Dont press the Buttons, because the 5V-USB could be „inserted“ in your 3.3V WeMOS D1 via the Keypad-Pin AD0
see here for the Keypad-schematic
but someone wrote the Resistor-Array for the keys will only work correctly from 4.8V and above 😦
Here in this sketch the keys doest have any function.
I connected both together and did try the ARDUINO-sketch from Alsan Parajuli, but with his LCD-init
LiquidCrystal lcd(D6, D5, D1, D2, D3, D4);
my setup didnt worked.
First it gave me a error-message that some Pins are not declared in the scope
(and the LiquidCrystal-Library was alread installed).
After trying to adapt some Pin-Numbers I only got a empty LCD-Display 😦
So I did some research on my LCD-Module about the Pin-numbering and did read some more Webpages.
One of the pages told me that the LCD-Keypad-Shield wouldnt work with the LiquidCrystal-Library and I have to use the Extensible hd44780 LCD library.
But because I didnt get better results with that library (also told me about unkown/not declared Pin-numbers) I did go back to the LiquidCrystal-Library and did try to solve my little jigsaw.
After some attempts I got successfully got the Display to work on a Test-Sketch with the follwoing Init-Sequence:
// esp8266 Lolin/Wemos D1 R2 with LCD-Keypad-Shield
// initialize the library with the numbers of the interface pins
// LiquidCrystal lcd(D6, D7, D2, D3, D4, D5);
const int rs=D6, en=D7, db4=D2, db5=D3, db6=D4, db7=D5;
LiquidCrystal lcd(rs, en, db4, db5, db6, db7);
Having the Test-Sketch working it wasnt a big problem to edit the NTP-Clock Sketch
– reconfiguring the WiFI Credentials
– reconfiguring Time-Zone from Nepal to UTC+3 Istanbul (value 10800)
– reconfiguring the NTP-Server from asia.pool.ntp.org to pool.ntp.org
– replacing the / in the date-format to .
My creation/version of the source is available via my Google-Drive
Here some pictures of the result: