hmc5883l tywu. gy-271 hmc5883l compass module pictures

13
HMC5883L TYWu

Upload: anissa-simpson

Post on 19-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

HMC5883L

TYWu

Page 2: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

GY-271 HMC5883L Compass Module

• Pictures

Page 3: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Other Versions

• 3 Axis Magnetometer - HMC5883L Breakout Board R2

• Sparkfun Triple Axis Magnetometer Breakout - HMC5883L

Page 4: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

HMC5883L

• Block Diagram

Page 5: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

HMC5883L

• 3-Axis Digital Compass IC• Use Honeywell’s Anisotropic Magnetoresistive

(AMR) technology that provides advantages over other magnetic sensor technologies. These

• 12-Bit ADC Coupled with Low Noise AMR Sensors Achieves 5 milli-gauss Resolution in ±8 Gauss Fields

• Low Voltage Operations (2.16 to 3.6V) and Low Power Consumption (100 μA)

Page 6: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

HMC5883L

• Specifications

Page 7: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

HMC5883L

• Specifications

Page 8: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Arduino Resource

• Example in WWW– http://www.geek-workshop.com/thread-105-1-1.html– http://www.elechouse.com/elechouse/images/product/

3-axis%20Compass%20Module/HMC5883L.rar

Page 9: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Experiment

• Connection– VCC 3.3V– GND GND– SCL A5– SDA A4– DRDY Floating

Page 10: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Experiment

• Arduino Code (Simple Version)

#include <Wire.h> //I2C Arduino Library#define address 0x1E //0011110b, I2C 7bit address of HMC5883void setup(){ Serial.begin(9600); Wire.begin(); //Put the HMC5883 IC into the correct operating mode Wire.beginTransmission(address); //open communication with HMC5883 Wire.send(0x02); //select mode register Wire.send(0x00); //continuous measurement mode Wire.endTransmission();}

Page 11: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Experimentvoid loop(){ int x,y,z; //triple axis data //Tell the HMC5883 where to begin reading data Wire.beginTransmission(address); Wire.send(0x03); //select register 3, X MSB register Wire.endTransmission(); //Read data from each axis, 2 registers per axis Wire.requestFrom(address, 6); if(6<=Wire.available()){ x = Wire.receive()<<8; //X msb x |= Wire.receive(); //X lsb z = Wire.receive()<<8; //Z msb z |= Wire.receive(); //Z lsb y = Wire.receive()<<8; //Y msb y |= Wire.receive(); //Y lsb }

Page 12: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Experiment

//Print out values of each axis Serial.print("x: "); Serial.print(x); Serial.print(" y: "); Serial.print(y); Serial.print(" z: "); Serial.println(z); delay(250);}

Page 13: HMC5883L TYWu. GY-271 HMC5883L Compass Module Pictures

Experiment

• Snapshot of

execution