Magnetoception is the ability of some animals to detect magnetic fields as a means of orienting themselves. Although humans do not seem to posses the same biological mechanisms that allow other animals to sense magnetic fields, there are still many ways that we can improve our sense of spatial orientation.
This project is an attachment to your bicycle that beeps to let you know that you are moving in the direction of magnetic north. It uses a parallax digital compass module, an Arduino, and a piezo buzzer to give you directional feedback as you bike. The basic idea here is that by providing a constant source of stimuli in a certain direction, you might find yourself becoming more aware of other visual or sensory cues in your commute that indicate your orientation: geographical landmarks, air currents, inclines, or the position of the sun, moon, and stars.
(1x) Parallax 3-Axis Compass Module Radioshack 276-123
(1x) 85dB Piezo Buzzer Radioshack 273-060
(1x) Arduino Uno REV 3 Radioshack 276-128
(1x) 9V Alkaline Battery Radioshack #23-866
(1x) Heavy-Duty 9V Snap Connectors Radioshack #270-324
(1x) PC Board with Copper Radioshack #276-147
(1x) SPST PC-Mountable Submini Toggle Switch Radioshack #275-645
(2x) Male Header Pins Jameco 103393
(1x) Female Pin Sockets Jameco 308567
(1x) 9-Volt Battery Holder Radioshack 270-326
Heat Shrink Radioshack #278-1611
22 Gauge Wire Radioshack #278-1224
Solder Radioshack #64-013
4-40 x 1" nuts and bolts
Step 1: Schematic
Step 2: Solder header pins to perf board
Step 3: Parallax compass
Upload the following code onto the Arduino. It will print the raw x, y, and z data from the compass chip (the directions are indicated on the chip in figure 4). If you have wired everything correctly you should see the raw data printed on your serial monitor (control/command+shift+m) in the Arduino IDE. I found this code on the parallax website.
Step 4: Piezo buzzer
Solder the red lead from the piezo buzzer to digital pin 7. Solder the black wire to Arduino ground.
Step 5: Power connections
Solder the red lead from the battery snap to one of the outside pins on the switch. Solder a red wire between the middle pin of the switch and the Vin pin on the Arduino. Solder the black lead from the battery snap to Arduino ground.
Step 6: Firmware
The piezo buzzer automatically buzzes at ~1Hz. You can upload the code below if you want to hear the full buzzing potential of the buzzer.
I found this buzzing to be a bit much so I pulsed power on and off to the buzzer to quiet it a bit. See the code below:
Step 7: Secure arduino, buzzer, and battery clip to enclosure
Make sure to orient the arduino so that the x axis of the parallax chip is parallel to the long edge of the project enclosure (fig 3).