Arduino Digital Magnetic Compass – HMC5883L
Today I will show you how to make your own arduino compass by using the MHC5883L 3-axis digital compass board.
Before you start, make sure that you have:
- Arduino uno
- HMC5883L sensor board
- Nokia 5110 display (pcb version)
- 2x push-button
- 1x on/off switch
(you can use breadboard to build it easier)
I prefer to build my own arduino based circuit by using the ATmega328p uno possessor, but this is optional for you. Buttons are used for turn on or off display leds and to change display mode of compass.
Watch video on YouTube: youtu.be/i7GaVqMSzMA (make sure to click like button 😉 )
Step 1: About HMC5883L board
The HMC5883L sensor is a 3-axis digital magnetometer IC designed for low-field magnetic sensing. The sensor has a full-scale range of +8 to -8 Gauss and a resolution of up to 5 milli-Gauss. Communication with the HMC5883L is simple and all done through an I2C interface. That means you will need to connect power, ground and only two cables to Arduino uno board (SDA,SCL).
The HMC5883L board can be powered up by 5V or 3.3V pins of Arduino uno board. No need to add any capacitors or resistors to your circuit.
Pinout and connection with uno:
- Vcc to 5V or 3.3V
- GND to GND
- SDA to A4
- SCL to A5
- DRDY to nothing…
Because this is a magnetic compass if you put it near to battery, motors, metallic surface or magnetic field, the result will diverge from the actual. Also make sure to use it on a flat surface!
Step 2: Breadboard schematic circuit
Here is the circuit on breadboard schematic. Make sure to read “pinout” notes on image and connect lcd and sensor correct with arduino uno.
For more detail: Arduino Digital Magnetic Compass – HMC5883L
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w
This Post / Project can also be found using search terms:
- digital compass with arduino
- hmc5883l for arduino uno coding
- arduino digital magnetic compass
- projects using HMC5883L