HMC6352 Electronic Compass on Arduino

Blogged by Mathieu as Electronics, Photography — Mathieu Sat 13 Oct 2007 18:05

My sensors got in over the week, and after some running on today, I managed to find a soldering iron to cable them into the arduino prototype shield. I decided to start with the HMC6352 electronic compass, and made this little demo.

HMC6352 Electronic Compass on Arduino.

The led that is lit is within +/- 45 degrees of North, and for debug purposes it also outputs the value on the serial port. I’ll be doing some stuff which I hope will be a little more interesting soon, but I’m waiting on (yet more) parts.

11 Comments »

  1. Comment by Matt Swann — October 14, 2007 at 23:06

    Sweet! This reminds me of my ideas for a helicopter autopilot…

  2. Comment by Mathieu — October 15, 2007 at 9:08

    Well, I was thinking glider rather than helicopter, since I don’t know how to pilot the latter, but yeah, that is one long term goal of mine. There are GPL’d projects out there with both hardware and software open-sourced, but it’s more fun to build your way up step by step.

  3. Comment by Di — October 16, 2007 at 12:32

    I guess it goes without saying that it’s entirely possible that it reminds me of nothing but the inside of my transistor radio after it fell from my top bunk while I was reading at night …

    Hey, how’s things? I haven’t checked by for a while because you cooked and disappeared.

  4. Comment by Mathieu — October 16, 2007 at 15:14

    Doing good, thank you -) Enjoying your photos, by the way, sorry to hear Gert hurt himself in the pursuit of a shot.

  5. Comment by condo geecko — October 18, 2007 at 3:31

    The serial hobbyist strikes again! (8->

  6. Comment by schuey — October 20, 2007 at 21:30

    a new hobby ! )

  7. Comment by Michele — June 9, 2008 at 12:28

    Hi,

    this is great!!! Would you share the Arduino code?

    Thanks

    Michele

  8. Comment by Mathieu — June 14, 2008 at 20:33

    Hum… Don’t think I kept the code for this little sketch, but there is a lot of code on the web for running that sensor on an Arduino. There’s a 3-axis magnetometer waiting for me at home so the next step will be a orientation-independent compass.

  9. Comment by Stephen — January 17, 2009 at 3:33

    That is very cool – does it have to be constantly powered on though or at least set up when it’s powered on so it knows what direction north is?

    And obviously the number of LEDs you use to display the direction of north is only limited by your output ports.

    It would be crazy to see this done with 360 LEDs for +- .5 degree accuracy.

    When you build the orientation independent compass which feeds data to a serial port you’ve got a seriously effective component for an autopilot system.

    Your terms and conditions at the bottom of your blog don’t ask for much at all do they, “You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.”

  10. Pingback by Electronic compass on an Arduino | SquareCows — January 17, 2009 at 22:40

    [...] like the looks of this electronic compass sensor paired with an Arduino protoshield. It would be fun to drive a servomotor with this data, to create a digital/analog [...]

  11. Comment by Mathieu — February 1, 2009 at 11:47

    Hi Stephen,

    The sensor gives you direction from North, so no, it doesn’t need to be set up in any way when you power it up.

    As for multiple LEDs, I recently scored some free TLC5940s which you can use to drive as many LEDs as you like. I made a version of this with 16 of them.

    -)

    Lastly, as for my T&Cs, the point I’m trying to make is that such T&Cs making ridiculous claims are themselves BOGUS AGREEMENTS and should disappear from our civilization’s legal space.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Click on smiley to insert!

) (w) (u) p (y) (n) d (*) o) 8) ( (f) (g) (t) o (8) (l) (i) x (~) (e) $ (&amp) (c) ( s (d) (o) (@) (p) (^) (b) [

Proudly powered by wordpress - Theme Back in Black 2 by neuro