In this Visuino project, ensure accurate timekeeping with a dual-source system! The ESP8266-D1 Arduino-compatible board retrieves time from the NEO-6M GPS module. If the GPS signal is lost, the board automatically switches to Wi-Fi and fetches the accurate date and time from an NTP server. This makes it a perfect backup solution for real-time applications!
Watch the video!
Big thanks to Stephan Buth for this great project idea! Check out his Youtube channel!
Connect NEO-6M GPS module pin [VCC] to ESP8266-D1 pin [5v]Connect NEO-6M GPS module pin [GND] to ESP8266-D1pin [GND]Connect NEO-6M GPS module pin [TX] to ESP8266-D1 pin [RX]
The Visuino: https://www.visuino.com also needs to be installed. Download Free version or register for a Free Trial.
Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "WeMos D1 / R2" as shown on Picture 2
Select WeMos D1 / R2 board and in the editor Modules>WiFi>Access Points, click on [...] button, so that "Access points " window will open.In this editor drag the WiFi access point to the left side.
In the properties window Under "SSID" put the name of your WiFi NetworkUnder "Password" put the access password for your WiFi networkClose the "Access points" windowOn the left in editor select Modules>Wifi>Sockets, click on [...] button, so that "Sockets" window will open Drag the TCP/IP Client from right to the left side, then Under Properties window set port: 37 and host: time-c-g.nist.govClose the "Sockets" windowAdd "Serial GPS" componentAdd "Digital Multi Source" component, and in the properties window set "Output Pins" to 4Add "Digital (Boolean) Inverter (Not)" componentAdd 2X "Date/Time On/Off Switch" component and for both in the properties window set "Send On Enable" to TrueAdd 2X "Detect Edge(Digital to Clock)" component and for the first one in the properties window set "On Rising/True" to FalseAdd "Internet Time Protocol" componentAdd "Date/Time Multi-Source Merger" componentAdd "Text Value" componentDouble click on "TextValue1" and in the Elements window drag "Set Value" to the left side and in the properties window set "Value" to Internet Timedrag another "Set Value" to the left side and in the properties window set "Value" to GPS TimeClose the Elements window


Before Upload, disconnect pin RX on the board and after the Uploading connect it back.
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
If you power the ESP board, the LCD will start to show the GPS Date & Time, if the GPS Signal is lost it will connect to the Internet time server and get the current Date & Time.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.com
