Introduction: Bharat Pi Navic Sheild(sensor) Using With Arduino IDE

About: Bharat Pi is an IoT prototyping platform for students, innovators, startups and developers. A simplified board with an all in one compute network and storage on a single board to build rapid prototypes, colleg…

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

Step 1: Connection

  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.

Step 2: Arduino Code

  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.


Step 3: Open the Maps Application.

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

Step 4: 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);
            }
        }
    }
}


Step 5: Video