Recently i completed a project which involved a GPS(Global positioning system) and a WiFi module. WiFi module gets GPS coordinates, time and date from GPS module and then sends them to a remote website for display with some other sensor values. I used popular skm53 GPS module by skylab in my project. For WiFi access i used nodemcu Esp8266 12-e WiFi module. I googled for online tutorials on interfacing skm53 with nodemcu or Esp8266 but landed with small tutorials whose directions were also not clear. After completing the project i decided to upload a simple tutorial on how to interface gps skm53 with nodemcu and get latitude, longitude, time and date reding from gps module.
Skm53 GPS Module
Skm53 works properly when fully exposed to sky. Its not suitable for indoor applications especially when you are in building with multiple story’s. Skm53 can not only output longitude, latitude, current time and date values. It can also provide us speed at which the gps carrying object is moving. Skm53 works on NMEA-0183 (National Marine Electronics Association) protocol. To learn more about the protocol and skm53 here is a good tutorial.
Skm53 communicates with external controllers on UART interface. Default baud rate for communication is 9600 bps. Baud rate can can be increased to 115200 bps. Power requirement of skm53 gps module is 5 volt and maximally it sinks 0.5 amperes of current in clear sky.
Nodemcu operates on 3.3 volts and its pins are also working on TTL 3.3v level. Where as skm53 pins are working on TTL level 5v. Since both the modules are working at different TTL levels so in order to connect the data lines of modules with each other we must insert a level shifter circuit in between. I used a pre-assembled sparkfun level shifter board in the project. Its a pretty good bi directional level shifter. One can purchase it under $3 from sparkfun Level Shifter board. Circuit diagram of the project is below.
Skm53 communicates with external controllers on UART interface. Default baud rate for communication is 9600 bps. Baud rate can can be increased to 115200 bps. Power requirement of skm53 gps module is 5 volt and maximally it sinks 0.5 amperes of current in clear sky.
Nodemcu operates on 3.3 volts and its pins are also working on TTL 3.3v level. Where as skm53 pins are working on TTL level 5v. Since both the modules are working at different TTL levels so in order to connect the data lines of modules with each other we must insert a level shifter circuit in between. I used a pre-assembled sparkfun level shifter board in the project. Its a pretty good bi directional level shifter. One can purchase it under $3 from sparkfun Level Shifter board. Circuit diagram of the project is below.
Low side of level shifter is connected to nodemcu and high side to gps module. Nodemcu operating power must be shared with level shifter low side and skm53 power must be shared with level shifter at high side. Since its a bi directional level shifter data from either side can easily be level shifted. Nodemcu transmit signal at TTL level 3.3v after passing through level shifter is pulled up to TTL 5v. In contrast gps module transmit 5v TTL level signal is pulled low to 3.3v after passing through level shifter.
Project code is little complex. TinyGPS library is used in the project. TinyGPS library provides encoding and decoding the NMEA commands functionally. Skm53 works on NMEA commands so this library is solely designed with the purpose of manipulating NMEA. Before compiling the code please be sure you included this library in your arduino library repository. Upload the code in nodemcu and open arduino serial monitor. Current date, time and latitude, longitude values will be displayed on arduino serial monitor.
Note: Nodemcu has only one full serial uart channel(uart-0) and an another single transmit channel with no receive line. I used it(uart-0) for communication with Gps and at the same time it is also transmitting data to arduino serial monitor. Some times i encountered errors due to collision of data. But most the times the code works. Its solution is to utilize the second single only transmit channel. Connect the second channel transmit to skm53 receive line and use the uart-0 receive pin to receive the data from transmit line of nodemcu. By this the transmit line of nodemcu uart-0 will be dedicated only for sending data to arduino serial monitor. I did not tried it. But as soon as i get some time i will try it.
|
Project can further be extended by acquiring and sending the latitude, longitude, time and date values to a remote server site. A tracker can be made by only inserting the above functionally. The only limitation is tracker can not be movable, due to WiFi limitation :D.
Download the project code. Folder contains the project .ino file. Please provide us with your feed back on the project. Write your queries and comments below in the comments section.
Filed Under: ESP8266, Microcontroller Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.