{"id":13802450,"url":"https://github.com/robert-hh/QMC5883","last_synced_at":"2025-05-13T13:31:10.893Z","repository":{"id":53589207,"uuid":"161079974","full_name":"robert-hh/QMC5883","owner":"robert-hh","description":"Python class for the QMC5883 Three-Axis Digital Compass IC","archived":false,"fork":false,"pushed_at":"2023-06-08T08:40:56.000Z","size":10,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T12:35:52.011Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robert-hh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-09T20:47:57.000Z","updated_at":"2024-02-22T09:10:51.000Z","dependencies_parsed_at":"2024-01-07T22:24:32.909Z","dependency_job_id":null,"html_url":"https://github.com/robert-hh/QMC5883","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-hh%2FQMC5883","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-hh%2FQMC5883/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-hh%2FQMC5883/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-hh%2FQMC5883/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robert-hh","download_url":"https://codeload.github.com/robert-hh/QMC5883/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225218053,"owners_count":17439713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:44.778Z","updated_at":"2024-11-18T17:31:25.724Z","avatar_url":"https://github.com/robert-hh.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Sensors"],"readme":"# QMC5883L/QMC5883P: Python class for the QMC5883L/QMC5883P Three-Axis Digital Compass IC\n\nThis is a very short and simple class. It uses the I2C bus for the interface.\n\nInitial code by Sebastian Folz, M.Sc. at\nhttp://nobytes.blogspot.com/2018/03/qmc5883-magnetic-field-sensor.html\n\n## Types of QMC5883\n\nThere are two types of QMC5883 available on the market. \n\n* QMC5883L - Have less range modes, maximum magnetic field range is 8G (800 uT). And maximum output rate is 200hz. Datasheet available \u003ca href='https://datasheet.lcsc.com/szlcsc/QST-QMC5883L-TR_C192585.pdf'\u003e@LCSC (https://datasheet.lcsc.com/szlcsc/QST-QMC5883L-TR_C192585.pdf)\u003c/a\u003e\n* QMC5883P - Sensivity range is 30G. Accuracy overall is worser than in QMC5883L. Maximum output rate is 1.5khz. No temperature sensor. Datasheet available \u003ca href=\"https://datasheet.lcsc.com/lcsc/2108072330_QST-QMC5883P_C2847467.pdf\"\u003e@LCSC (https://datasheet.lcsc.com/lcsc/2108072330_QST-QMC5883P_C2847467.pdf) \u003c/a\u003e\n\nThe chips have totally different PCB package. On the market available both variant, but if takes Arduino modules, mostly it will be QMC5883L (@see GY-273 modules)\nRegister map of these chips are totally different. \n\n## Constructor\n\nThe both drivers uses the same interface (ie parent class) - `mag_base`. Could be selected, any of available driver `QMC5883L` or `QMC5883P`.\nNext examples use QMC5883P, but due to the same interface class could be replaced with QMC5883L\n\n### QMC5883 = QMC5883P(i2c [, temp_offset])\n\n- i2c is an I2C object which has to be created by the caller.\n- temp_offset specifies the offset to the temperature, as returned by the method (only in QMC5883L)\nread_scaled. The unit is °C, the default is 50 °C.\n\n## Methods\n\n### (x, y, z, t) = QMC5883.read_raw()\nReturn the raw reading for the x,y, and z axis as well as the raw temperature\nreading. The values are not scaled according to the sensitivity or possible offsets.\n\n### (x, y, z, t) = QMC5883.read_scaled()\nReturn the scaled reading for the x,y, and z axis as well as the temperature\nreading. The x ,y and z readings are scaled to Gauss, the temperature to °C with compensated offset\nOn QMC5883P temperature value is always zero. \n\n### QMC5883.set_sampling rate(sampling_rate)\nSets the sampling rate of the sensor. Accepted values are:\n\n| Value | Sampling rate |\n| :---: | :-----------: |\n|   0   |     10 Hz     |\n|   1   |     50 Hz     |\n|   2   |    100 Hz     |\n|   3   |    200 Hz     |\n\n### QMC5883.set_oversampling(oversampling)\nSets the oversampling factor of the sensor. Accepted values are:\n\n| Value | Oversampling |\n| :---: | :----------: |\n|   0   |     512      |\n|   1   |     256      |\n|   2   |     128      |\n|   3   |      64      |\n\n### QMC5883.set_range(range)\nSets the magnetic field range of the sensor. Accepted values are:\n\n| Value |  Range   | \n| :---: | :------: |\n|   0   | 2 Gauss  |\n|   1   | 8 Gauss  |\n|   1   | 12 Gauss (QMC5883P only) |\n|   1   | 30 Gauss (QMC5883P only) |\n\n### QMC5883.reset()\n\nResets the device using the previously configured settings. This call is **not**\nrequired when settings are changed.\n\n```\n# Example for Pycom device.\n# Connections:\n# xxPy | QMC5883\n# -----|-------\n# P9   |  SDA\n# P10  |  SCL\n#\nfrom machine import I2C\nfrom QMC5883 import QMC5883P\n\ni2c = I2C(0, I2C.MASTER)\nqmc5883 = QMC5883P(i2c)\n\nx, y, z, _ = qmc5883.read_scaled()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-hh%2FQMC5883","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert-hh%2FQMC5883","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-hh%2FQMC5883/lists"}