GPS Clock Time Adjusted to Timezone and Daylight Saving Time

Introduction: GPS Clock Time Adjusted to Timezone and Daylight Saving Time

About: I like to combine electronics like Arduino's, ESP8266 etc with 3D designing and 3D printing.

In this instructable I share with you my gathering of useful components in Arduino code.

If you have a GPS receiver, why not use the time of the GPS satellites displayed in the time of your timezone.

Inspired by https://www.instructables.com/id/Adjusting-GPS-Dat...

Step 1: Components and Assemblation

Components

I used the following components, readily available from Aliexpress, eBay or Amazon

Arduino nano 5v, 168P

GPS receiver: GY-NEO6MV2

LCD screen with I2C connection

Breadboard

Jumper cables

Connections

Arduino:

GND to GND of LCD and GPS

5V to VCC of LCD and GPS

A4 to SDA of LCD (I2C bus)

A5 to SCL of LCD (I2C bus)

8 to TX of GPS (8 is RX as AltSoftwareSerial defined)

9 to RX of GPS (9 = TX as AltSoftwareSerial defined)

(in the photo a used other software serial pins in the standard library)

Step 2: Coding

I used the following libraries:

Timezone.h to adjust the time to daylight savings time

TinyGPS++ to decode the GPS data

AltSoftSerial.h for the software serial connection with the GPS module (works better than SoftwareSerial, as seen in the unwanted 'blinks' of the LCD screen, while using that standard).

EDIT: NewLiquidCrystal (NOT: LiquidCrystal_I2C.h) for the LCD screen I used.

These libraries can be downloaded from Github.

My code is published on my Github.

1 Person Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

12 Discussions

0
RudyardB
RudyardB

9 months ago on Step 2

HELLO TAKES ME OUT OF THIS ERROR LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address

0
RudyardB
RudyardB

Reply 9 months ago

ALREADY WORKED THIS WAS THE ERROR, WHAT I MISS IS FINDING TIMEZONE FOR CENTRAL MEXICO CONGRATULATIONS YOU ARE A TITAN
error.png
0
Wim3d
Wim3d

Reply 9 months ago

Thanks.
Suggestion: you can easily find I2C devices and their address by using a I2C scanner program on your Arduino.
For the timezone: please try this part of the code.
//CDT – Central Daylight Time / Central Daylight Saving Time (Daylight Saving Time) -300 = -5 hours from UTC in daylight saving time (summer).
TimeChangeRule CDT = {"CDT", Last, Sun, Mar, 2, -300};
//CST – Central Standard Time / Central Time (Standard Time) -360 = -6 hours from UTC in normal time (winter).
TimeChangeRule CST = {"CST ", Last, Sun, Oct, 3, -360};
Timezone CE(CDT, CST);

0
Wim3d
Wim3d

Reply 9 months ago

Hello. Can you give me more Information concerning your error or problems?

0
RudyardB
RudyardB

Reply 9 months ago

Hola al momento de compilar me muestra este error:
LiquidCrystal_I2C lcd (0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVO); // Establecer la dirección LCD I2C
y no lo puedo subir a la placa arduino

0
RudyardB
RudyardB

9 months ago

ESTE ES PA PANTALLA DE EROR

gps.png
1
Wim3d
Wim3d

Reply 9 months ago

It seems that 'POSITIVE' is not defined (see the information in the red bar on your screen). I'm not sure where that's done, I guess in the Arduino board definitions.
I see that you use Arduin IDE 1.6.11. I suggest you updrade the Arduino IDE to the latest version (I use 1.8.9). If that does not work, try to update the libraries used. Good luck, let me know if you succeed or need any further help.

0
RudyardB
RudyardB

Reply 9 months ago

HELLO AND UPDATE TO THE LATEST VERSION AND LIBRARIES AND I HAVE THE SAME ERROR I WILL SEND YOU WHAT COMES IN THE RED LETTERS
Arduino:1.8.12 (Windows 8.1), Tarjeta:"Arduino Nano, ATmega328P"
GPS-clock-daylight-LCD:11:53: error: 'POSITIVE' was not declared in this scope
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
^~~~~~~~
C:\Users\RUDYARD\Desktop\GPS-clock-daylight-LCD\GPS-clock-daylight-LCD.ino: In function 'void setup()':
GPS-clock-daylight-LCD:31:18: error: no matching function for call to 'LiquidCrystal_I2C::begin(int, int)'
lcd.begin(16, 2); // initialize the lcd for 16 chars 2 lines, turn on backlight
^
In file included from C:\Users\RUDYARD\Desktop\GPS-clock-daylight-LCD\GPS-clock-daylight-LCD.ino:9:0:
C:\Users\RUDYARD\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate: void LiquidCrystal_I2C::begin()
void begin();
^~~~~
C:\Users\RUDYARD\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate expects 0 arguments, 2 provided
Se encontraron varias bibliotecas para "Wire.h"
Usado: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
No usado: C:\Users\RUDYARD\Documents\Arduino\libraries\Wire
Se encontraron varias bibliotecas para "TinyGPS++.h"
Usado: C:\Users\RUDYARD\Documents\Arduino\libraries\TinyGPSPlus-0.95
No usado: C:\Users\RUDYARD\Documents\Arduino\libraries\TinyGPSPlus-1.0.2b
exit status 1
'POSITIVE' was not declared in this scope
Este informe podría contener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.


0
RudyardB
RudyardB

Reply 9 months ago

HELLO FRIEND I DID EVERYTHING AND THE ERROR CONTINUES

0
RudyardB
RudyardB

Reply 9 months ago

none of the examples in the library works, while the others do and with your instructable, which is great, I can't do it

0
Wim3d
Wim3d

Reply 9 months ago

Do you get the same error?
Did you remove the other library?
Please check and send me the compile info. See my attached picture how to check which libraries are used in the compilation. Check the box in the preferences window and them compile the file. Then the Arduino IDE shows which libraries are used.

2020-04-16 08_00_27-Postvak IN - WimHoogervorst - Outlook.png