With the recent surge in Omicron cases, shipping may be slower than stated times. We are working to build, ship and respond to everything as quickly as possible. Please see all COVID-19 updates here. Thank you for your continued support.

Digital Compass Info Video

Thinking about using a digital compass? Watch this video first!

Favorited Favorite 0

If you're building an autonomous vehicle or a hand-held GPS (or any other device where direction might be important), a digital compass (sometimes called a magnetometer) is a great little sensor to add to your design. However, if you haven't played around with them much, you might not know which type of compass is good for your specific project (for example, do you need tilt-compensation?).

Check out this video we put together. Here, SparkFun Engineer Chris explains a little bit about digital compasses and helps clear up some common issues people have with them.

Comments 15 comments

  • Hi dotMusclera,
    Can I get your email address to ask you few questions about your wii nunchuck interfacing with microchip PIC18f4550 I2C? My email is prashan@uow.edu.au

  • Great video. One suggestion - maybe show some sample arduino code on how to talk to the sensor. I know there are different communication styles, but perhaps just pick a basic one so viewers can get a sense of how easy/difficult it actually is to talk to these sensors.

  • I made a GPS guided vehicle using the HMC6352. That has no tilt compensation. I find it to work well enough. Just keep it away from the electronics on the vehicle. Here is the bot http://letsmakerobots.com/node/18922. I also did a write up on how to make a GPS guided vehicle, which i will hopefully update when i get a new vehicle with a ESC. http://letsmakerobots.com/node/19554

  • If you are working on a RPV, the tilt compensation available with the compass modules shown will not always work correctly since they determine the local down vector based on the output of accelerometers which will sense vehicle accelerations when the RPV is banking or pitching.
    They will, however, output correct data during straight and level flight.
    This won't help much if you are trying to use it to drive an autopilot, however.

  • Nice demonstration. However, I'm wondering what happens when you flip the board. Obviously your heading would be wrong for a 2-axis magneto, but does a tilt compensated 3-axis take care of this automatically?

  • Really nice !
    Very interesting, and while i was watching the sequence with the magnet, i was thinking of using the fact that the compass get the "new north" position to create a kind of new control component, like getting the information from a sliding door or something like that !

  • Sparkfun should do a tutorial on how to make a handheld GPS.

    • How about a tutorial for making a frickin' shark mounted laser firing system? I'm sure tilt compensation would be required then.

    • Actually...I am just putting the finishing touches on one I built. When I get it completed I'm going to put together a tutorial. Stay tuned!

Related Posts

Recent Posts


All Tags