Magnetic Heading Display


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

2. 1.28" GC9A01 display

AliExpress➡️ Buy option 1  Buy option 2 

3. QMC5883P magnetometer (GY-271 module)

AliExpress➡️ Buy option 1  Buy option 2 

(Note: This project is based on QMC5883P not HMC5883L)

4. Lipo battery 3.7v
AliExpress➡️ Buy Option 1  Buy Option 2

Circuit Diagram


Source Code:

I've uploaded the source code (both v1 and v2) and calibration code in my drive


Note: Before you upload and run into an error make sure you-

Download all required libraries :
i) lvgl (Only use v8.3.11)

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

Comments

  1. Hi,

    To 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!

    ReplyDelete
    Replies
    1. 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.

      Delete
  2. I had a slight doubt, but I wasn't sure.

    Thank you for your feedback!

    ReplyDelete

Post a Comment