Shop OBEX P1 Docs P2 Docs Learn Events
Any luck with the HMC5883L Compass Module? — Parallax Forums

Any luck with the HMC5883L Compass Module?

BonanzaManBonanzaMan Posts: 17
edited 2014-12-17 04:38 in Propeller 1
I recently bought the Compass Module 3-Axis HMC5883L (#29133) and have been trying to get it to product accurate headings. I downloaded, updated (SDA & SCL pin assignments) and ran the demo program from the product page (HMC5883L_demo.spin), but as-is, the demo program headings all seem to be in the NE quadrant and wont swing through a full 90 degrees in this quadrant anyways. Anybody have a working object or demo program?

Thanks,
Greg

Comments

  • IratenateIratenate Posts: 7
    edited 2014-12-16 17:24
    I had a very similar problem with my compass module. I was powering it with the 3.3V port on a Gadget Gangster platform. When powered using the 5v port, it worked great.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-12-16 17:55
    Iratenate wrote: »
    I had a very similar problem with my compass module. I was powering it with the 3.3V port on a Gadget Gangster platform. When powered using the 5v port, it worked great.
    As I mentioned in this thread, the HMC5883L will run on supplies from 2.16V to 3.6V. Unless the board you're using has a voltage regulator to reduce the 5V to a safe level, it will likely damage the sensor board.

    Edit: The Parallax board does have a regulator so 5V is fine when using the Parallax board.

    I've successfully used several different HMC5883L sensors many times powered with 3.3V. Here's a link to my HMC5883L code. I attempted to use a HMC5883L sensor for attitude feedback in this project but I had the sensor too close to the servos. Once I moved the sensor away from the servos a few inches, it worked much better.

    Again, unless the board with the HMC5883L sensor has a way of regulating the power supply, it should NOT be powered with 5V (the Parallax board does uses a voltage regulator so 5V is fine on it). 3.6V is the maximum voltage to be used with the sensor.
  • HughHugh Posts: 362
    edited 2014-12-17 04:38
    +1 on Duane's code.

    Works a treat!
Sign In or Register to comment.