Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for I2C device HMC5883L (3-axis magnetic sensor) #17069

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

AndreasAchtzehn
Copy link
Contributor

Description:

Support for HMC5883L 3-axis magnetic sensor.
Tested with GY-271.

Configuration:
Sensor101 GAIN,x // sensor gain
Sensor101 RATE,x // data acquisition rate for continuous mode, activate continuous mode by manually setting HMC5883L->mode = HMC5883L_MODE_CONT in xsns_101_hmc5883l.ino
Sensor101 AVG,x // 2^X number of samples to average over
Sensor101 MMODE,x // measurement mode (normal, positive, negative bias)

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.5
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@barbudor
Copy link
Contributor

barbudor commented Nov 14, 2022

Isn't it possible to merge with QMC5883 driver ?
https://github.com/arendst/Tasmota/blob/development/tasmota/tasmota_xsns_sensor/xsns_33_qmc5883l.ino

Or may be the chips are too different despite the naming ?

@AndreasAchtzehn
Copy link
Contributor Author

I was originally hoping to use/slightly adapt the QMC5883L driver for my HMC5883L device (GY-271). After review of the data sheets and tinkering with the original driver I ended up in doing the new implementation. The devices differ in such subtle points as the LSB/MSB register order, HMC5883L further lacks the temperature support, but ultimately they feature a largely different configuration register organization. So, unfortunately no, there is no easy way to use the same driver for both devices.

@arendst arendst merged commit 5e61ee6 into arendst:development Nov 15, 2022
arendst added a commit that referenced this pull request Nov 15, 2022
Add support for HMC5883L 3-Axis Digital Compass sensor by Andreas Achtzehn (#17069)
@sugus6
Copy link

sugus6 commented Nov 17, 2022

Thank you for the HMC5883L support. I got my pcb running.
Is it possible to add the "Compass Heading" to the Tasmota UI?
HMC5883L Tasmota UI_s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants