Arduino GPS real time clock with NEO-6M module

There are different ways to build an Arduino based real time clock, one of the ways is using a real time clock chip (like: DS1302, DS1307, DS3231 …) and another way is by using a GPS module. The GPS based clock receives time from satellites and automatically sets its time. This topic shows how to build an Arduino GPS clock with NEO-6M GPS module where time and date are displayed on 16×2 LCD screen.

Related Projects:
Last time I made a simple interfacing of Arduino with NEO-6M GPS module in order to get position, time, date and speed, project page link is below:
Interfacing Arduino with NEO-6M GPS module

and the links below shows how to build a real time clock using Arduino and RTC chips:
Arduino real time clock with DS1307
Arduino and DS3231 real time clock

Hardware Required:
To build this project the following components are needed:

  • Arduino (or compatible) board
  • NEO-6M GPS module
  • 16×2 LCD screen
  • 10k ohm variable resistor (or potentiometer)
  • 330 ohm resistor
  • Breadboard
  • Jumper wires

Arduino GPS clock with U-Blox NEO-6M GPS module

Arduino GPS real time clock with NEO-6M module circuit:
Project circuit diagram is shown below.

Arduino GPS real time clock with NEO-6M and LCD

NEO-6M GPS module has 4 pins where:
NEO-6M GPS board GND pin goes to Arduino GND
TX pin goes to Arduino digital pin 4
RX pin is not connected
VCC pin goes to Arduino 5V pin (can be connected to 3.3V pin)

The 1602 LCD screen is used to display the real time clock time and date where:
RS —> Arduino digital pin 2
E  —> Arduino digital pin 3
D4 —> Arduino digital pin 4
D5 —> Arduino digital pin 5
D6 —> Arduino digital pin 6
D7 —> Arduino digital pin 7
VSS, RW, D0, D1, D2, D3 and K are connected to Arduino GND (ground)
VEE to the variable resistor (or potentiometer) output
VDD to Arduino 5V and A to Arduino 5V through 330 ohm resistor

VEE pin is used to control the contrast of the LCD. A (anode) and K (cathode) are the back light LED pins.

Arduino GPS clock code:
The Arduino code below uses TinyGPS++ library, it can be downloaded from the link below. After downloading the library, unzip the folder and add it to Arduino libraries folder (for example: C:\Program Files\Arduino\libraries). You should rename the folder “TinyGPSPlus”.
TinyGPS++ Library  —  direct link

Full Arduino code is below.

The following video shows how a hardware circuit should work (UTC time):

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.