Arduino – Kompas 3-assen (HMC5883L)

Hardware

Kompas 3-assen HMC5883L bovenkant achter Kompas 3-assen HMC5883L onderkant

BESTEL NU!

Met deze module kun je heel gedetailleerd het magnetische veld “in beeld” brengen, en zo gevoelig dat het het magnetisch veld van de aarde kan waarnemen en de ze sensor chip kan worden gebruikt als kompas.

De module gebruikt I2C als gegevensoverdracht, zodoende is 4 aansluitingen voldoende om de module te laten functioneren.

Informatie over de HMC5883L chip (ENG):

HMC5883L chip
The Honeywell HMC5883L is a surface-mount, multi-chip module designed for low-field magnetic sensing with a digital interface for applications such as lowcost compassing and magnetometry. The HMC5883L includes our state-of-theart, high-resolution HMC118X series magneto-resistive sensors plus an ASIC containing amplification, automatic degaussing strap drivers, offset cancellation, and a 12-bit ADC that enables 1° to 2° compass heading accuracy. The I 2C serial bus allows for easy interface. The HMC5883L is a 3.0×3.0x0.9mm surface mount 16-pin leadless chip carrier (LCC). Applications for the HMC5883L include Mobile Phones, Netbooks, Consumer Electronics, Auto Navigation Systems, and Personal Navigation Devices.

The HMC5883L utilizes Honeywell’s Anisotropic Magnetoresistive (AMR) technology that provides advantages over other magnetic sensor technologies. These anisotropic, directional sensors feature precision in-axis sensitivity and linearity. These sensors’ solid-state construction with very low cross-axis sensitivity is designed to measure both the direction and the magnitude of Earth’s magnetic fields, from milli-gauss to 8 gauss. Honeywell’s Magnetic Sensors are among the most sensitive and reliable low-field sensors in the industry.

HMC5883L chip veld voorbeeld

Pinout

Kompas 3-assen HMC5883L bovenkant achter
Pin (bovenkant met pin headers naar je toe):Functie:
1+5v
2GND
3SCL (serial clock)
4SDA (serial data)
5DRDY
6+3.3v

Aansluiten op de Arduino

Sluit de Kompas module aan volgens onderstaand overzicht:

Kompas 3-assen HMC5883L arduino schema

Pin HMC5883L (bovenkant met pin headers naar je toe):Pin Arduino:
+5v+5v
GNDGND
SCL (serial clock)A5
SDA (serial data)A4
NCDRDY
NC+3.3v

Script Adafruit

Wat heb je nodig?

1) Adafruit sensor bibliotheek
2) Adafruit HMC5883L Driver

Sluit de kompas module aan zoals hierboven aangegeven.

Het resultaat

Kompas 3-assen HMC5883L arduino console output

Script HMC5883L (Creative Electronics)

Wat heb je nodig?

1) HMC5883L (Creative Electronics) bibliotheek

Sluit de kompas module aan zoals hierboven aangegeven.

Het resultaat

HMC5883L (Creative Electronics) arduino console

Als je een app op de telefoon vergelijkt, zie je dat de waarden dicht bij elkaar liggen:

HMC5883L (Creative Electronics) telefoon vergelijking

ijken

[TODO]

Bronnen:
learn.adafruit.com
bluelemonlabs.blogspot.nl