Bharat Pi Navic Sheild(sensor) Using With Arduino IDE

by bharatpi in Circuits > Arduino

372 Views, 1 Favorites, 0 Comments

Bharat Pi Navic Sheild(sensor) Using With Arduino IDE

Screenshot 2024-03-19 160215.png
111111.jpg

Bharat Pi NavIC is a GPS tracker module built specifically to work with Bharat Pi boards. It uses the NavIC (Navigation with Indian Constellation) system, an independent regional navigation system developed by India.

The NavIC GPS module is an add-on board that can be easily mounted on top of any Bharat Pi board. This allows you to develop tracking applications in a variety of fields, including:

  • Automotive
  • Healthcare
  • Asset tracking


Supplies

Connection

F15QIJCLU02RGB7.png
  1. Connect the NavIC shield using the designated pin connections.
  2. Confirm that the pin configuration matches and verify the proper fitting of the board.
  3. Connect the antenna to the NavIC GPS module
  4. Ensure that the NavIC module can successfully acquire satellite signals. It is recommended to be in an open area with clear visibility of the sky.

Arduino Code

Screenshot 2024-03-21 145711.png
Screenshot 2024-03-20 114931.png
  1. Open the provided .ino file.
  2. Copy the code from the file or open it directly and upload the code to the Bharat Pi board.
  3. Please verify that the baud rate is set correctly.


Open the Maps Application.

Screenshot 2024-03-21 163900.png

Please enter the longitude and latitude coordinates into the search bar of the maps application.

Code

#include <TinyGPS++.h>
#include <SoftwareSerial.h>


#define GPS_RX_PIN 33
#define GPS_TX_PIN 32


TinyGPSPlus gps;
SoftwareSerial gpsSerial(GPS_RX_PIN, GPS_TX_PIN);


void setup() {
    Serial.begin(115200);  
    gpsSerial.begin(115200);


    Serial.println("Getting GPS data...");
}


void loop() {
    // Read data from GPS module
    while (gpsSerial.available() > 0) {
        if (gps.encode(gpsSerial.read())) {
            if (gps.location.isValid()) {
                // Get latitude and longitude
                float latitude = gps.location.lat();
                float longitude = gps.location.lng();


                // Print latitude and longitude
                Serial.print("Latitude: ");
                Serial.println(latitude, 7);
                Serial.print("Longitude: ");
                Serial.println(longitude, 7);
            }
        }
    }
}


Downloads

Video

Unlocking Location Tracking with Bharat pi NavIC GPS and Bharat Pi Boards