TEP DOWNLOAD CENTER

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

Libraries Code Projects Simulation
tep://download-terminal gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip ZIP archiveV1.0Verified14 downloadsFree
HMC5883L / QMC5883L Compass Library for Proteus V1.0: the GY-271 module with its STATUS panel and the Advance pop-up
Proteus library · File 1 of 1

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

HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module comes as a ZIP archive of 10 files (1.2 MB, 2.8 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware.

  • LIBProteus library
  • DLLProteus model
  • DSNProteus simulation
  • INOArduino sketch
  • HEXHEX firmware

Description

This is the download page of HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module, the file package of the tutorial HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module, published on The Engineering Projects in October 2026. Here you get the ZIP file (1.2 MB) with the Proteus library files (LIB and IDX), the simulation model (DLL), a ready Proteus simulation, an Arduino sketch and the compiled HEX firmware, the list of files it contains, the README when there is one, and the installation steps in order.

What this library is

GY-271-Compass-Library-for-Proteus-v1.0.zip with the GY-271 compass module with the HMC5883L or the QMC5883L, Simple and Advance (TEPCOMPASS.LIB and TEPCOMPASS.DLL), our Arduino UNO V4.0 library with its built-in serial monitor (ArduinoV4TEP.LIB and TEPARDUINO.DLL), the two-UNO simulation with its HEX file, the demo sketch and a README.

This is version 1.0; older or newer releases, when they exist, are listed in the Development tab.

What is inside the ZIP file

  • ArduinoV4TEP.LIB – Proteus library, 201.9 KB
  • TEPCOMPASS.LIB – Proteus library, 122.4 KB
  • TEPARDUINO.DLL – Simulation model, 883.5 KB
  • TEPCOMPASS.DLL – Simulation model, 320.5 KB
  • GY-271-Compass-ArduinoUnoV4.pdsprj – Proteus simulation, 23.8 KB
  • GY271_Compass_Demo.ino – Arduino sketch, 8.7 KB
  • and 4 more, all listed in the File Structure tab

The archive unpacks to 2.8 MB and carries its own README (README.txt), shown in the README tab above.

How to download

Use the download panel at the top of this page: after the counter (30 seconds for guests, 10 for members) the black button unlocks and the ZIP file comes straight from our content network. If the browser opens it instead of saving, use Save as; extract the whole archive before using anything inside it.

How to install

  • Step 1: Extract the ZIP file with Windows (Extract All), 7-Zip or WinRAR, keeping its folders.
  • Step 2: Close Proteus and copy ArduinoV4TEP.LIB and TEPCOMPASS.LIB into its LIBRARY folder (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
  • Step 3: Copy TEPARDUINO.DLL and TEPCOMPASS.DLL into the MODELS folder next to it, so the part simulates.
  • Step 4: Start Proteus, press P and search for "ArduinoV4TEP"; place and wire it as in the tutorial.
  • Step 5: Open GY271_Compass_Demo.ino in the Arduino IDE, pick board and port and Verify (Export Compiled Binary gives the HEX).
  • Step 6: In Proteus set the controller's Program File to GY271_Compass_Demo.hex; on hardware, flash the same file.
  • Step 7: Open GY-271-Compass-ArduinoUnoV4.pdsprj in Proteus and press Play.

Read the detailed guide

This page is for the files. The tutorial above explains the circuit and the code step by step and shows the working results and the simulation; read it before you build. Questions about the download or the installation go in the comments below; more Proteus downloads are listed further down this page.

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

File Structure

gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip10 files · 5 folders · 2.8 MB unpacked
GY-271-Compass-TEP-v1.0/10 files · 2.8 MB
Arduino Code/1 file · 8.7 KB
GY271_Compass_Demo/1 file · 8.7 KB
INO GY271_Compass_Demo.inoArduino sketch 8.7 KB
Proteus Library Files/2 files · 324.3 KB
LIB ArduinoV4TEP.LIBProteus library 201.9 KB
LIB TEPCOMPASS.LIBProteus library 122.4 KB
Proteus Model Files/2 files · 1.2 MB
DLL TEPARDUINO.DLLSimulation model 883.5 KB
DLL TEPCOMPASS.DLLSimulation model 320.5 KB
Proteus Simulation/4 files · 1.2 MB
DSN GY-271-Compass-ArduinoUnoV4.pdsprjProteus simulation 23.8 KB
HEX GY271_Compass_Demo.hexCompiled HEX file 40.6 KB
DLL TEPARDUINO.DLLSimulation model 883.5 KB
DLL TEPCOMPASS.DLLSimulation model 320.5 KB
TXT README.txtText file 35.8 KB

README

README.txt 412 lines
GY-271 COMPASS LIBRARY FOR PROTEUS - V1.0 (the GY-271 module with the HMC5883L or the QMC5883L magnetometer)
Designed by The Engineering Projects
www.TheEngineeringProjects.com

IMPORTANT LINKS
Article (read it first - pictures, step by step, every feature explained):
  https://www.theengineeringprojects.com/2026/10/hmc5883l-qmc5883l-compass-library-for-proteus-v1-0.html
Report a bug or suggest a feature (our forum):
  https://www.theengineeringprojects.com/forum/category/gy-271-compass-proteus-library
The demo runs on our Arduino UNO V4.0 (included) - working LEDs, RESET and a
built-in serial monitor, no Virtual Terminal to wire - its own article:
  https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
The built-in monitor is our TEP Serial Monitor Advance - its own article:
  https://www.theengineeringprojects.com/2026/10/serial-monitor-advance-proteus-library.html
Support us (the libraries are free):
  https://www.theengineeringprojects.com/donate

FILE STRUCTURE
GY-271-Compass-TEP-v1.0/
|-- Proteus Library Files/
|   |-- ArduinoV4TEP.LIB                              201.9 KB   TEP Arduino boards V4.0 (UNO), to LIBRARY
|   |-- TEPCOMPASS.LIB                                122.4 KB   the GY-271 (HMC5883L / QMC5883L), to LIBRARY
|-- Proteus Model Files/
|   |-- TEPARDUINO.DLL                                883.5 KB   the Arduino board model, to MODELS
|   |-- TEPCOMPASS.DLL                                320.5 KB   the HMC5883L / QMC5883L model, to MODELS
|-- Proteus Simulation/
|   |-- GY271_Compass_Demo.hex                         40.6 KB   both UNOs (demo sketch V1.0)
|   |-- GY-271-Compass-ArduinoUnoV4.pdsprj             23.8 KB   demo: 2 UNOs, HMC5883L / QMC5883L
|   |-- TEPARDUINO.DLL                                883.5 KB   copy of the board model
|   |-- TEPCOMPASS.DLL                                320.5 KB   copy of the model
|-- Arduino Code/
|   |-- GY271_Compass_Demo/GY271_Compass_Demo.ino       8.7 KB   the demo sketch (source of the .hex)
|-- README.txt                                        ~37.1 KB   this file
Total: 2.78 MB (unzipped). The C++ source code of the model is not included.

WHAT IS IT?
Simulation models of the popular GY-271 compass module in its two versions -
with the HMC5883L (Honeywell, the original) and with the QMC5883L (QST, what
most GY-271 boards carry today, often still printed "HMC5883L") - with the
board's heading, the Earth's field and the things that pull a compass off.
Our own models, not a part that shows a number:
  * The HMC5883L at 0x1E as its datasheet describes it: CRA (the samples
    averaged, the data rate 0.75 to 75 Hz, normal or self-test bias), CRB (the
    gain, +-0.88 to +-8.1 Ga, 1370 to 230 counts a gauss), MR (continuous,
    single - then idle - or idle), the data X, Z, Y high byte first (-2048 to
    2047, -4096 on overflow), SR (RDY, LOCK), the ID "H43"; the pointer rolls
    from 0x08 back to 0x03; LOCK holds the data while only some of the six
    bytes are read; DRDY low for 250 us at each new data.
  * The QMC5883L at 0x0D as its datasheet describes it: the data X, Y, Z low
    byte first, STATUS (DRDY, OVL, DOR), the temperature, CONTROL 1 (standby
    or continuous, 10 to 200 Hz, +-2 or +-8 G, OSR 512 to 64), CONTROL 2
    (INT_ENB, ROL_PNT, SOFT_RST), SET/RESET (0x01 recommended), the chip ID
    0xFF; 12000 or 3000 counts a gauss; DRDY high while new data waits.
  * The world: the board's heading from magnetic north, the Earth's field
    (property FIELD, 50 uT, and INCLINATION, 60 degrees down), a MAGNET on the
    board (X +35, Y -22, Z +18 uT that turn with it - hard iron), the board
    TILTED 30 degrees, a full turn in 8 s (ROTATE); each chip's own small
    offset; about 0.2 uT of noise (property NOISE).
  * The classic GY-271 trap, caught and explained: a sketch that keeps calling
    the OTHER chip's address (an HMC5883L library on a QMC5883L board) gets no
    answer - the model counts the calls, shows them in red and logs them; a
    single probe (a scan that tries both addresses) is only noted.
  * The other classic mistakes, each with a clear note: data read before any
    measurement, a write to a read-only register, a field beyond the range,
    LOCK after a partial read, continuous mode without SET/RESET.
The modules are drawn at about three times their real size: the blue GY-271
with the chip (marked "L883" or "DA 5883"), its regulator, the pull-ups and
the set / reset capacitors, the X / Y arrows; the header VCC GND SCL SDA DRDY
on the left. ON the board, as TEP additions: the SIMPLE / ADVANCE badge, the
PWR, I2C (a transaction) and DRDY (new data) LEDs and the panel button. The
LEDs, the badge, the button and the panels are TEP additions; the real
modules have none of them.

FOUR DEVICES IN ONE LIBRARY (search "5883" in Pick Devices):
  Simple    HMC5883LTEP     "GY-271 Compass HMC5883L V1.0 - Simple"
  Advance   HMC5883LADVTEP  (the same, "- Advance")
  Simple    QMC5883LTEP     "GY-271 Compass QMC5883L V1.0 - Simple"
  Advance   QMC5883LADVTEP  (the same, "- Advance")
            (pins VCC GND SCL SDA DRDY on the left; category Sensors >
            Magnetometer)
  Simple    On-Sheet Panel: the STATUS panel under the module - the banner
            (READ X Y Z uT - HEADING 90.0 deg E (THE BOARD 90 deg) / the trap
            and the latest warning in red / ROTATING in amber), HEADING (- / +
            in 15 degree steps), the eight points N to NW, three actions
            (ROTATE 360, MAGNET, TILT 30), ten readouts and the last 4 events.
            The red X closes the panel, PANEL: ON / OFF on the board opens it.
  Advance   Pop-Up Panel: only the module on the schematic; at Run a TEP
            pop-up window opens - the look of the TEP Serial Monitor. Tabs
            Sensor, Event log and Tests; gear and ? icons for Settings and
            Help; the palette icon switches the theme:
              Sensor     the eight points on the toolbar; THE BOARD (heading
                         -15 / -5 / +5 / +15, the Earth's field, ROTATE 360,
                         MAGNET, TILT 30); WHAT THE SKETCH READ (a compass
                         rose - green: the board, amber: from the reading -
                         X, Y, Z and the heading); THE CHIP'S REGISTERS and the
                         chip check; THE LAST I2C TRANSACTION and the ones
                         before it
              Event log  power, the reads and writes, the board, notes,
                         warnings; filters All / I2C / The board / Warnings,
                         Pause, Clear
              Tests      I2C, Readings, Heading & calibration, Registers
                         (THE TEST TOOLS)
              Settings   theme, text size, open at Run, window size
              Help       report a bug, suggest a feature, article, updates,
                         donate, forum; Copy diagnostics for a bug report
            The OPEN PANEL button on the board opens the window again.
All four devices use one model, TEPCOMPASS.DLL.

TEST STATUS
V1.0: verified in Proteus 8.5 on 17 Oct 2026 (the demo project as shipped:
two Arduino UNO V4.0 boards with their built-in monitors; node 1 with the
Simple HMC5883L module at north, node 2 with the Advance QMC5883L module at
north-east).
What the runs showed:
  * Each UNO finds its chip - "found an HMC5883L at 0x1E (ID H43) - the
    Adafruit HMC5883 library" and "found a QMC5883L at 0x0D (chip ID 0xFF) -
    set up with Wire" - and reads it twice a second: "#1  X 26.5  Y -1.3
    Z -47.1 uT  heading 357.2 deg N" on node 1, "#1  X 16.1  Y 18.7  Z -44.0
    uT  heading 49.2 deg NE" on node 2.
  * U2's pop-up and monitor: E - "heading 94.2 deg E" (the chip's own small
    offset); MAGNET - "heading 8.0 deg N"; CAL with ROTATE - "heading 90.0
    deg E" again with the magnet still on (the Heading & calibration tool:
    offsets X +33.1, Y -20.4 uT, corrected 90.9 deg); TILT 30 - "heading
    130.9 deg SE"; TRAP - "TRAP: X -0.09  Y -0.09  Z -0.10 uT  heading 225.0"
    (nobody answers 0x1E) and the pop-up's red trap banners; RAW - "RAW: E2
    03 8C 00 EE FC  (X Y Z, low byte first)  X 994  Y 140  Z -786 counts";
    the Event log and the four tools.
  * Node 1 with the real mouse (3 wheel steps on U1): W - "heading 273.4 deg
    W"; two clicks on the heading's + - "heading 302.2 deg NW"; MAGNET -
    "heading 317.7 deg NW"; RAW - "RAW: 02 18 FE F4 FE 1A  (X Z Y, high byte
    first)  X 536  Y -486  Z -268 counts"; TRAP on the HMC5883L board works -
    "TRAP: X 48.64  Y -44.55  Z -27.24 uT  heading 317.5"; N; U1's red X and
    PANEL.
  * 71.9 s of simulation took 146 s - about 0.5 x real time with the pop-up
    and both monitors open.
  Plus automatic checks on a PC, 0 failed: 62 on the model (a bit-level I2C
  master doing what Adafruit HMC5883 Unified 1.2.4 and QMC5883LCompass 1.2.3
  do over Wire - the HMC5883L: the 1 ms after power-on, the ID, the
  defaults, data before a measurement, begin() and getEvent(), the counts at
  gain 1090, the heading, the pointer's roll-over, LOCK, single measurement,
  overflow, the self-test bias, the noise; the QMC5883L: the chip ID,
  standby, init(), the counts at 8 G and 2 G, DRDY / DOR / OVL, the pointer
  roll-over, the soft reset, the DRDY pin; both: the trap, a full turn and
  the hard-iron offsets it reveals, the magnet, the tilt) and 4 on the
  pop-up; the demo project read back from disk (69 checks: devices, pins,
  wires, labels; no wire through a part, no wire crossing).

INSTALLATION (about 2 minutes)
1. Close Proteus. Extract the WHOLE ZIP to a normal folder (e.g. Desktop).
2. Copy everything in "Proteus Library Files" (TEPCOMPASS.LIB with the four
   parts, and our Arduino library V4.0, ArduinoV4TEP.LIB, with the ARDUINO
   UNO V4.0 used by the demo) to the LIBRARY folder of Proteus, for example:
     C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY
   (on some PCs: C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\
   LIBRARY - use the folder that already holds Proteus's own .LIB files).
3. Copy TEPCOMPASS.DLL and TEPARDUINO.DLL from "Proteus Model Files" to the
   MODELS folder (...\Proteus 8 Professional\MODELS).
   ArduinoV4TEP.LIB and TEPARDUINO.DLL are the files of our Arduino Library
   V4.0 - if you have it, they are the same.
4. Delete TEPCOMPASS.IDX from the LIBRARY folder if it is there (Proteus
   makes a new index).
5. Start Proteus. In Pick Devices (P) search "5883" (or "HMC5883L" /
   "QMC5883L").

RUN THE DEMO
"Proteus Simulation\GY-271-Compass-ArduinoUnoV4.pdsprj" - keep the .hex file
and the two DLLs beside the project.
  ARD1: Arduino UNO V4.0 + U1 = a GY-271 with the HMC5883L (Simple), heading
        0 (north).
  ARD2: Arduino UNO V4.0 + U2 = a GY-271 with the QMC5883L (Advance), heading
        45 (north-east).
  Both UNOs run GY271_Compass_Demo.hex: it finds the chip and reads it, and
  each UNO has its serial monitor built in ("TEP Arduino UNO - ARD1" /
  "- ARD2").
  1. Press Run. Both UNOs' monitor windows open (9600 baud) and so does the
     pop-up of U2 (move it aside - it opens over the schematic).
  2. Each UNO prints which chip it found, then twice a second X, Y and Z in
     uT with the heading and its compass point.
  3. Turn the board on U1's STATUS panel or in U2's pop-up (the eight points,
     - / +): the heading follows. MAGNET pulls it off; TILT 30 too.
  4. Type CAL and press ROTATE within 2 seconds: after 10 s the sketch knows
     the hard-iron offsets and the heading is right again, magnet or not.
  5. Type TRAP: the Adafruit HMC5883 library's calls on this board - on the
     QMC5883L board they read -0.09 uT whatever happens (nobody answers 0x1E).
     RAW shows the six data bytes; DECL adds the declination.
  6. U1: close its panel with the red X, open it with PANEL on the board.
     U2 (Advance): Sensor, Event log, and Tests - I2C, Readings, Heading &
     calibration, Registers.
Closed a monitor window? Click the UNO's USB port.

WIRING (the same in Proteus and on a real board)
  Module   Arduino UNO
  VCC      5V (the GY-271's regulator gives the chip 3.3 V)
  GND      GND
  SCL      A5 (= the SCL pin)
  SDA      A4 (= the SDA pin)
  DRDY     open (or an input: the HMC5883L pulses it low at new data, the
           QMC5883L holds it high while new data waits)
In the sketch, the HMC5883L (Adafruit HMC5883 Unified library):
  Adafruit_HMC5883_Unified hmc(12345);
  hmc.begin();                                   // MR = 0x00: continuous
  sensors_event_t e;  hmc.getEvent(&e);          // e.magnetic.x / y / z in uT
The QMC5883L (by hand with Wire, as the QMC5883LCompass library does it):
  write 0x0B = 0x01, then 0x09 = 0x1D           // continuous, 200 Hz, +-8 G
  read 6 bytes from 0x00                         // X, Y, Z low byte first, / 30 = uT
  heading = atan2(Y, X) in degrees, + 360 when it is negative
The serial monitor needs no wires: it is built into the Arduino UNO V4.0.
SDA and SCL reach their UNO through net labels - SDA_1 / SCL_1 (node 1),
SDA_2 / SCL_2 (node 2): the same name = connected. VCC and GND are Proteus
power terminals; the UNO's internal pull-ups hold the I2C bus.
REAL HARDWARE:
 * Check the chip before you pick a library: "L883" is an HMC5883L (0x1E),
   "DA 5883" a QMC5883L (0x0D) - or run an I2C scanner. The demo does it for
   you.
 * Keep the module away from magnets, motors, speakers, steel screws and
   current-carrying wires - and calibrate it where it is mounted.
 * Hold it level, or add an accelerometer and tilt compensation.
 * Look up your magnetic declination and add it (DECL) for true north.

THE TEST TOOLS (Advance, Tests tab) - what they really measure
Every tool reads the model during the running simulation; each shows one
"Good for:" line and, where it judges, a verdict per row (green = fine, amber
= check, red = wrong).
  I2C           Good for: "no HMC5883L detected", readings that never change,
                X, Y and Z of -1 or 0, the wrong chip on the board. This board
                and its address, calls to the other chip's address (the trap),
                the ID reads, the mode, the data reads (all six bytes or only
                some), the accesses without ACK; the library's calls step by
                step; the registers now.
  Readings      Good for: what the sketch writes and reads, and in which
                order. The last 24 transactions with their bytes and meaning.
  Heading & calibration
                Good for: a heading that is off by tens of degrees, a heading
                that does not go round evenly, a tilted board. The heading and
                its error, the field, the magnet, the tilt, the hard-iron
                offsets from the readings since the last turn and the heading
                corrected with them; a heading step by step.
  Registers     Good for: a setting that did not take, the data order, the
                status bits. The range, the data rate, the overflows, DOR, and
                every register with its meaning.

THE DEMO SKETCH ON THE SERIAL MONITOR (GY271_Compass_Demo V1.0)
  RUN        the readings go on (twice a second)
  STOP       no more readings
  RAW        the six data bytes in one read, decoded the chip's way
  CAL        10 s of readings while the board turns (press ROTATE): the
             hard-iron offsets, used from then on
  DECL 1.5   the magnetic declination in degrees (east +, west -)
  TRAP       the Adafruit HMC5883 library's begin() and getEvent() on this
             board, whatever chip it carries
  HELP       the command list
Commands are not case-sensitive; type them in the UNO's built-in monitor and
press Enter.

EXPECTED MONITOR OUTPUT (node 1, the HMC5883L, north)
  TEP GY-271 compass - demo (HMC5883L or QMC5883L)
  SDA on A4, SCL on A5
  found an HMC5883L at 0x1E (ID H43) - the Adafruit HMC5883 library
  Commands: RUN | STOP | RAW | CAL | DECL 1.5 | TRAP | HELP
  #1  X 26.5  Y -1.3  Z -47.1 uT  heading 357.2 deg N
  #2  X 26.4  Y -1.4  Z -47.4 uT  heading 357.0 deg N
  #3  X 26.5  Y -0.9  Z -47.0 uT  heading 358.0 deg N
Node 2 (the QMC5883L, north-east) prints "found a QMC5883L at 0x0D (chip ID
0xFF) - set up with Wire", then "#1  X 16.1  Y 18.7  Z -44.0 uT  heading 49.2
deg NE".
(The last digit moves a little: the noise - property NOISE. The heading is a
few degrees off until CAL: each chip has a small offset of its own. The
Adafruit library divides Z by 980 counts a gauss, the HMC5883L's datasheet
says 1090: Z prints about 11 % high.)

PROPERTIES (double-click the part > Edit Properties)
  HEADING      the board's heading at the start, in degrees from magnetic
               north, clockwise (default 0)
  FIELD        the Earth's field in uT (default 50)
  INCLINATION  how far the field points down, in degrees (default 60; about
               0 at the equator, 90 at the magnetic poles)
  NOISE        the chip's noise: 1 = about 0.2 uT (default), 0 = none
  PANEL        Simple only: the STATUS panel at the start, OPEN or CLOSED
Every run starts again from the properties, and the chip from power-on. The
demo's UNOs (ARDUINO UNO V4.0): PROGRAM GY271_Compass_Demo.hex, MONITOR YES
(the built-in monitor), BAUD 9600, AUTOOPEN YES, BOOTLOADER YES.

LINKS.INI (OPTIONAL)
The Help page cards of the Advance devices open web pages. To point them
somewhere else without a new DLL, put a text file named links.ini next to
TEPCOMPASS.DLL with lines KEY=URL, for example:
  ARTICLE=https://www.theengineeringprojects.com/...
Keys: WEBSITE, FORUM, BUG_REPORT, FEATURE_REQUEST, ARTICLE, USER_GUIDE,
UPDATE_CHECK, DONATE. Only http:// and https:// links are used; lines starting
with # are comments.

TROUBLESHOOTING
* "no compass at 0x1E or 0x0D": no power on VCC / GND, SDA / SCL swapped or
  missing (the PWR LED is off, or the I2C LED never flashes).
* X, Y and Z are -0.09, -0.09, -0.10 uT and never change: an HMC5883L library
  on a QMC5883L board - nobody answers 0x1E (the trap; U1 / U2 show it in
  red). Use the QMC5883L's address 0x0D and its registers.
* The values are all 0: the chip was never started - MR = 0x00 on the
  HMC5883L, CONTROL 1 continuous on the QMC5883L.
* The heading is off by tens of degrees: a magnet or steel near the board -
  calibrate (CAL while it turns), or the board is tilted.
* The heading jumps between N and the others near 0: that is 360 = 0; keep
  0 to 360 with "+ 360 when negative".
* A value reads -4096 (HMC5883L): the field is beyond the gain's range - pick
  a bigger range in CRB.
* The data never changes on the HMC5883L after a partial read: LOCK - read
  all six data bytes.
* The parts are not simulated: TEPCOMPASS.DLL is missing from MODELS and from
  the project folder. No UNO / no monitor window: TEPARDUINO.DLL is missing,
  or click the UNO's USB port.
* Advance: the pop-up does not appear - click OPEN PANEL on the board, or turn
  "Open the panel at Run" on its Settings page back on.

BUG REPORTS AND FEATURE REQUESTS
Please post them in our forum with a screenshot, the Serial Monitor text, the
simulation log and (Advance) the Copy diagnostics text:
  https://www.theengineeringprojects.com/forum/category/gy-271-compass-proteus-library

SUPPORT US
This library is free. If it saves you time, please support our work:
  https://www.theengineeringprojects.com/donate

WEBSITE
  https://www.theengineeringprojects.com/

LICENCES AND THIRD-PARTY NOTES
* The HMC5883L and QMC5883L models (TEPCOMPASS.DLL), the symbols and artwork
  and the Arduino Library V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, with its
  built-in TEP Serial Monitor Advance) are made by The Engineering Projects.
  The models are independent implementations written from the HMC5883L and
  QMC5883L datasheets. The model uses only standard Windows libraries; no
  Visual C++ redistributable is needed. The C++ source code is not included.
* Arduino UNO V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, our Arduino Library
  V4.0 - its microcontroller is Proteus's own AVR model): The Engineering
  Projects, https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
* The demo sketch uses the Adafruit HMC5883 Unified library 1.2.4 (BSD
  licence) and Adafruit Unified Sensor 1.1.15 (Apache licence 2.0); they are
  not shipped here - install "Adafruit HMC5883 Unified" (by Adafruit) from
  the Library Manager of the Arduino IDE (it installs the other one with it).
  Their source code:
    https://github.com/adafruit/Adafruit_HMC5883_Unified/tree/1.2.4
    https://github.com/adafruit/Adafruit_Sensor/tree/1.1.15
  The .hex file contains compiled code of them, so their licences:
  Adafruit HMC5883 Unified library (its notice, which must go with it):
    /*!
     * @file Adafruit_HMC5883_U.cpp
     *
     * @mainpage Adafruit HMC5883 Unified Library
     *
     * @section intro_sec Introduction
     *
     * This is a library for the HMC5883 magnentometer/compass
     *
     * Designed specifically to work with the Adafruit HMC5883 Breakout
     * http://www.adafruit.com/products/1746
     *
     * These displays use I2C to communicate, 2 pins are required to interface.
     *
     * Adafruit invests time and resources providing this open source code,
     * please support Adafruit andopen-source hardware by purchasing products
     * from Adafruit!
     *
     * @section author Author
     *
     * Written by Kevin Townsend for Adafruit Industries.
     *
     * @section license License
     *
     * BSD license, all text above must be included in any redistribution
     */
  Adafruit Unified Sensor: the Apache License 2.0 - its full text is at the
    end of this file (APACHE LICENSE 2.0).
* The QMC5883L part of the demo is our own code with Wire; it sets the chip
  up with the same register values as the QMC5883LCompass library by
  MPrograms (GPL 3.0, https://github.com/mprograms/QMC5883LCompass), which
  is not used or shipped.
* The .hex file is built from the demo sketch, these libraries and the
  Arduino AVR core 1.8.6 (with its Wire and SPI libraries), which includes
  LGPL-licensed code; its source code is available at
  https://github.com/arduino/ArduinoCore-avr/tree/1.8.6
  The demo sketch's source is in "Arduino Code", so the .hex can be rebuilt
  with other versions of these libraries (REBUILDING THE FIRMWARE).
* Proteus is a product of Labcenter Electronics and is not included. Arduino is
  a trademark of Arduino SA. The HMC5883L is a product of Honeywell, the
  QMC5883L of QST Corporation. This library is not made or endorsed by
  Honeywell, QST, Adafruit, MPrograms, the makers of the GY-271 module or
  Labcenter.

REBUILDING THE FIRMWARE (OPTIONAL)
The HEX file is supplied; Arduino IDE is not needed to run the demo. To edit the
sketch, install "Adafruit HMC5883 Unified" by Adafruit from the Library Manager,
open Arduino Code\GY271_Compass_Demo\GY271_Compass_Demo.ino in the Arduino IDE,
select Arduino Uno and use Sketch > Export Compiled Binary. Replace the
simulation's .hex with the exported HEX. The sketch needs 14,792 bytes of flash
and 606 bytes of RAM.

MODEL SCOPE AND LIMITS
Modelled: the HMC5883L's I2C slave at 0x1E (CRA, CRB, MR, the data, SR, the ID,
the pointer's roll-over, LOCK, single measurement, the gains and their
overflow, the self-test bias, DRDY) and the QMC5883L's at 0x0D (the data,
STATUS with DRDY / OVL / DOR, the temperature, CONTROL 1 / 2, SET/RESET, the
chip ID, the ranges, the data rates, the oversampling's noise, the pointer
roll-over, the soft reset, DRDY); the Earth's field, the heading, a magnet on
the board, a 30 degree tilt, a full turn, each chip's small offset.
How the parts work with the circuit: VCC and GND power the module (its
regulator gives the chip 3.3 V); Proteus runs the Arduino's SCL / SDA edges as
digital events; the model takes each with its exact time and pulls SDA low to
acknowledge and to send; DRDY changes at the time of each new sample.
Not modelled: soft iron (a field bent by nearby steel), the chips' gain errors
and temperature drift, the QMC5883L's temperature offset (only relative
values, as on the real chip), the HMC5883L's high-speed I2C,
…
Advertisement

Development1 release

  1. V1.0HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Modulethis page

    V1.0 is the only release in the Download Center so far. When a newer version is published, it appears above with its own download page.

Installation8 steps

From the download to a working project, in order. The steps follow what the package contains.

You will need

  • Proteus Design SuiteProteus 8 or newer (Labcenter), on Windows
  • Arduino IDE1.8 or 2.x, with the board of the tutorial chosen under Tools → Board
  • Any archive toolWindows, macOS and Linux extract ZIP files on their own

Steps

  1. 1

    Extract the archive

    Right-click gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (GY-271-Compass-TEP-v1.0) as it is.

  2. 2

    Copy the library files into Proteus

    Move ArduinoV4TEP.LIB and TEPCOMPASS.LIB and the files into the LIBRARY folder of your Proteus installation: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY for Proteus 8, or the matching Proteus 7 folder. Older versions keep it under ProgramData\Labcenter Electronics. If Proteus is open, close it first.

  3. 3

    Add the simulation model

    Copy TEPARDUINO.DLL and TEPCOMPASS.DLL into the MODELS folder next to LIBRARY, so the component can run, not only be drawn.

  4. 4

    Restart Proteus and place the component

    Start Proteus, open a schematic, press P (Pick Devices) and search for the component by the name used in the tutorial. It appears with its pins ready to wire.

  5. 5

    Open the sketch in the Arduino IDE

    Open GY271_Compass_Demo.ino, select your board and port under Tools, then Verify. Sketch → Export Compiled Binary writes the HEX file a simulation needs.

  6. 6

    Load the HEX file

    In Proteus double-click the microcontroller, set Program File to GY271_Compass_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.

  7. 7

    Open the example simulation

    Open GY-271-Compass-ArduinoUnoV4.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.

  8. 8

    Follow the tutorial

    HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module explains every connection and setting in order; keep it open beside the files while you build.

How to add a library in Proteus 8

FAQs9 questionsContact TEP

How do I download HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module?

Wait for the 30-second guest countdown on this page, then press the download button; the file comes straight from our storage. Members who are logged in skip the wait. If the browser opens the file instead of saving it, use its Save as option. The download link is made for you when the countdown ends and works for 15 minutes; a saved or shared link stops working, so share this page instead.

What is inside the archive?

HMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module comes as a ZIP archive of 10 files (1.2 MB, 2.8 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware. Open the File Structure tab for the full list of 10 files.

What should I do if the download does not start?

Check the browser's download list first; an ad blocker or a company firewall can also hold it back, so try another browser or network. If the file arrives incomplete, download it again. For an installation problem, read the Install tab or tell us in the comments with your software version and the exact error message.

Is this file free?

Yes. Every file in the TEP Download Center is free for learning, personal and student projects. If you share it, link back to this page or the tutorial so others find the latest version.

How do I check that the file arrived complete?

Compare its SHA-256 with the one on this page, 6b058cce00d9112d8875ae0b5cc793e28504115d99e4cb41dd34831af24f4ee0. In PowerShell run Get-FileHash "gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip"; on macOS or Linux run shasum -a 256 "gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip". The same value means the file is exactly the one in our storage; a different one means the download broke off, so download it again.

Do I need WinRAR to open the ZIP file?

No. Windows, macOS and Linux open ZIP archives on their own (Extract All, or double-click). WinRAR and 7-Zip work too. Extract the whole archive before using the files.

Where do I put the LIB and IDX files?

Both files go into the LIBRARY folder of your Proteus installation (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY; Proteus 7 has the same folder under its own name). Restart Proteus afterwards and search for the component with P.

Which Proteus version does the library need?

The tutorial names the Proteus version the library was made and tested with. Most TEP libraries work in Proteus 7 and Proteus 8; if the component does not appear after a restart, check that both the LIB and the IDX file were copied and that Proteus was fully closed while copying.

How do I get the HEX file into the simulation?

Compile the sketch in the Arduino IDE (Sketch → Export Compiled Binary gives you the HEX next to the sketch), then in Proteus double-click the board, set Program File to that HEX and run.

preparing · gy-271-compass-tep-v1-0-9f26474364034133af3343d9192f7653.zip
Rating
Your download will be ready shortly
Preparing your download…

Members skip the wait. Log in or join TEP.

  • 14Total downloads
  • 4%Popularity
  • ProteusCategory
  • 0Comments
  • ssyedzainnasirUploaded by
  • 16 Oct 2026Uploaded at
Last 14 days8 downloads
SHA-256 6b058cce00d9112d8875ae0b5cc793e28504115d99e4cb41dd34831af24f4ee0
DocumentationHMC5883L / QMC5883L Compass Library for Proteus V1.0: GY-271 Module
Need help with this file? Bug report Ask a question Download problemsGet updates
Advertisement

Comments

0

Join the conversation

Start the conversationAsk a question or share how you used this download.