├── docs ├── Quectel_L76K_GNSS_协议规范_V1.0.pdf └── Quectel_L76K_GNSS_Protocol_Specification_V1.1.pdf ├── LICENSE ├── examples ├── L76K_GNSS_Turn_Light.ino ├── L76K_GNSS_BasicDataParsing.ino └── L76K_Path_Tracking_on_Ubidots.ino └── README.md /docs/Quectel_L76K_GNSS_协议规范_V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/Seeed_L76K-GNSS_for_XIAO/main/docs/Quectel_L76K_GNSS_协议规范_V1.0.pdf -------------------------------------------------------------------------------- /docs/Quectel_L76K_GNSS_Protocol_Specification_V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Projects/Seeed_L76K-GNSS_for_XIAO/main/docs/Quectel_L76K_GNSS_Protocol_Specification_V1.1.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Seeed-Projects 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/L76K_GNSS_Turn_Light.ino: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | static const int RXPin = D7, TXPin = D6; 7 | static const uint32_t GPSBaud = 9600; 8 | SoftwareSerial SerialGNSS(RXPin, TXPin); 9 | 10 | void setup() { 11 | SerialGNSS.begin(GPSBaud); 12 | 13 | // Define the byte array to turn the LED off 14 | byte OffState[] = {0xBA, 0xCE, 0x10, 0x00, 0x06, 0x03, 0x40, 15 | 0x42, 0x0F, 0x00, 0xA0, 0x86, 0x01, 0x00, 16 | 0x00, 17 | 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 18 | 0xF0, 19 | 0xC8, 0x17, 0x08}; 20 | 21 | // Define the byte array to recover the LED blinking state 22 | byte RecoverState[] = {0xBA, 0xCE, 0x10, 0x00, 0x06, 0x03, 0x40, 23 | 0x42, 0x0F, 0x00, 0xA0, 0x86, 0x01, 0x00, 24 | 0x03, 25 | 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 26 | 0xF3, 27 | 0xC8, 0x17, 0x08}; 28 | 29 | // Send the command to turn off the LED. 30 | SerialGNSS.write(OffState, sizeof(OffState)); 31 | // Wait for 5 seconds. 32 | delay(5000); 33 | // Send the command to return the LED to blinking. 34 | SerialGNSS.write(RecoverState, sizeof(RecoverState)); 35 | } 36 | 37 | void loop() { 38 | // Do nothing. 39 | } 40 | -------------------------------------------------------------------------------- /examples/L76K_GNSS_BasicDataParsing.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* 6 | This sample sketch demonstrates how to use L76K GNSS Module on SeeedStudio XIAO. 7 | */ 8 | static const int RXPin = D7, TXPin = D6; 9 | static const uint32_t GPSBaud = 9600; 10 | 11 | // The TinyGPSPlus object 12 | TinyGPSPlus gps; 13 | 14 | // The serial connection to the GNSS module 15 | SoftwareSerial ss(RXPin, TXPin); 16 | 17 | void setup() { 18 | Serial.begin(115200); 19 | ss.begin(GPSBaud); 20 | 21 | #ifdef ARDUINO_ARCH_RP2040 22 | pinMode(D10,OUTPUT); 23 | digitalWrite(D10,1); 24 | pinMode(D0,OUTPUT); 25 | digitalWrite(D0,1); 26 | #else 27 | 28 | Serial.println(F("DeviceExample.ino")); 29 | Serial.println(F("A simple demonstration of TinyGPSPlus with L76K GNSS Module")); 30 | Serial.print(F("Testing TinyGPSPlus library v. ")); 31 | Serial.println(TinyGPSPlus::libraryVersion()); 32 | Serial.println(F("by Mikal Hart")); 33 | Serial.println(); 34 | } 35 | 36 | void loop() { 37 | // This sketch displays information every time a new sentence is correctly encoded. 38 | while (ss.available() > 0) 39 | if (gps.encode(ss.read())) 40 | displayInfo(); 41 | 42 | if (millis() > 5000 && gps.charsProcessed() < 10) { 43 | Serial.println(F("No GPS detected: check wiring.")); 44 | while (true); 45 | } 46 | } 47 | 48 | void displayInfo() { 49 | Serial.print(F("Location: ")); 50 | if (gps.location.isValid()) { 51 | Serial.print(gps.location.lat(), 6); 52 | Serial.print(F(",")); 53 | Serial.print(gps.location.lng(), 6); 54 | } else { 55 | Serial.print(F("INVALID")); 56 | } 57 | 58 | Serial.print(F(" Date/Time: ")); 59 | if (gps.date.isValid()) { 60 | Serial.print(gps.date.month()); 61 | Serial.print(F("/")); 62 | Serial.print(gps.date.day()); 63 | Serial.print(F("/")); 64 | Serial.print(gps.date.year()); 65 | } else { 66 | Serial.print(F("INVALID")); 67 | } 68 | 69 | Serial.print(F(" ")); 70 | if (gps.time.isValid()) { 71 | if (gps.time.hour() < 10) Serial.print(F("0")); 72 | Serial.print(gps.time.hour()); 73 | Serial.print(F(":")); 74 | if (gps.time.minute() < 10) Serial.print(F("0")); 75 | Serial.print(gps.time.minute()); 76 | Serial.print(F(":")); 77 | if (gps.time.second() < 10) Serial.print(F("0")); 78 | Serial.print(gps.time.second()); 79 | Serial.print(F(".")); 80 | if (gps.time.centisecond() < 10) Serial.print(F("0")); 81 | Serial.print(gps.time.centisecond()); 82 | } else { 83 | Serial.print(F("INVALID")); 84 | } 85 | 86 | Serial.println(); 87 | } -------------------------------------------------------------------------------- /examples/L76K_Path_Tracking_on_Ubidots.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | // GPS module connection pins 7 | static const int RXPin = D7, TXPin = D6; 8 | // GPS module baud rate 9 | static const uint32_t GPSBaud = 9600; 10 | 11 | // WiFi credentials and Ubidots token 12 | const char WIFI_SSID[] = "INPUT YOUR WIFI NAME HERE"; 13 | const char WIFI_PASS[] = "INPUT YOUR WIFI PASSWORD HERE"; 14 | const char UBIDOTS_TOKEN[] = "INPUT YOUR UBIDOTS TOKEN HERE"; 15 | 16 | TinyGPSPlus gps; // GPS parser 17 | SoftwareSerial MySerial(RXPin, TXPin); // For communication with the GPS 18 | Ubidots ubidots(UBIDOTS_TOKEN, UBI_UDP); // Ubidots client, using UDP 19 | 20 | void setup() { 21 | Serial.begin(115200); 22 | MySerial.begin(GPSBaud); 23 | ubidots.setDebug(true); // For observing Ubidots uploading log. You can also change it to "false" for a more simplified serial monitor. 24 | Serial.println("\nTinyGPSPlus library version: " + String(TinyGPSPlus::libraryVersion())); 25 | 26 | WiFi.mode(WIFI_STA); 27 | WiFi.disconnect(); 28 | 29 | while (WiFi.status() != WL_CONNECTED) { 30 | WiFi.begin(WIFI_SSID, WIFI_PASS); 31 | Serial.println(WiFi.status()); 32 | delay(5000); 33 | } 34 | 35 | Serial.println("WiFi is connected!"); 36 | } 37 | 38 | void loop() { 39 | double lat, lng; 40 | while (MySerial.available() > 0) { 41 | if (gps.encode(MySerial.read())) { 42 | getLocation(&lat, &lng); 43 | sendToUbidots(lat, lng); 44 | delay(10 * 1000); // Change the parameter here to modify the interval of getting and uploading location. 45 | } 46 | } 47 | 48 | if (millis() > 5000 && gps.charsProcessed() < 10) { 49 | Serial.println("No GPS detected, please check wiring."); 50 | } 51 | } 52 | 53 | void getLocation(double *lat, double *lng) { 54 | if (gps.location.isValid()) { 55 | *lat = gps.location.lat(); 56 | *lng = gps.location.lng(); 57 | 58 | Serial.print("Location: "); 59 | Serial.print(gps.location.lat(), 6); 60 | Serial.print(", "); 61 | Serial.print(gps.location.lng(), 6); 62 | Serial.println(); 63 | } else { 64 | Serial.println("Unable to get location currently"); 65 | } 66 | } 67 | 68 | void sendToUbidots(const double lat, const double lng) { 69 | // Check if location data is valid 70 | if (lat != 0 && lng != 0) { 71 | char charLat[20], charLng[20]; 72 | sprintf(charLat, "%.6lf", lat); 73 | sprintf(charLng, "%.6lf", lng); 74 | 75 | // Add location context for Ubidots 76 | ubidots.addContext("lat", charLat); 77 | ubidots.addContext("lng", charLng); 78 | 79 | char* context = (char*)malloc(sizeof(char) * 60); 80 | ubidots.getContext(context); 81 | ubidots.add("position", 1, context); // Tagging the data with "position" 82 | 83 | // Send data to Ubidots 84 | if (ubidots.send()) { 85 | Serial.println("Values sent to Ubidots successfully."); 86 | } else { 87 | Serial.println("Failed to send values to Ubidots."); 88 | } 89 | 90 | free(context); // Free the allocated memory for context 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | # **L76K GNSS Module for Seeed Studio XIAO** 5 | 6 | This repository contains Arduino example code for the Quectel L76K GNSS Module, designed to be used with the Seeed Studio XIAO series development boards. The L76K module supports multi-GNSS systems including GPS, BeiDou, GLONASS, and QZSS, providing high-precision and energy-efficient positioning capabilities. 7 | 8 |
9 |

10 | 11 | SenseCAP 12 | 13 |

14 | 15 | 16 | ## Features 17 | 18 | - Multi-GNSS support for GPS, BeiDou, GLONASS, and QZSS. 19 | - Enhanced reception with built-in Low Noise Amplifier and Surface Acoustic Wave Filter. 20 | - High precision with up to 32 tracking channels. 21 | - Energy-efficient with low current consumption in tracking and standby modes. 22 | - Comes with a high-performance active GNSS antenna. 23 | 24 | ## Getting Started 25 | 26 | ### Hardware Requirements 27 | 28 | - A Seeed Studio XIAO development board (SAMD21, RP2040, nRF52840, ESP32C3, or ESP32S3). 29 | - The L76K GNSS Module for Seeed Studio XIAO. 30 | - An active GNSS antenna (included with the module). 31 | 32 | ### Software Setup 33 | 34 | 1. **Install Arduino IDE** - Download and install the Arduino IDE from the [official Arduino website](https://www.arduino.cc/en/software). 35 | 36 | 2. **Configure Arduino IDE for Seeed Studio XIAO** - Follow the instructions in the [Seeed Wiki](https://wiki.seeedstudio.com/Seeeduino-XIAO/#software) to add support for your specific XIAO development board. 37 | 38 | 3. **Install TinyGPSPlus Library** - In the Arduino IDE, go to `Sketch` > `Include Library` > `Manage Libraries...`, search for "TinyGPSPlus", and install the library. 39 | 40 | ### Examples 41 | 42 | This repository includes several example sketches demonstrating how to use the L76K GNSS Module: 43 | 44 | - **BasicExample.ino** - Demonstrates basic GNSS data parsing and output. 45 | - **LEDControl.ino** - Shows how to control the module's LED indicator through serial commands. 46 | 47 | ### Wiring 48 | 49 | Connect the L76K GNSS Module to your XIAO development board according to the pinout provided in the module's documentation. Ensure the GNSS antenna is properly connected to the module before powering it up. 50 | 51 |

52 | SenseCAP 53 | 54 |

55 | 56 | ## Example Usage 57 | 58 | Open the `BasicExample.ino` sketch in the Arduino IDE, select your XIAO board and the correct COM port, then upload the sketch. Open the Serial Monitor at 115200 baud to see the parsed GNSS data being displayed. 59 | 60 | ## Troubleshooting 61 | 62 | - Ensure the antenna has a clear view of the sky for optimal GNSS signal reception. 63 | - If you encounter issues with GNSS data not being displayed, verify the module's wiring and check that the correct board configuration is selected in the Arduino IDE. 64 | 65 | ## Purchase 66 | 67 | Get your L76K GNSS Module for Seeed Studio XIAO [here](https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html). 68 | 69 | ## Contributing 70 | 71 | We welcome contributions to improve the examples and documentation. Please feel free to submit issues and pull requests. 72 | 73 | ## License 74 | 75 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 76 | --------------------------------------------------------------------------------