loading

HI EVERYONE

This time i came up with new instructable featuring both standalone display as well as logger using arduino mega 2560 and Nextion Lcd display
And for tracking purpose you can also log the NMEA sentences of Gps in sdcardand of course project is done with magical graphical programming software VISUINO.
MANY parameter of information can be displayed on Lcd as per user requirement but i will show you major ones.further any info can be extracted from raw GPS data through Visuino .
log file generated can be further used to track in google map , google earth.

i would like to again thanks toBoian Mitov for assisting me in wiring and writing this instructable.

i have updated the instructable by adding one morevisual lcd interface including all nessary files.

Step 1: COMPONENTS

    1. One Arduino Mega 2560 board (You will need a board with at least 2 Serial ports, preferably 3 so Mega is one of the best choices)
    2. One MicroSD Card module (SPI interface)
    3. One Serial GPS Module
    4. One Nextion Serial 2.8 inch nx3224t028_011Display (I used but any other Nextion Display should also work)
    5. SD card of capacity less than 32gb and its adapter to use with the Nextion Display
    6. Second SD card of capacity less than 32gb
    7. 4 Female-Female jumper wires to program the Display
    8. You will also need a 5V USB to TTL Serial Converter Module to program the Display
    9. Few jumper wires to connect the components together

Step 2: Connect the Nextion Display to the USB Serial Communication Module

To program the Nextion Display with the Nextion Editor you need to connect it with a USB to TTL Serial Converter to your computer:

  1. Connect the Nextion Wires Connector to the Display (Picture 1)
  2. If your USB to Serial Module is configurable, make sure it is set to provide 5V power (Picture 2) (In my case I needed to configure it with a power selection jumper)
  3. Connect the Ground Wire (Black wire) from the Nextion Display to the Ground pin of the USB to TTL Serial Converter Module (Picture 2)
  4. Connect the Power (+5V) Wire (Red wire) from the Nextion Display to the Power(VCC/+5V) pin of the USB to TTL Serial Converter Module (Picture 2)
  5. Connect the RX Wire (Yellow wire) from the Nextion Display to the TX pin of the USB to TTL Serial Converter Module (Picture 2)
  6. Connect the TX Wire (Blue wire) from the Nextion Display to the RX pin of the USB to TTL Serial Converter Module (Picture 2)
  7. Connect the USB to TTL Serial Converter Module to the computer with a USB cable

Step 3: Start the Nextion Editor, and Select the Display Type and Orientation

To program the Nextion Display, you will need to Download and Install the Nextion Editor.

  1. Start the Nextion Editor
  2. From the Menu select |File|New|
  3. In the "Save As" dialog, type project file name, and select a location to save the project
  4. Click on the "Save" button
  5. In the "Settings" dialog, select the Display type
  6. Click on the "DISPLAY" tab on the left to show the Display settings
  7. Select Horizontal orientation for the display
  8. Click on the "OK" button to close the dialog

Step 4: In the Nextion Editor: Add and Configure Text Components

  1. *make sure you have FAT32 formatted sdcard make sure you have generated font otherwise Nextion editor will show error in compiling.
  2. YOU MUST DOWNLOAD ( images.png) IMAGE ATTACHED HERE CONTAINING GPS INFOMATION PARAMETER.(LATITUDE,LONGITUDE)

NOW FOLLOW THESE STEPS:

  1. CLICK new project
  2. name it as visuino
  3. Switch to the device tab and choose nx3224t028_011 display, 90 horizontal, character encoding ascii, Display area will have a white 320*240 editable screen.

Now we have generate fonts:

  1. From the menu select |Tools|Font generator|
  2. follow the wizard and select the generated font.

Next we will add a picture:

  1. Now in nextion editor add this wallpaper in picture window(left bottom corner window) by clicking on + button.
  2. In display window white screen will appear,now click on its attribute table(right hand side bottom corner window) click on sta->select image pic->double click->select picture
  3. this will be used as background of Lcd interface.

Design the Nextion screen:

  1. Now from toolbox window: click on text component->t0 newtext will appear on the display screen->drag over required area in front of latitude text
  2. now click on its attribute table sta->crop image picc->double click->choose picture 0 pco->choose black color txt->x
  3. Similarily repeat the process of adding four more text component t1 , t2.place them one below the other by dragg ing them on screen.Now you should add 4 more text components to display longitude,speed,number of satellites,date and time.
  4. similarly by repeating the above procedure

Generate and upload the files to the Nextion SDCard:

  1. Click on compile tab (this will generate tft file)You can also debug or run this in simulator by clicking on debug tab ,a new window will popup. under" instruction input area" window enter-> t0.txt="555" this will cause x->555 on display screen Click on file->open build folder->copy this visuino tft file into fat32 formatted sdcard.
  2. Insert this sdcard into Nextion lcd and power it on.
  3. After successful update.power it off then remove the sdcard and power it again.
  4. NOW YOU WILL SEE YOUR NEXTION EDITOR INTERFACE ON LCD.
  5. you can directly transfer visuino tft file attached here to sdcard .
  6. or go in next step to transfer compiled project via ftdi usb module.

Step 5: In the Nextion Editor: Upload the Project to the Nextion Display

  1. Click on the "Upload" button
  2. In the "Upload to Nextion Device" dialog, click on the "Go" button to start the upload
  3. When the upload finishes, click on the "Exit" button to close the dialog.

Step 6: HARDWARE CONNECTIONS

  • BETWEEN MEGA AND NEXTION
  • WE WILL USE SERIAL PORT1
  • PIN18 TX1 OF MEGA TO RX OF NEXTION
  • PIN19 RX1 OF MEGA TO TX OF NEXTION
  • VCC TO VCC AND GND TO GND

BETWEEN SDCARD AND MEGA

  • CS OF SDCARD TO PIN53
  • SCK OF SDCARD TO PIN52
  • MOSI OF SDCARD TO PIN51
  • MISO OF SDACRD TO PIN50
  • VCC TO VCC
  • GND TO GND

BETWEEN GPS AND MEGA

  • TX OF GPS TO RX2 PIN17 OF MEGA
  • VCC TO VCC
  • GND TO GND
  • WE WILL USE SERIAL2

Step 7: Start Visuino, and Select the Arduino Board Type

Since the Arduino MEGA has four Serial ports, and it is needed to program the Arduino, you will need to program the Arduino MEGA so leave serial0 for programming .

To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .

Make sure that you install 1.6.7 or higher, otherwise this Tutorial will not work!

The Visuino: https://www.visuino.com also needs to be installed.

  1. Start Visuino as shown in the first picture
  2. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
  3. When the dialog appears, select Arduino MEGA as shown in Picture 2

Step 8: ADDING GPS MODULE AND NEXTION DISPLAY IN VISUINO

  1. Type "GPS" in the Filter box of the Component Toolbox then select the "Serial GPS" component (Picture 1), and drop it in the design area
  2. Connect the "Out" pin of the GPS1 component to the to the "In" pin of the "Serial[ 2 ]" of the Arduino MEGA component
  3. Type "next" in the Filter box of the Component Toolbox then select the "Nextion Display" component, and drop it in the design area
  4. Connect the "Out" pin of the component to the to the "In" pin of the "Serial[ 1 ]" of the Arduino MEGA component

Step 9: ADDING VISUINO COMPONENTS: MICRO SDCARD CONFIGURATION

First we need to add and connect MicroSD Component in Visuino to control the MicroSD Module:

  1. Type "sd" in the Filter box of the Component Toolbox then select the "Micro SD Card Module" component (Picture 1), and drop it in the design area
  2. Connect the "Out" pin of the SDCard1 component to the to the "In" pin of the "SPI" channel of the Arduino component (Picture 2)
  3. Connect the "ChipSelect" output pin of the SDCard1 component to the "Digital" input pin of the "Digital[ 53 ]" channel of the Arduino Mega 2506 component (Picture 3)

To record the data we need to add File element to the MicroSD component and specify its file name:

  1. Click on the "Tools" button of the SDCard1 component (Picture 1)
  2. In the "Elements" editor select the “File” element in the right window, and then click on the "+" button on the left (Picture 2) to add File element
  3. In the Object Inspector set the value of the "Path Name" property of the File1 Element to "GPSLog.txt6"

Step 10: CONFIGURING NEXTION DISPLAY AND GPS

  1. Double click on nextion display , elements editor will pop up
  2. Add "Text" element
  3. Select the newly added element
  4. now under properties tab name it as "t0".
  5. Connect this text components to latitude of the gps module .

Similarly add next text component ,rename it as "t1" and connect it to longitude of gps module.

Similarly add text components for speed, number of satellites,date and time and map it to gps module. Name then "t2", "t3", etc. with incrementing numbers, to match the names of the Nextion components set in the Nextion Editor.

Step 11: Configuring Sdcard and Formatted Text Component

  1. Type "form" in the Filter box of the Component Toolbox then select the "Formatted Text" component (Picture 1), and drop it in the design area
  2. Double click on the FormattedText1 component to open the elements editor (Picture 2)
  3. In the Elements Editor add two "Analog element" elements (Picture 2)
  4. Connect "Analog Element1" to latitude
  5. Connect "Analog element2" to longitude
  6. Connect the "Out" pin of FormattedText1 component to "In" of sdcard1 component (Picture 3)
  7. Connect the "Out" pin of the SDCard1 component to the "In" pin of the "SDI" channel of the Arduino MEGA component (Picture 4)

Step 12: Upload the Code to Mega Board

  1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
  2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Step 13: Live Action

please take the setup in open area to get Gps fix

once you get gps fix all information will be displayed and logged.

take the sdcard out and check if gpstxt6 file was created.

About This Instructable

2,688views

18favorites

License:

More by Ankitmishra:Visuino: Fingerprint Sensor With Nextion Display Visuino: Moving Servo Via Nextion Slider VISUINO : NEXTION GPS DISPLAY AND SDCARD LOGGER 
Add instructable to: