Artificial Horizon w/ Digital Gyro
Posted: January 2, 2013
I wanted to make a little artificial horizon for a possible future airplane project so I grabbed this Tri-Axis L3G4200D Digital Gyro from SparkFun. The concept is actually pretty simple using concepts from first semester calculus. Sampling from the digital gyro will give the current rotational velocity around one axis. If it's rotating in one direction the number will be positive while the other direction will be negative. By simply adding up all the velocities it should give the current rotational position of the device.
As a side-note, I tried this first with an analog gyro using the ADC of the MSP430, but I guess I couldn't get the signal from the gyro to the micro clean enough (too long of wires?) so it never worked properly. I got this digital gyro to work pretty quickly.
The MSP430 assembly source code below can be assembled with my own naken_asm assembler.
Related Projects @mikekohn.net
More electronics projects on mikekohn.net here.
As I tilt the circuit, the artificial horizon on the computer screen is moving also. https://youtu.be/k819_QimWK0
The circuit used in the video above.
And here's the schematic...
Copyright 1997-2019 - Michael Kohn