Triple Axe Magnétomètre HMC5883L + Arduino

One of the first articles we did was on the hmc6352 digital compass. Well this is his older brother (or younger but smarter). I really don’t know what to say about the HMC5883L other than it is a three axis magnetometer, so it is capable of sensing in 3 directions.

That doesn’t mean that it is tilt compensated, because you really don’t know how it is orientated when the reading comes in. For that, you would need to combine this with an accelerometer to do that. But this can get you one step closer. If you are looking at using this as a digital compass, make sure to read the following section.

Magnetic Declination

Something I found interesting and obvious once I thought about it, is that all compasses point to magnetic north, and not true north. The difference between them is called Magnetic declination. And how much they vary depends on where you are, and… when it is, because as weird as it is, it changes over time (awesome animation of that). You can look up your Magnetic declination here.

Hooking it up

Hooking you HMC5883L up to your arduino is pretty simple. The HMC5883L is an I2C device, a type 2-wire serial connection, so we just need to connect the SDA (Data) and SCL (Clock) lines to your Arduino for communication. On your Arduino (everything but the mega) SDA is on analog pin 4, and SCL is on analog pin 5. On an arduino mega, SDA is digital 20, and SCL is digital 21. (The Arduino Leonardo will also be different). Other than these 2 lines, we just need to connect power(3.3v), ground and we are all set.

For more detail: Triple Axe Magnétomètre HMC5883L + Arduino


A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut