Shop OBEX P1 Docs P2 Docs Learn Events
getting HM55B Compass to work — Parallax Forums

getting HM55B Compass to work

compuwizcompuwiz Posts: 20
edited 2009-02-18 00:07 in Propeller 1
Hi I'm Matt. I'm a sophomore in high school and for my science project I'm creating a mobile autonomous robot. It's a boe-bot chassis and Education board with a spin stamp. It will use 3 ping sensors and a compass and gps to navigate to a given coordinate. It also has the 2x16 nonbacklit serial lcd. The compass is wired correctly and it supposedly initializes but all I get for x, y, theta, or degrees are zeros. I'm stumped and my projects due next week anyone have any ideas? Code is attached.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-28 20:54
    Hello compuwiz,

    in the HM55B Compass Module DEMO V1.0
    democode the wiring shows supply-voltage 3.3V
    your code shows supply-voltage 5V

    if connected directly to 5V the propeller-chip might be damaged
    you have to use 1k resistors between Prop-IO-Pin and a 5V device
    as a current-limiting resistor

    @Parallax:

    the doc http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/HM55BModDocs.pdf

    says minimum supply-voltage 4.8V
    the HM55B Compass Module Asm.spin-file says 3.3V
    so what's valid ???

    the docs say

    Do not apply magnetic fields in excess of 300 μT to the Compass Module. Magnetic fields
    stronger than 300 μT can permanently damage the sensor.
    • Mount the Compass Module as far away as possible from magnetic field disturbances. These
    include magnets (including compass needles), motors, power cords, coils, metal boxes, and
    sometimes the ground.

    best regards

    Stefan
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-28 21:10
    StefanL38,

    The OBEX has been updated with version 1.2 to indicate a proper 5V supply to the compass.

    Initially I had used the compass with a 3.3V supply without any problems, but after re-visiting and studying the documentation more thoroughly, I decided that with 3.3V I was just barely within the operating margin of the compass.



    (See a recent E-mail reply below)

    Jeff Martin,

    I think it's ok to run the compass at 3.3V, but "just" ok ... I did look at the datasheets. I have powered the compass at both 3.3V and 5V and have not observed any measurable difference.

    The integrated circuit datasheet indicates that the minimum voltage to the compass should not go below 2.7V and that the maximum current for the compass is only 13mA (typically 9ma). (Hitachi HM55B Integrated Circuit Datasheet)

    The compass documentation (Hitachi HM55B Compass Documentation) datasheet uses a low dropout regulator that has a maximum dropout of 1.2V at 100mA.
    pdf1.alldatasheet.com/datasheet-pdf/view/8863/NSC/LM3480IM3-3.3.html

    Since the Compass is only using a maximum of 13mA the maximum dropout is about 1V (at 10mA) with a typical dropout of 0.7V.


    This equates to the compass seeing something between 2.3V to 2.6V with a 3.3V supply. As the ambient temperature increases the voltage that the compass "sees" actually improves. Likewise it worsens at the ambient temperature decreases.


    All said, I updated the OBEX with the same file attached to this E-mail.


    Beau Schwabe
    IC Layout Engineer
    Parallax, Inc.
    Web: http://www.parallax.com
    Email: bschwabe@parallax.com

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 1/28/2009 9:18:07 PM GMT
  • compuwizcompuwiz Posts: 20
    edited 2009-01-28 21:30
    I got it to work. While moving it farther from the motors I realized that the vdd pin didn't have the vdd wire connected to it. The wire was 1 pin up. In my defense it's kind of confusing with the pcb sticking out past the pins. Thanks for everything though. Sorry for wasting your time
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-28 21:34
    compuwiz,

    I'm glad that you got it working, but please follow the current limiting resistor suggestion between the Compass and the Propeller so that you do not damage one of the Propeller and/or Compass I/O pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • compuwizcompuwiz Posts: 20
    edited 2009-01-28 22:43
    okay, thanks a bunch
  • compuwizcompuwiz Posts: 20
    edited 2009-01-30 00:35
    When I added the 1k resistor my compass readings didn't work anymore and there have been no negative effects.
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-02-02 23:35
    I have gotten the compass to work with a prop on my robot, along with a single ping sensor and no GPS. What you are doing is amazing for a high school student.

    I connected my Compass at 3.3 V and no resistors and it works well. If you have any questions, let me know.
  • compuwizcompuwiz Posts: 20
    edited 2009-02-02 23:37
    Thank you Mr. George Collins
  • compuwizcompuwiz Posts: 20
    edited 2009-02-10 17:57
    At science fair over the weekend I took 2nd place in the engineering division (which was the largest division with 15 high schoolers). I also got a special award for a $1000 savings bond. Thank you for all your help!

    Matt
  • Ken PetersonKen Peterson Posts: 806
    edited 2009-02-10 18:57
    Wow...what kind of project took 1st place?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"I have always wished that my computer would be as easy to use as my telephone.· My wish has come true.· I no longer know how to use my telephone."

    - Bjarne Stroustrup
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-02-10 23:39
    compuwiz,

    That's great!! do you have a link or any pictures of the event?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • compuwizcompuwiz Posts: 20
    edited 2009-02-11 21:50
    Ken Peterson said...
    Wow...what kind of project took 1st place?

    a project on the viscosity of alternative fuels. This the third year she was doing her project and her father is the president of a research lab. My teacher said I would have won but I undersold how much work I put into my project. Ah well, not bad for a first year sci research kid who was finishing his project literally the morning of.
  • Ken GraceyKen Gracey Posts: 7,400
    edited 2009-02-11 22:32
    compuwiz,

    First, congratulations! We have a place for you on the Parallax web site:

    http://www.parallax.com/Education/WinnersCircle/tabid/359/Default.aspx

    The Winner's Circle. If you are interested in being shown please provide some pictures and the explanation. We'll send you some free hardware of your choice.

    Ken Gracey
    Parallax, Inc.
  • compuwizcompuwiz Posts: 20
    edited 2009-02-11 23:40
    My robot uses the parallax boe-bot chassis, servos, and board of education rev. e development board. There are three sensors used: a parallax gps, a Hitachi HM55B compass, and a Parallax Ping))) sensor. Legos are used for the second level of the robot along with a piece of cardboard with two breadboards mounted on them. All the logic and servo movement code was hand-coded while the interface code to the various sensors was either found on the Parallax object exchange or on the internet. The movement code allows the wheels to move in any necessary configuration. The logic of the robot is to look at its current latitude, compare it to the hardcoded destination latitude and move north or south to make them equal. The robot then does the same thing with the longitude, driving east or west until the longitudes match up. The robot checks its pings right before and right after it moves to make sure it doesn't run into anything. If an obstacle is detected then the robot backs up, does a 90 degree right turn, drives forward, does a 90 degree left turn, and continues on its way. I can give you the code tomorrow. Pictures are attached.
    2576 x 1932 - 909K
    2576 x 1932 - 1013K
    2576 x 1932 - 975K
    2576 x 1932 - 805K
    2576 x 1932 - 893K
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-02-12 04:36
    Your robot is very cool. Please share code your code if you can. My goal is to program my robot to use a sensor and a compass to make a simple map of my house on the EEPROM and then be able to play back the map on the television.

    It's amazing what you have already accomplished.
  • compuwizcompuwiz Posts: 20
    edited 2009-02-18 00:07
    Sorry for the delay but this was the final weekend for First Robotics before we had to ship. Code is attached
Sign In or Register to comment.