O'Reilly logo

Getting Started with Raspberry Pi Zero by Richard Grimmett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting a digital compass to Raspberry Pi Zero

Now you've created some pretty basic connections to Raspberry Pi Zero, turning lines on and off and sensing a high or low signal. Now let's explore one of the other interfaces available on Raspberry Pi Zero, the I2C interface. To do this, you'll connect a digital compass with this sort of interface.

Note

For more on the I2C interface, see http://www.robot-electronics.co.uk/i2c-tutorial.

There are several chips that provide digital compass capability; one of the most common is the HMC5883L, a 3-axis digital compass chip. This chip is packaged in a module by several companies but almost all of them result in a similar interface.

Here is an image of the GY-271 HMC5883L, a triple-axis compass magnetometer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required