Professional Documents
Culture Documents
Katherine Reyes
I. Overview
The Sensor I will be using is the HMC5883L 3-Axis Magnetometer and it measures magnetic
fields. This sensor measures the ambient geometric field, magnetic force which surrounds the
earth, on 3 physical axes (x,y,z) in units of micro Tesla (uT) .
Since the sensor aligns itself to the Earths magnetic poles, while the earths rotational axis
defines the geographic north and south poles, a discrepancy of 11.5 degrees lies between the
geographic and magnetic poles which interfere with the accuracy of the magnetometers values.
The accuracy of the sensors reading may also be interfered with the presence of electronics and
magnets.
picture:
1. Connect VIN to 5V pin on the Arduino. If you have a 3V logic Arduino, connect VIN to
3V instead
2. Connect GND to the ground pin on the Arduino
3. Connect the SDA pin on the breakout to the I2C data SDA pin on your Arduino. On an
UNO & '328 based Arduino, this is also known as A4, on a Mega it is also known as
digital 20 and on a Leonardo/Micro, digital 2
4. Connect the SCL pin on the breakout to the I2C clock SCL pin on your Arduino. On an
UNO & '328 based Arduino, this is also known as A5, on a Mega it is also known as
digital 21 and on a Leonardo/Micro, digital
V. Example Project
A. The purpose of this project is to test the difference in magnetic and directional poles when the
sensor is attached to the door while being opened and closed
B. The overall arching goal is to attack an LED light and allow for it to turn on upon tiers
detection of the door oping or closing
Data when door was closed: Data when door was open:
HMC5883 Magnetometer Test HMC5883 Magnetometer Test
------------------------------------ ------------------------------------
Sensor: HMC5883 Sensor: HMC5883
Driver Ver: 1 Driver Ver: 1
Unique ID: 12345 Unique ID: 12345
Max Value: 800.00 uT Max Value: 800.00 uT
Min Value: -800.00 uT Min Value: -800.00 uT
Resolution: 0.20 uT Resolution: 0.20 uT
------------------------------------ ------------------------------------