This week I built this magnetic heading indicator with a card compass style. I'm using an ESP32-S3 Supermini board with GC9A01 round display to show the compass UI from a three-axis magnetometer sensor reading.
Here is the previous version of this project
Parts required:
1. ESP32 S3 Supermini
AliExpress➡️ Buy option 1 Buy option 2
3. QMC5883P magnetometer (GY-271 module)
(Note: This project is based on QMC5883P not HMC5883L)
4. Lipo battery 3.7v
New to Arduino IDE & esp32 programming? (follow this tutorial)
https://docs.waveshare.com/ESP32-Arduino-Tutorials/Arduino-IDE-Setup
https://docs.waveshare.com/ESP32-Arduino-Tutorials/Arduino-IDE-Setup
Note: Before you upload and run into an error make sure you-
Download all required libraries :
i) lvgl (Only use v8.3.11)
i) lvgl (Only use v8.3.11)
ii) LovyanGFX
iii) Adafruit_QMC5883P
Use Arduino IDE v2.3.4 and esp32 board v3.x.x by espressif
Please upload the calibration code and from the serial monitor you can get the offset values after calibration. Use those values inside the compass code for accuracy.
If you face any issue send me an email with subject "compass" to abid.business01@gmail.com







Hi,
ReplyDeleteTo protect the battery during charging and discharging, would it be safer to include a charge controller like this one in your circuit?
https://www.aliexpress.com/item/1005007176376691.html?spm=a2g0o.order_list.order_list_main.305.13c95e5bmqIOcy
Thank you!
Have a nice day!
The battery I've used has a protection circuit built in. It will prevent over discharge. And the LTH7 used in the esp32 board will safely charge it.
DeleteI had a slight doubt, but I wasn't sure.
ReplyDeleteThank you for your feedback!
Hi,
ReplyDeleteIs it really necessary to use Arduino IDE v2.3.4, since I have Arduino IDE v2.3.10 installed on my Mac?
Also, can I use this display instead of the one listed in your documentation?
https://www.aliexpress.com/item/1005007232650610.html?pdp_npi=6%40dis%21USD%212.96%212.96%21%21%2119.85%2119.85%21%4021017cb917863467086708338db77e%2112000039895659500%21affd%21%21%21%211%210%21&aff_fcid=ce81f8bb75e34713afd9cd18205f2a5b-1790600395447-06260-_c3lfb8If&aff_fsk=_c3lfb8If&aff_platform=portals-billboard-sea&sk=_c3lfb8If&aff_trace_key=ce81f8bb75e34713afd9cd18205f2a5b-1790600395447-06260-_c3lfb8If&terminal_id=d6db7191737c4ecdad4edf19501673a5&afSmartRedirect=y
I understand that the one you’re using has an extra pin, but it isn’t used in your circuit.
Thank you!
Have a nice day!
Yes it will work
DeleteHello. When calibrating the sensor, should it be rotated slowly along all three axes one by one, or is rotating it along just one horizontal axis sufficient?
ReplyDeleteYes rotate all three axes one by one within 30s
Deletecould you please spend few words on the calibration procedure please ?
ReplyDelete