TinyCompass

37,897

649

50

Posted

Introduction: TinyCompass

In this Instructable, we will be building a compass using the TinyShield Compass as well as the Circle Edge Led shield. Before starting, the proper drivers must be installed to detect the COM ports. These drivers must be installed before downloading any codes from the codebender plugin. The drivers needed can be found here.

Step 1: Materials

Lucky for us there are no downloads for this project, we can simply use the codebender plugin to directly program our TinyDuino.

Materials

  • TinyDuino Processor w/Battery Holder : link
  • TinyShield USB: link
  • TinyShield Compass : link
  • TinyShield Circle Edge LEDs: link
  • CR1632 3V coin cell battery

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 HoneywellHMC5883L 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.

Share

  • works great!-Reza Azar

    Reza Azar made it!

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

48 Comments

I reckon thats a sweet idea! Do you know if you can get rechargeable batteries that small? That way it could be linked into a car stereo and charge. Nice work.

I don't know about rechargable batteries, I suspect that there are some available, however you might also look for supercapacitors as an alternative as well. The battery series that the tinyduino uses is the cr16xx series, no larger than the cr1632. The dimensions for this series are a cylinder 16 mm in diameter, and no more than 3.2 mm top to bottom. You can use smaller batteries or supercaps, but not larger. Voltage of 3-3.3v, even up to 5.5v should work. The processor board does _not_ have a voltage regulator on it though, so don't put two 3v batteries back to back in the slot (otherwise a pair of cr1616 or smaller batteries might work) or you will exceed the recommendations of the component manufacturers. (I'm not saying that it _won't_ work, or that it _will_ destroy your board, just that the manufacturer would consider this a bad idea.)

Thanks for the reply very helpful. Seems you know a lot about electronics wish I knew more.

I've been playing around in the field, and working in related fields for most of my life. That said, I've learned one thing through the years, if you are interested in a topic, the tools needed to learn more are out there. (Exceptions are mostly found in the doctorate level work where you end up creating the tools needed to expand human knowledge in some way or another.) What works for one person learning isn't necessarily going to work for anyone else though, so if I were to recommend one engineer's course, or another, it may help, but it may also drive you away from the field. The most important element I think is curiosity, and recognizing that there is only one person responsible for you learning any field, and that's you. Others may encourage you, stoke your curiosity, or help you get there, but only you can recognize that you have something to learn, and make the effort to learn it.

With over 25 years in IT and only recently earning my degree, I agree with you 100% when you say:

"The most important element I think is curiosity, and recognizing that there is only one person responsible for you learning any field, and that's you. Others may encourage you, stoke your curiosity, or help you get there, but only you can recognize that you have something to learn, and make the effort to learn it."

Are there any cheaper options? I know you can get knockoff arduinos for a couple bucks so if you could with these boards too that would be great. I cant justify spending $68 on something so useless. Its cool don't get me wrong but its utterly useless.

This instructable was made by the company Tinyduino to showcase one of their produces. As with many makerstuff suppliers, Tinyduino's wares (like Adafruit's and Sparkfun's) are way more expensive than buying the components off of eBay from Hong Kong. I just saw a HMC5883L breakout board on eBay for $1. However, forget about customer service, and maybe I'm the only one who feels a twinge when I pull a great project tutorial from one of these suppliers, and then look for all of the parts elsewhere. Then again, you can do a lot more tinkering when they are 90% cheaper!

Thanks. My thoughts exactly on the last part. Cheaper parts = more tinkering. And i'm really not going to spend $70 on a compass that isn't water proof, Only works after you take time to calibrate it, Only works in a civilized area with batteries, and is missing a ton of functionality. If you have the parts on hand though i suppose it could be a fun build to help you learn to code, and i'm not a coder, just a builder. =P

You're welcome to use a digital compass without calibrating it. Pretty much every digital compass I've seen includes the recommendation that it be calibrated, but you're welcome to use one without doing that. I understand it's a good way to become lost. (Note that compass directions provided by GPS units in cars are usually derived from your motion as detected by the GPS monitoring satellites for position information. It doesn't require calibrating, but is also not using a magnetic compass. The digital compass in your phone very likely does include a setup step to calibrate it.

As for battery life, yes you will need batteries or a 3.3-5v power supply of some sort. That's true for pretty much any digital device. But you should also keep in mind that also includes the computer you're using, in as far as you're still going to need a supply of power sufficient to operate that computer. And unless you've built a computer out of scrounged parts and a Raspberry Pi, you've likely spent (or someone has spent) significantly more than $70 for what you're using.

If you are thinking that switching to a magnetic needle compass and avoiding the digital realm entirely, remember that there is only a limited part of the US where magnetic North has any real relationship to true north. I happen to live close enough to that zone not to make a lot of difference, but I wouldn't suggest that anyone disregard knowing what the magnetic declination of their location is. This is true of digital magnetic compasses as well, and it bother's me a little bit that most digital compasses and compass apps on phones don't have a way for you to enter a magnetic declination correction.

As to waterproof, no argument, though I know a lot of digital devices that are not waterproof, including most phones, tablets, PCs, and so on. You can work around the issue to some degree with a ziplock bag, or building a waterproof housing. But I realize it's a lot easier to dis the people interested in seeing what they can do that's interesting to them with off the shelf or newly created tools. Keep it up.