## Inspiration

After a group viewing of the fantastic Pirates of the Caribbean movies, one of our group members was inspired by Jack Sparrow’s compass. This special compass points towards whatever Jack wants most instead of pointing north. While it would be hard to determine the deepest desires of one’s heart, we liked the idea of a compass that could remember and point to locations of one's choosing. This idea eventually led to the Treasure Tracker.

## The compass’ function

The Treasure Tracker can store up to four different locations simultaneously by holding down one of the four buttons on the side. The user can then switch between which location the needle is pointing to using the buttons on the side. It's dead simple to use!

## How it was constructed

Our process began with some experimentation. Because we did not have access to an encoder or continuous motion servo, we had to find a way to make the limited range servo actuate 360 degrees. This was done with 3D printed gears, and turned out better than we initially thought. On the software side, we started by figuring out how to tell north from the magnetometer as well as how to get latitude and longitude from the GPS sensor. Then we coded a method of finding the bearing between the current position and the saved positions coordinates with respect to north. We then combined the angles to find the direction of the saved position. Finally, a cardboard box was constructed and painted to contain all of the hardware elements in a thematic way.

## Challenges we encountered

Using the readings from the magnetometer in a useful way proved difficult. The library for our sensor had documentation on how to get the readings, but not on how to interpret them. Fortunately, someone had created code to calibrate the data and a function that finds the yaw(degrees from north) of the sensor’s x axis. GitHub Link

We initially planned on 3D printing many other components, however we were unable to get the parts in time. Because of this we ended up with a gear ratio of 2:1 instead of 3:1, which limited the range of motion of the needle. This was overcome with a software solution to rapidly rotate the servo in the opposite direction to the correct position, which ended up being pretty effective. Another effect of not having access to 3D printing is that we were unable to produce the CAD files we had created. This was a big hindrance, but we were able to outfit a cardboard container to suit our needs.

The team experienced some hiccups on the software side with version control. With some teammates working remote and some working locally, it was difficult to collaborate on the code at the same time. This led to a couple messy merge conflicts on GitHub.

The GPS gave us many problems. Getting a GPS signal was difficult and required standing in an open space and even then would often prove finicky. Additionally, our initial attempts to connect the GPS to our arduino resulted in a conflict with our Servo library which forced us to switch to a Teensy microcontroller.

## Lessons learned on the high seas

We learned a lot about global positioning, including the math used to find the angle between two different longitude and latitude coordinates. This proved to be much more complicated than we initially accounted for due to the spherical nature of the earth. Furthermore, we learned about the Earth’s magnetic field, and how it can be used to find magnetic north. This also proved rather challenging as the Earth's magnetic field does not uniformly point north.

We all learned ways in which to collaborate more effectively in a remote setting. Whether we were working on the physical or software side, we had to find ways of working well as a team. We were able to organize and communicate effectively through discord, allowing us to work efficiently without getting in each other’s way.

## Real life applications

Google maps has made navigating in real life very easy. However, what happens when there is no cellular data and Google Maps doesn’t work? People usually aren’t trained in cartography, so how do they know which direction to go? Treasure Tracker has a serious application here. An example would be if someone were to go on a hike in a seldom visited part of the wilderness. They could set a waypoint at the start of their hike, and continue with no fear of getting lost. It would also be a boon while camping as you could mark multiple useful spots such as your campsite, a nearby stream, or a parked car. The device would then allow you to quickly navigate to any of these locations, without the need to check a map. In addition, because of how easy it is to operate and follow, it will be helpful for younger users to get back to their campsite. And finally, it adds another layer of safety to any outdoor outing as you can never forget your way back home.

## Where will Treasure Tracker head next?

Print and assemble the 3D printed enclosure Implement an antenna with the GPS for better locational accuracy Water / Dust resistance, perhaps a more rugged design Continuous rotation servo or an encoder for smoother rotation Design a PCB to integrate electronics on one board