# GPS Tour Guide

## Overview

https://youtu.be/sm2XTmXtf6A

## Geocaching Tour Guide

In this learn guide we’re building a GPS tour guide.&nbsp;When we get to a location, it’ll display an image on screen and playback music or audio clips.&nbsp;This uses the Adafruit HalloWing and Ultimate GPS FeatherWing. All of the components are housed in our 3D printed case that snaps together.

![](https://cdn-learn.adafruit.com/assets/assets/000/066/118/medium800/gps_hero-wear.jpg?1542476984)

## Location Based Images & Audio

When the device is nearby a logged location,&nbsp; a green circle will appear on screen. Once the coordinates are close, a custom image displays on screen and music starts playing! This is totally customizable so imagine unlocking secret music or sounds at geocached locations. So you can get creative and theme it out to fit your project.

This is written in Adafruit’s Circuit Python so we can easily add and edit locations in a txt file.&nbsp;&nbsp;The HalloWing works like a USB drive so all of the libraries and assets are stored on the device. This means you can write code and make quick changes on any computer.

![](https://cdn-learn.adafruit.com/assets/assets/000/066/029/medium800/gps_parts.jpg?1542377029)

## Parts List

- [Adafruit HalloWing M0 Express](https://www.adafruit.com/product/3900)
- [Adafruit Ultimate GPS FeatherWing](https://www.adafruit.com/product/3133)
- [400mAh battery](https://www.adafruit.com/product/3898)
- [Oval Speaker](https://www.adafruit.com/product/3923)
- [Slide Switch](https://www.adafruit.com/product/805)
- [Metal Ball Tactile Button](https://www.adafruit.com/product/3347)
- [CR1220 Coin Cell Battery](https://www.adafruit.com/product/380)
- [Double-Hook Lanyard](https://www.adafruit.com/product/3982)

## Hardware, supplies

- [3-pin JST-PH cable](https://www.adafruit.com/product/3893)&nbsp;(78mm/3in length needed)
- 4x [M2.5 x 5mm flat head metric machine screws](https://www.albanycountyfasteners.com/2-5-MM-x-45-Phillips-Flat-Head-Machine-Screw-p/1011-1002.htm)
- [4-Wire 28AWG silicone cover stranded core ribbon cable&nbsp;](https://www.adafruit.com/product/3891)(78mm/3in length needed)

## Prerequisite Guides

If you're new to Adafruit Feather M4 Express, CircuitPython or soldering, take a moment to walk through the following guides to get you started.

- [Adafruit HalloWing M0 Express](https://learn.adafruit.com/adafruit-hallowing)
- [Welcome to Circuit Python](https://learn.adafruit.com/welcome-to-circuitpython)
- [Adafruit Ultimaker GPS FeatherWing](https://learn.adafruit.com/adafruit-ultimate-gps-featherwing)
- [Adafruit's Guide to Excellent Soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering?view=all)

![](https://cdn-learn.adafruit.com/assets/assets/000/066/116/medium800/gps_hero-mansion-2.jpg?1542476177)

## Geocaching Music Player

We took this to Disney’s Epcot so the national anthems will play while we walk through World Showcase.

# GPS Tour Guide

## Circuit Diagram

## Circuit&nbsp;Diagram

This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. This diagrams was created using [Fritzing software](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Use our Fritzing parts library to create circuit diagrams for your projects. Download the library or just grab the individual parts. Files are hosted on our github repo linked below.

[Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts)
![](https://cdn-learn.adafruit.com/assets/assets/000/066/074/medium800/gps_circuit-diagram.jpg?1542393973)

## Wired Connections

**Ultimaker GPS FeatherWing**

- **EN** pin to Switch
- **GND** pin to Switch

**HalloWing M0 Express**

- **Speaker** port to Speaker
- **Battery** port to 400mAh battery
- **Sense** port to Button

## Powering

The Adafruit HalloWing M0 Express can be powered via USB or JST-PH using a 3.7v lipo battery. In this project, a 4400mAh lipo battery is used. The lipo battery is rechargeable via the USB port on the Adafruit HalloWing M0 Express.

# GPS Tour Guide

## Software

![](https://cdn-learn.adafruit.com/assets/assets/000/066/117/medium800/gps_code-banner.jpg?1542476203)

## Setup Adafruit HalloWing M0 for CircuitPython

Your HalloWing M0 should already come with CircuitPython but maybe there's a new version, or you overwrote your board with Arduino code! In that case, see the below for how to reinstall or update CircuitPython. Otherwise you can skip this and proceed with the build.

[CircuitPython Setup for Adafruit HalloWing](https://learn.adafruit.com/adafruit-hallowing/circuitpython)
## CircuitPython Libraries

Install the following Adafruit libraries for Circuit Python by downloading the latest bundle. Unzip the file and locate the needed libraries. Drop the libraries into a folder named " **lib**" on the **CIRCUITPY** drive.

Required CircuitPython Libraries:

- **adafruit\_bus\_device**
- **adafruit\_gps.mpy**
- **adafruit\_debouncer.mpy**

Before continuing make sure your board's lib folder or root filesystem has the **adafruit\_bus\_device,&nbsp;**** adafruit\_debouncer.mpy **and&nbsp;** adafruit\_gps.mpy ****&nbsp;** files are **&nbsp;** copied over.

[Download Latest Adafruit Circuit Python Library Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases)
## Summary

The screen on the HalloWing will display a welcome message and proceed to acquire GPS satellites. Once it has acquired a fix, an audible "chirp" will sound letting you know it's ready. Depending on the location, a colored circle will appear on the display. A red circle means the locations are far way, yellow is close and green is nearby. Once a location is targeted, an image of the establishment will be displayed, followed by an audible name of the location and detailed description. Pressing the button will replay the name and detail audio if at a current location.&nbsp;

## Upload The Code

Copy and paste the code below into a new text document (we recommend using [Mu](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor) as your editor, which is designed for CircuitPython.). Save the file and name it as main.py

Once the files has been uploaded to the drive, the board will automatically reboot and run the code.

## GPS Locations

Use the **locations.txt** file to add, remove or change locations. The structure of the locations are setup in a chronological order, followed by longitude, latitude, name of bitmap image, name of title wav file, and name of details wav file. Here's an example of a location.

> 1,26.7078962,-80.2356742,haunted\_mansion.bmp,haunted\_name.wav,haunted\_detail.wav

[Download Code from GitHub](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/HalloWing_Tour_Guide)
## Image Assets

Bitmap images reside on the root of the **CIRCUITPY** drive (Image must be in the **bitmap** format). The " **welcome"** , " **missing"** and&nbsp;" **acquiring fix"** messages are bitmap images, as well as the green, yellow and red circles. Images of the locations can be renamed and modified – These will need to be 128 pixels by 128 pixels in size. Location image file names must match the titles in the locations.txt file.

## Audio Files

The audio files can be changed to whatever sounds you'd like, just make sure they're in the right file format and title matches the code and locations.txt file. Audio files need to be in the following format.

- WAV, Mono PCM, 11.025kHz

See [this guide](https://learn.adafruit.com/microcontroller-compatible-audio-file-conversion) on how to convert audio formats for microcontroller projects.

# GPS Tour Guide

## 3D Printing

## 3D Printed Parts

Parts are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Parts are listed below with file name and description. Parts require tight tolerances that might need adjusting slice setting. Reference the suggested settings below.

![gps_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/958/medium640/gps_3d-parts.jpg?1542305608)

[Download CAD Files](https://www.thingiverse.com/thing:3236733)
## Slice Settings

Use these settings as reference. Values listed were used in [Ultimaker's CURA 3.X](https://ultimaker.com/en/products/ultimaker-cura-software) slicing software.

- 0.2mm Layer Height / 0.4mm nozzle
- 0.38mm Line Width (inner & outer widths)
- 60mm/s printing speed
- 20% infill

![gps_cura-slice.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/988/medium640/gps_cura-slice.jpg?1542332401)

## Tap Mounting Holes

I used a set of screw taps to create threads in the various mounting holes. This greatly improves fastening screws. of the A mix of metric sizes are used here. M2.5 tap for the GPS FeatherWing. M2 tap for the button.

## Install Bezel

The bezel features four posts that snap fit into the holes of the top cover. Reference the photo and orient the bezel with the top cover. Press the bezel onto the top cover.

## Design Source Files

The enclosure assembly was designed in Fusion 360.&nbsp;This can be downloaded in different formats like STEP, SAT and more. Electronic components like the board, displays, connectors and more can be downloaded from our&nbsp;[Fusion 360 CAD parts github repo](https://github.com/adafruit/Adafruit_CAD_Parts).

[Download Adafruit CAD Parts](https://github.com/adafruit/Adafruit_CAD_Parts)
## Glitter Infused Filament from Fillamentum

The material used to print the some of the parts in this project are from [Fillamentum](https://fillamentum.com/). From the [PLA Extrafill](https://fillamentum.com/collections/pla-extrafill) line of filaments, Vertigo Galaxy PLA and&nbsp; Rapunzel Silver PLA was used. [Translucent PLA](https://www.adafruit.com/product/2451) material was used to print the&nbsp; **bhl-headlight-b.stl** part.

# GPS Tour Guide

## GPS FeatherWing

## Install Headers on GPS FeatherWing

The GPS FeatherWing comes with two headers. Cut the headers so there's a 12-pin and a 16-pin. Match the headers with pins on the GPS FeatherWing and fit them under the PCB. Each header will need to soldered to the pins on the FeatherWing. I recommend seating the headers to a breadboard to make soldering easier – This keeps the header pins in place while soldering.&nbsp;

## Note about short headers

I recommend using standard headers. [Short headers](https://www.adafruit.com/product/3002) for the Adafruit Feather boards are available but the 3D printed base was designed around the standard headers. If you do use short headers, the microUSB port will not line up with the hole on the case.

# GPS Tour Guide

## Button Wiring

## Wiring Button

Use a [3-pin JST-PH cable](https://www.adafruit.com/product/3893) to connect the button to the sensor port on the HalloWing. Cut the cable so it's at least 76mm(3in) in length. The button only needs two wired connections so we can cutoff the red (middle) wire from the cable. Using wire stripper, remove a bit of insulation. To make it easier to attach the wire to the button, tin the exposed strands of wire with a bit of solder.&nbsp;

## Attaching Wires to Button

The button features two sets of contacts. We only need one set of pins to connect the wires. Polarity doesn't matter for the wires but we need to use the contacts that are not shared. The photo on the left shows which pins are being shared. The wires need to connect to one red pin and one blue pin.

![gps_button-contacts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/992/medium640/gps_button-contacts.jpg?1542334210)

## Connect Wires to Button

I suggest using a pair of third helping hands to hold the button in place while soldering. Solder the two wires to the pins on the button. The JST-PH connector from the cable plugs directly into the sense port on the HalloWing M0 Express.

# GPS Tour Guide

## Slide Switch

## Wiring Slide Switch

We'll need a set of wires to connect the slide switch to the GPS FeatherWing. I suggest using a 4-wire ribbon cable to keep the wires bundled together. The slide switch only needs two wires, so we can peel off a 2-wire set from the ribbon cable. The wire set should be at least 78mm (3in) in length.&nbsp; Using wire strippers, remove a bit of insulation from the tips of each wire. To make it easier to attach the wires to the pins on the switch, apply a bit of solder to the exposed stands of wire.

## Connect Wires to Switch

I suggest using third helping hands to secure the slide switch while soldering. The slide switch only needs two pins wired, one middle pin and either the far left or right.&nbsp;

## Connect Switch to GPS Feather Wing

The two wires from the switch need to connect to the **EN** and **GND** pins on the GPS FeatherWing. I suggest using a vise to secure the PCB while soldering. Solder the two wires to the pins on the bottom of the GPS FeatherWing PCB – This will make the assembly easier once we secure the PCB to the 3D printed enclosure.

# GPS Tour Guide

## Install Button

## Installing Button

The button is attached to the 3d printed case using a bracket and two M2 x 5mm flat head metric machine screws. Press the button through the hole in the side of the case. Hold it in place and fit the bracket over the body of the button.&nbsp;

## Secure Button

Insert and fasten the machine screws through the mounting holes on the side of the 3d printed case. Make sure the mounting holes on the bracket are lined up with the holes on the case.

# GPS Tour Guide

## Install GPS

## Install GPS FeatherWing

We'll need four M2.5 x 5mm flat head metric machine screws. Place the GPS FeatherWing PCB over the four standoffs on the case (the orientation needs to match the photo). Hold the PCB in place while driving the machine screws into the standoffs.

## Secured GPS FeatherWing

The PCB should be flush with the standoffs. Double check to ensure the PCB is in the correct orientation.

![](https://cdn-learn.adafruit.com/assets/assets/000/066/048/medium800/gps-screw-installed.jpg?1542388572)

# GPS Tour Guide

## Install Switch

## Install Slide Switch

Grab the slide switch and press it into the holder on the case. Insert it at an angle so the actuator on the switch fits through the small hole on the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/066/049/medium800/gps_switch-install.jpg?1542388603)

## Switch Actuator

Test the switch by sliding the actuator. The switch holder should keep it in place. If you have issues keeping the switch in place, use super glue to adhere it to the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/066/050/medium800/gps_switch-installed.jpg?1542388623)

# GPS Tour Guide

## Assembly

## Connect Battery

The HallowWing has a built-in ON/OFF slide switch.&nbsp;Since we are using an external slide switch, I suggest setting the built-in switch to the OFF position (we'll turn it on later in the assembly). Plug in the JST-PH cable from the battery into the power port on the HalloWing.

![gps_hallowing-switch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/071/medium640/gps_hallowing-switch.jpg?1542392761)

## Connect Speaker

Plug in the oval speaker to the audio port on the HalloWing. This uses a "Molex PicoBlade" (1.25mm pitch 2-pin) cable, which makes plugging into a board easy.

![gps_speaker-plugin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/053/medium640/gps_speaker-plugin.jpg?1542388883)

## Installing Components

Double check the components are properly oriented before proceeding with the assembly. Follow the photo for reference.

![gps_preinstall.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/051/medium640/gps_preinstall.jpg?1542388732)

## Connect Button

Plug in the 3-pin JST-PH connector from the button to the **sense** port on the HalloWing.

![gps_button-plugin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/055/medium640/gps_button-plugin.jpg?1542388941)

## Installing Speaker

Peel the sticker from the oval speaker (pull on&nbsp; the little tab). Place the speaker sticky side down onto the oval shaped holder inside the case.&nbsp;

## Secure Battery

The battery can be placed inside the case, next to the push button. To keep the battery in place, I used small pieces of mounting tack to keep the battery from shaking around inside the case.

![gps_battery-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/058/medium640/gps_battery-installed.jpg?1542390984)

## Install HalloWing to GPS FeatherWing

Place the HalloWing over the GPS FeatherWing and check the headers are oriented correctly. Carefully press the HalloWing onto the GPS FeatherWing, making sure the header pins are aligned.

![gps_hallowing-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/059/medium640/gps_hallowing-install.jpg?1542391152)

## Fit Wires

Excess wiring can be tucked underneath the PCB and inside case.

![gps_hallowing-wire-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/060/medium640/gps_hallowing-wire-fit.jpg?1542391228)

## Turn On HalloWing

Using a set of tweezers, flip the built-in slide switch so it's set to the ON position on the HalloWing. If it's left on the OFF position, the slide external switch can not power the circuit.

![gps_hallowing-onoff-switch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/061/medium640/gps_hallowing-onoff-switch.jpg?1542391423)

## Install Top Cover

Get ready to fit the top cover onto the case. Reference the photo for the correct orientation.

![gps_top-case.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/062/medium640/gps_top-case.jpg?1542391431)

## Snap Fit Top Cover&nbsp;

Fit the cover onto the case. Make sure the bezel does not obstruct the display on the HalloWing. Slowly and gently!

![gps_top-case-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/066/063/medium640thumb/gps_top-case-install.jpg?1542390568)

## Install Lanyard

The case has two tabs on the outside for clipping a lanyard.&nbsp;

![gps_landyard.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/064/medium640/gps_landyard.jpg?1542391704)

## USB Port

The microUSB port on the HalloWing is accessible through the hole on the side of the top cover.&nbsp;

![gps_usb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/066/065/medium640/gps_usb.jpg?1542391800)

## Final Test

Powering on the circuit should display the welcome message, followed by the acquiring fix image (these can be changed by updating the bitmap images). The GPS fix works best outdoors and can take a few minutes.

## Use it!

There's some interesting ideas that can be done with just a few changes to the image and audio assets.

- museum art exhibits details or history
- unlock messages ILR RPG game style
- play music at landmark locations


## Featured Products

### Adafruit HalloWing M0 Express

[Adafruit HalloWing M0 Express](https://www.adafruit.com/product/3900)
[This is Hallowing..this is Hallowing... Hallowing! Hallowing!&nbsp;](https://www.youtube.com/watch?v=kGiYxCUAhks&t=39s)

Are you the kind of person who doesn't like taking down the skeletons and spiders until after January? Well, we've got the development board for...

In Stock
[Buy Now](https://www.adafruit.com/product/3900)
[Related Guides to the Product](https://learn.adafruit.com/products/3900/guides)
### Adafruit Ultimate GPS FeatherWing

[Adafruit Ultimate GPS FeatherWing](https://www.adafruit.com/product/3133)
Give your Feather a sense of place, with an Ultimate GPS FeatherWing. <!--EndFragment-->In 2013 we designed the [Ultimate GPS module](https://www.adafruit.com/products/746) to satisfy all your GPS desires - and now we have brought its power and versatility plus more to our...

In Stock
[Buy Now](https://www.adafruit.com/product/3133)
[Related Guides to the Product](https://learn.adafruit.com/products/3133/guides)
### Mini Oval Speaker - 8 Ohm 1 Watt

[Mini Oval Speaker - 8 Ohm 1 Watt](https://www.adafruit.com/product/3923)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

In Stock
[Buy Now](https://www.adafruit.com/product/3923)
[Related Guides to the Product](https://learn.adafruit.com/products/3923/guides)
### Slim Sticker-type GSM/Cellular Quad-Band Antenna - 3dBi uFL

[Slim Sticker-type GSM/Cellular Quad-Band Antenna - 3dBi uFL](https://www.adafruit.com/product/1991)
That's one slim cellular antenna! At just 75mm long from tip to tip and and with a thickness of just 2mm, this 3dBi GSM antenna is slim,&nbsp;compact and sensitive, with a 3dBi gain. &nbsp;The antenna juts&nbsp;out from its base with stick-on back so you attach it to an enclosure if...

In Stock
[Buy Now](https://www.adafruit.com/product/1991)
[Related Guides to the Product](https://learn.adafruit.com/products/1991/guides)
### Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh

[Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh](https://www.adafruit.com/product/3898)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of **400mAh** for a total of about 1.9 Wh. If you need a larger (or smaller!)...

In Stock
[Buy Now](https://www.adafruit.com/product/3898)
[Related Guides to the Product](https://learn.adafruit.com/products/3898/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Metal Ball Tactile Button (6mm) x 10 pack

[Metal Ball Tactile Button (6mm) x 10 pack](https://www.adafruit.com/product/3347)
Add some steely elegance to your project with these **Metal Ball Tactile Buttons**. They've got a nice industrial shine to them along&nbsp;with a light blue underbelly. Not only do they look good, but they're also good if you have an actuator that will be pressing the...

In Stock
[Buy Now](https://www.adafruit.com/product/3347)
[Related Guides to the Product](https://learn.adafruit.com/products/3347/guides)
### CR1220 12mm Diameter - 3V Lithium Coin Cell Battery

[CR1220 12mm Diameter - 3V Lithium Coin Cell Battery](https://www.adafruit.com/product/380)
These are the highest quality & capacity batteries, the same as shipped with the iCufflinks,&nbsp;iNecklace, Datalogging and GPS Shields, GPS HAT, etc. One battery per order (you'll want one battery per cufflink or pendant.)  
  
Brand may vary but all battery brands are verified...

In Stock
[Buy Now](https://www.adafruit.com/product/380)
[Related Guides to the Product](https://learn.adafruit.com/products/380/guides)

## Related Guides

- [Adafruit Hallowing M0](https://learn.adafruit.com/adafruit-hallowing.md)
- [The Great Seal Mask](https://learn.adafruit.com/the-great-seal-mask.md)
- [HalloWing Jump Scare Trap](https://learn.adafruit.com/hallowing-jump-scare-trap.md)
- [HalloWing Flapping Bat](https://learn.adafruit.com/hallowing-flapping-bat.md)
- [Tiny Museum Tour Device](https://learn.adafruit.com/tiny-museum-tour-device.md)
- [HalloWing Light Paintstick](https://learn.adafruit.com/hallowing-light-paintstick.md)
- [Adafruit Ultimate GPS featherwing](https://learn.adafruit.com/adafruit-ultimate-gps-featherwing.md)
- [Hallowing Minotaur Maze](https://learn.adafruit.com/hallowing-minotaur-maze.md)
- [Creating Custom Symbol Fonts for Adafruit GFX Library](https://learn.adafruit.com/creating-custom-symbol-font-for-adafruit-gfx-library.md)
- [HalloWing Googly Eye](https://learn.adafruit.com/hallowing-googly-eye.md)
- [HalloWing Macintosh](https://learn.adafruit.com/hallowing-mac.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Milk Jug Glow Skull](https://learn.adafruit.com/milk-jug-glow-skull.md)
- [Getting Started with HalloWing for Hackaday Supercon Attendees](https://learn.adafruit.com/getting-started-with-hallowing-for-hackaday-supercon-attendees.md)
- [Terminator Eyeball Upgrade](https://learn.adafruit.com/terminator-eyeball-upgrade.md)
- [Synchronized Eyes with Two HalloWings](https://learn.adafruit.com/synchronized-eyes-with-two-hallowings.md)
