Tag: Adafruit HMC5883

1 articles found.

HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module

HMC5883L / QMC5883L Compass Library for Proteus V1.0: the GY-271 module with its STATUS panel and the Advance pop-up

Hello friends, I hope you all are doing great. Today, I am going to share the new HMC5883L / QMC5883L Compass Library for Proteus V1.0. The GY-271 is the small blue compass module that you find in robots, rovers, drones and digital compass projects. It measures the Earth's magnetic field on three axes, and from two of them the Arduino works out the heading: how many degrees the board points away from north. There is a catch: GY-271 boards come with two different chips, the HMC5883L and the QMC5883L, and a sketch written for one does not work on the other. Now you can build and test both in Proteus. Behind the parts sit our own models, not parts that show a number. Each chip answers the Arduino exactly as its datasheet says, with its own address, its own registers and its own byte order. You turn the board to any heading, put a magnet on it, tilt it, or turn it a full circle while the sketch calibrates. You get four devices: each chip as a Simple device with a live STATUS panel and the board's controls, and as an Advance device with a pop-up window and the test tools. The demo runs the Adafruit HMC5883 Unified library on our Arduino UNO V4.0 and finds whichever chip is on the board. NOTICE: a compass is easy to fake: hand the Arduino a heading from a property. We wanted more. Our GY-271 feels the Earth's field from the direction the board points, adds the magnet and the tilt, and turns the result into the chip's own counts and registers, so the Adafruit library reads it ...