In this Instructable, we will be building a compass using the TinyShield Compass as well as the Circle Edge Led shield.
Step 1: Materials
After getting your boards and battery, the Arduino IDE will be the first thing to download if you have not done so already. When the IDE has been loaded go to tools, board, and select Arduino Pro or Pro Mini (3.3V, 8MHz) w/ ATmega328.
- TinyDuino Processor w/Battery Holder : link
- TinyShield USB&ICP: link
- TinyShield Compass : link
- TinyShield Circle Edge LEDs: link
- CR1632 3V coin cell battery
- Arduino IDE 1.0.6 : link
Step 2: Programming the Tiny Duino
The code below was used for the TinyCompass and has comments throughout to help explain what is going on. The magnetometer used for our compass board is the Honeywell HMC5883L 3-axis compass. This code can be downloaded to your computer or directly uploaded to your TinyDuino processor board.
Step 3: Calibration
After your TinyDuino has been programmed you can remove the USB Shield. Each time you turn on or restart the processor, you will need to calibrate it. To calibrate, simply rotate it 360 degrees on each axis (the gifs above show exactly what to do). We now have fully functional compass that takes up less than a cubic inch of space! Because of how sensitive the HCM5883L chip is, ferromagnetic materials, magnetized or not, within a 2 inch radius of the chip will cause disturbances.