Here is a great post by mincepi which shows how to enable VGA output on a Pi Zero for less than $5
The vga666 by Gert is already a low cost VGA output option for the Pi. But we can do better with the Zero! We’ll use 16 bit output instead of 18 bit: this frees up the SPI and I2C ports with little loss in quality. The resistors can be soldered between the Zero and the adapter, making the PCB smaller and eliminating a connector. I’ve determined that 5% resistors are good enough: no need for higher cost 1% units. By not using the middle row of pins in the HD15 connector, we can straddle-mount it on the PCB edge. Finally, the connector can be male, so the Zero will connect to the monitor ChromeCast style: no VGA cable needed. (This connector could even be scrounged from an old VGA monitor cable for free!) If you order the boards from OSHPark, it will cost $4.95 for three copies. Enough resistors and connectors to build three will cost $5.92 from Digi-Key. That works out to $10.87 to build three, or $3.62 each!
This will be a multipart series on how to use a digital compass(magnetometer) with your Raspberry Pi.
The magnetometer used in these tutorials is a LSM9DS0 which is on a BerryIMU. We will also point out where some of the information can be found in the Datasheet for the LSM9DS0. This will help you understand how the LSM9DS0 works.
The math and logic in this series can also be used with other magnetometers or IMUs.
We will also go over how to do some basic communication on the i2c bus. As well as using SDL to display the compass heading as traditional compass as shown in the video above.
Git repository here
The code can be pulled down to your Raspberry Pi with;
A traditional Magnetic compass (as opposed to a gyroscopic compass) consists of a small, lightweight magnet balanced on a nearly frictionless pivot point. The magnet is generally called a needle. The Earth’s Magnetic field will cause the needle to point to the North Pole.
To be more accurate, the needle points to the Magnetic North. The angle difference between true North and the Magnetic North is called declination. Declination is different in different locations. This angle varies depending on position on the Earth’s surface, and changes over time.
The strength of the earth’s magnetic field is about 0.5 to 0.6 gauss .