Introduction: GPS OLED Position Display Using XinaBox
I built this project for the fun of it, to display our current GPS coordinates on a small OLED display. Based on Xinabox running an ARM M0+.
Step 1: Things Used in This Project
Hardware components
- XinaBox CC03 xChip x 1
xChip 32-bit ARM® Cortex®-M0+ processor - XinaBox SN01 xChip x 1
xChip GNSS (GPS) receiver - XinaBox OD01 xChip x 1
xChip 128x64 Pixel OLED Display - XinaBox PL02 x 1
xChip 3.7v LiPo battery charger and power supply - XinaBox XC10 xBUS Connector x 1
xBUS connectors - XinaBox IP03 xChip x 1
xChip interface for SWD, JTAG and SPI programmers with USB port - 3.7 V LiPo Battery x 1
Software apps and online services
Step 2: Story
Intro
I built this GPS location display using XinaBox xChips. It is a very simple, quick build with straight forward software. The XinaBox technology made this project extremely easy to do in under 10 minutes.
Step 3: What You Will Need
Apart from the set of xChips, you will need Arduino installed and the following libraries.
- Arduino M0 Board Driver from Arduino Board Manager
- xCore (XinaBox Library)
- xSN01 (XinaBox Library)
- xOD01 (XinaBox Library)
Step 4: Programming the CC03
Click in an IP03 xChip onto the CC03 using an XC10 and XC55 connector and plug into a USB port on your computer via micro-USB cable. Connect as shown in the picture below. Open Arduino and select the correct COM port. Under Tools select Board: "Arduino M0", then upload the sketch, which I will provide in the code section of this page.
Programming the CC03
Step 5: Building It
What build? Lol. The xChips make it very easy, simply click them together with the XC10 connectors until it looks like the picture at the top of the page. The only thing to bare in mind, the small XinaBox logos with chip name must all face the same direction, the bus at the top and bottom of the board are NOT the same. Usually the boards have a large logo at the bottom.
Connect a 3.7 V LiPo battery to the battery terminals of the PL02, remember to connect the polarity correctly, it is marked + and - on the board.
Step 6: Running It
Switch on at the power switch of the PL02. And have fun with it!
Step 7: Code
GPS_Navigator Arduino
This code is used in an Arduino sketch (.ino file) to run the project.
#include "xCore.h" #include "xSN01.h" #include "xOD01.h" long loop_timing = 0; void setup() { // Start the Serial comms Serial.begin(115200); // Start the I2C Communication Wire.begin(); //Start OD01 OLED.begin(); // Start the Sensor SN01.begin(); } void loop() { // Create a variable to store the data read from SN01 long time = 0; long latitude = 0; long longitude = 0; long altitude = 0; // Poll the sensor to read all available data SN01.poll(); // Use a timer to display data once a second if ((millis() - loop_timing) > 1000) { // Get the time from the GPS time = SN01.getTime(); // Get the latitude from GPS latitude = SN01.getLatitude(); // Get the longitude from GPS longitude = SN01.getLongitude(); // Get the altitude from GPS altitude = SN01.getAltitude(); //Clears the OLED display of OD01 OD01.clear(); //Change font size and print header OD01.set2X(); OD01.println("SN01 NAV"); OD01.set1X(); // Display the recorded data over the serial monitor OD01.print("Time: "); OD01.println(time); OD01.print("Latitude: "); OD01.println((float)latitude/10000000,6); OD01.print("Longitude: "); OD01.println((float)longitude/10000000,6); OD01.print("Altitude: "); OD01.println(altitude); loop_timing = millis(); } }