This is a tutorial on how to do magnetic field measurement with an Arduino, a HMC5883L triple axis magnetometer and a Piezo Speaker
First of all, here is a schematic on how to hook up everything.
![]()
Source images from:
http://store.fut-electronics.com/HMC5883L.html
http://www.geekzone.co.nz/imagessubs/blog18a1d14dd0a4ccf9c8d355c44d869a03.jpg
HMC5883L GND -> Arduino GND
HMC5883L VCC -> Arduino 3.3V
HMC5883L SDA -> Arduino A4
HMC5883L SCL -> Arduino A5Piezo Speaker – -> Arduino D10 (Any digital PWM port is sufficient)
Piezo Speaker + -> Arduino GND
