Introduction: How to Simulate GPS Module in Proteus
In this tutorial you are going to learn how to simulate a GPS module in Proteus interfaced to an Arduino Uno. You may be working on a project which requires you to simulate GPS data. This tutorial will teach you exactly how to do that!. As usual all source code and files used in this tutorial can be downloaded in the Resources section at the end of this post.
To run the simulation, we are going to make use of the following resources:
• A GPS library for Proteus designed by Theengineeringprojects.com which adds a GPS module to our components library and allows us to use GPS modules in our Proteus simulations
• The GPS Module hex file which defines how the GPS module should work and also contains dummy NMEA strings. The GPS hex file was also written by Theengineeringprojects.com and is included in the resources for this project at the bottom of the post.
• TinyGPS library, an NMEA (GPS Data) parser (written by Mikal Hart) so that we can make sense out of the random GPS data we will be receiving from the GPS module.
• Arduino Sketch
• Arduino hex file
Step 1: Extracting Necessary Files and Libraries
I am assuming that you already have the Arduino library installed in Proteus.
I will be using Proteus 7.8 for this tutorials and for most of my Proteus tutorials.
So here is what is going to happen:
- The GPS module in Proteus has been designed to output some fake NMEA data. NMEA is just a format in which GPS devices output data.
- The NMEA data from the GPS module is received by the Arduino through its hardware serial port.
- The TinyGPS library parses the data received and "translates" it into understandable GPS data such as longitude and latitude.
- The data is displayed on a virtual terminal inside Proteus
Extracting the GPS library for Proteus
- Download the zipped file containing the GPS library, TinyGPS library and GPS Hex file.
- Upon opening the zipped file, you'll see a number of files. Extract the files and save them somewhere on your PC.
- Next, extract the contents of the proteus-gps-library.zip into your Proteus library folder.
- If you use Proteus 7, the path will be something like C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY . Note: If your computer runs a 64bit architecture, the your Program Files folder will rather be Program Files (x86)
- If you use Proteus 8, the path will be something like C:\ProgramData\Labcenter (Electronics\Proteus 8 Professional\Data\LIBRARY
- After that, extract the content of the TinyGPSNew.zip into the Arduino libraries folder located at C:\Program Files (x86)\Arduino\libraries
Step 2: Proteus Simulation
Proteus SimulationAfter extracting all files and libraries to their respective locations, open up Proteus and add Arduino Uno and GPS Module to your work space and connect them as shown in the image below.
- TXD pin of GPS module goes to PIN0 (RXD pin of Arduino) since the GPS module will be transmitting data to Arduino
- TXD pin of Arduino is connected to the Virtual terminal so that we can display and view GPS data in the Virtual terminal.
Step 3: Final Simulation and Code
When you run the simulation, you should see something like this on your screen.
The Arduino Code used as well as the Proteus file is also attached so you can modify it as you please.
Click here to see the code used to run the simulation and download all the resources and files you need for the project.
If you like this tutorial, have any questions or found any mistakes, please let me know in the comments section below.
For more tutorials, please visit our website