MicroView GPS. Getting started.

cn06-ublox-v3   Introduction I wanted to do something to connect the Microview to the real world, so this project begins a short series to display GPS data on the Microview. All we will do here is connect a GPS unit and show some of the data it is sending.  Next, we will interpret that data into GPS co-ordinates.

Parts (Please see below for breadboard arrangement and pin allocations)

Breadboard Setup There are just four pins from the Ublox GPS to be connected:

  • GPS red – 5V rail
  • GPS black – 0V rail
  • GPS yellow – Breadboard J8 (MV pin 9, the serial receive for Arduino code)
  • GPS green – Breadboard J9 (MV pin 10, the serial transmit for Arduino code)

WP_001331 WP_001332 WP_001333 When the connections are made, don’t forget:

  • Plug the Microview back in!
  • Pull out the red (5V) wire of the GPSto turn it off  when sending code to the Microview.

MicroView Arduino Code I apologise for the lack of indentation – I seem to be losing the fight with WordPress on this front.   // Include the Microview library. #include void setup() { uView.begin();                    // start MicroView uView.clear(PAGE);          // and clear the screen. Serial.begin (9600);         // Open the serial port.  The Ublox GPS is preset to 9600 baud. // The serial port must be opened after the Microview has been started } void loop() { int a; if ( Serial.available() > 0 )    // Check if data is available at the serial port { a = Serial.read();               // and if so read it into variable ‘a’ Serial.write(a);                  // Write it to the Terminal Monitor (so we can see it) uView.clear(PAGE);          // Clear the screen. uView.setCursor(0,20);        // set cursor at 0,0 uView.print(a);                  // and send value to the Microview screen, over-writing previous uView.display(); } } What should happen 1. You will see the data stream on the Serial Monitor of the Arduino IDE – make sure it is set to 9600 baud: E.g. $GPTXT,01,01,01,NMEA unknown ms $GPRMC,120526.00,A,5143.82830,N,00251.03807,W,0.068,,310714,,,A*66 $GPVTG,,T,8.K8P16,.000,08.4M7G,2,22,..10G,0,3,4,1,2,6*$V,334,9,0,127 G12N58,2,7GT0, os $GPTXT,01,01,01,NMEA unknown msg*58 $GPTXT,01,01,01,NMEA unknown msg*58 2. The Microview screen will display the data (in byte numerical format, so as a number) on the screen.  This will be changing very quickly! WP_001335   Congratulations! You now have successfully connected a GPS to your Microview – the start of many mobile projects I hope! Next we will interpret the GPS data stream to display actual data such as longitude, latitude, altitude, speed etc. and display it directly on the Microview.   Project Notes

  •  The first thing in the code Setup must be to start the Microview.  Nothing works properly without it!
  • Can’t wait to install this on my Zero electric motorbike – a way to go yet, though…

Breadboard Arrangement and MicroView vs Arduino Pin Allocations

MicroView_pins
Courtesy 0f Geek Ammo

Positioning of MicroView on Breadboard (for my projects at least!)

  • Pin 1 of the MicroView is in breadboard socket C1.
  • MV pin 8 (GND) is used to ground the breadboard 0V rails.
  • MV pin 15 (5V) is used to power the breadboard supply rails.

kr kr Acknowledgments All code inspired by (and possibly modified from) the MicroView tutorials from the great team at Geek Ammo.  Visit their MicroView Kickstarter page.  Big thanks!

Advertisements