GPS Time & Internet Time As a Backup Using Visuino
2025-06-04 | By Ron Cutts
License: GNU Lesser General Public License Displays GPS LCD / TFT Real Time Clocks (RTCs) Wifi Arduino ESP8266
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!
Step 1: What You Will Need
ESP8266-D1 Arduino Compatible Development Board (Or any other board with WiFi)
NEO-6M GPS Breakout Module with Antenna
Visuino software: Download here
Step 2: The Circuit
Connect LCD pin [SCL] to ESP8266-D1 pin [SCL]
Connect LCD Sensor pin [SDA] to ESP8266-D1 pin [SDA]
Connect LCD Sensor pin [VCC] to ESP8266-D1 pin [5v]
Connect LCD Sensor pin [GND] to ESP8266-D1 pin [GND]
Connect NEO-6M GPS module pin [VCC] to ESP8266-D1 pin [5v]
Connect NEO-6M GPS module pin [GND] to ESP8266-D1 pin [GND]
Connect NEO-6M GPS module pin [TX] to ESP8266-D1 pin [RX]
Step 3: Start Visuino, and Select the WeMos D1 / R2 Board Type
The Visuino: https://www.visuino.com also needs to be installed. Download the 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 in Picture 2
Step 4: WiFi Setup
Select WeMos D1 / R2 board and in the editor Modules>WiFi>Access Points, click the [...] button, so that the "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 Network
Under "Password" put the access password for your WiFi network
Close the "Access points" window
On the left in the editor, select Modules>Wifi>Sockets, click the [...] button, so that the "Sockets" window will open. Drag the TCP/IP Client from right to the left side, then under the properties window, set port: 37 and host: time-c-g.nist.gov
Close the "Sockets" window
Step 5: In Visuino Add & Set Components
Add "Liquid Crystal Display (LCD) - I2C" component
Double click on the "LiquidCrystalDisplay1" and in the Elements window, drag "Text Field" to the left side
In the Elements window, drag another "Text Field" to the left side and in the properties window set "Row" to 1, "Initial Value" to ------
Close the Elements window
Add "Serial GPS" component
Add "Digital Multi Source" component, and in the properties window set "Output Pins" to 4
Add "Digital (Boolean) Inverter (Not)" component
Add 2X "Date/Time On/Off Switch" component, and for both in the properties window set "Send On Enable" to True
Add 2X "Detect Edge(Digital to Clock)" component, and for the first one in the properties window, set "On Rising/True" to False
Add "Internet Time Protocol" component
Add "Date/Time Multi-Source Merger" component
Add "Text Value" component
Double click on "TextValue1" and in the Elements window, drag "Set Value" to the left side, and in the properties window, set "Value" to Internet Time
Drag another "Set Value" to the left side, and in the properties window, set "Value" to GPS Time
Close the Elements window
Step 6: In Visuino Connect Components
Connect "GPS1" pin [Out] to WeMos D1 / R2 Serial [0] pin [In]
Connect "GPS1" pin [Date Time] to "Switch1" pin [In]
Connect "GPS1" pin [Invalid] to "MultiSource1" pin [In]
Connect "MultiSource1" pin [0] to "Inverter1" pin [In]
Connect "MultiSource1" pin [1] to "Switch2" pin [Enable]
Connect "MultiSource1" pin [2] to "DetectEdge1" pin [In]
Connect "MultiSource1" pin [3] to "DetectEdge2" pin [In]
Connect "Inverter1" pin [Out] to "Switch1" pin [Enable]
Connect "Switch1" pin [Out] to "DateTimeMultiMerger1" pin [0]
Connect "Switch2" pin [Out] to "DateTimeMultiMerger1" pin [1]
Connect "DetectEdge1" pin [Out] to "TextValue1" > "Set Value2" pin [In]
Connect "DetectEdge2" pin [Out] to "TextValue1" > "Set Value1" pin [In]
Connect "DetectEdge2" pin [Out] to "InternetTime1" pin [Clock]
Connect "InternetTime1" pin [Out] to "Switch2" pin [In]
Connect "InternetTime1" pin [Socket] to "WeMos D1 / R2" >TCP Client1 pin [In]
Connect "DateTimeMultiMerger1" pin [Out] to "LiquidCrystalDisplay1" > "Text Field2" pin [In]
Connect "TextValue1" pin [Out] to "LiquidCrystalDisplay1" > "Text Field2" pin [In]
Connect "LiquidCrystalDisplay1" pin I2C Control to "WeMos D1 / R2" I2C In
Step 7: Generate, Compile, and Upload the Code
Before uploading, disconnect the RX pin on the board, and after uploading, connect it back.
In Visuino, at the bottom, click on the "Build" Tab, make sure the correct port is selected, then click the "Compile/Build and Upload" button.
Step 8: Play
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 for this. You can download it and open it in Visuino: https://www.visuino.com
Download Visuino File: GPS-INT-BACKUP-TIME.visuino