61. PathFinder Compass

Soldiers got lost in heavy fog due to broken navigation tools, accidentally entering enemy territory. After escaping, they identified the need for a reliable device to guide them back to camp.

So, develop an Arduino UNO based device that

  • Inputs: Army GPS device provides soldier’s current XY coordinates (latitude, longitude) Serially over UART with 9600 baud rate.
  • System to design: Receives data via UART and calculates distance and direction to a pre-stored camp location.
  • Output: Print distance and direction on the Serial Monitor.

Predefined Military Camp Coordinates:X=18.556283,Y=73.955067

NOTE: Instead of an Army GPS device, we can send a GPS string via Serial Monitor to avoid hardware complexity. 

Example 

  • Soldiers Coordinate String: ” X=18.532525,Y=73.850457”
  • The system will calculate the distance and direction to the Predefined Military Camp Coordinates:X=18.556283,Y=73.955067
  • So based on the calculation done by the system output will be shown as given format:
Distance to camp: 11.34 km 
Direction to camp: E

 

Serial monitor Output:


You can send the following GPS string manually via the Serial monitor.  System should show the distance and direction.

NOTE: For verification, you can refer to the expected output.

Sr.NoGPS String for Soldiers (send via serial monitor)Expected Output (on serial monitor)
1.“X=18.543070,Y=73.852389”

Distance to camp: 10.92 km 

Direction to camp: E

2.“X=18.447045,Y=73.858581”

Distance to camp: 15.85 km 

Direction to camp: NE

3.“X=17.692949,Y=74.003719”

Distance to camp: 96.14 km 

Direction to camp: N

4.“X=18.145256,Y=74.575520”

Distance to camp: 79.85 km 

Direction to camp: NW

5.“X=18.500245,Y=73.858700”

Distance to camp: 11.92 km 

Direction to camp: NE


 

 

 

 

Submit Your Solution