Nuclear Projects Logo
Attitude Indicator
(Artificial Horizon)
6/10/11

I'm a very visual person, so having some sort of program that could display my data would be useful, and fun. I had seen a lot of others who either built their own graphical displays, or were using commercial software, such as LabView. I figured I'd make my own, with a little help. Searching the internet I found this great bit of software, written in C#:

Author: Guillaume Chouteau
Source: http://www.codeproject.com...
Flight Instruments screen-shot

The only instrument I'm interested in at the moment is the attitude indicator, and I liked the way it worked in this program. So I began to basically build my own program from scratch. I did borrow some of the math functions and bitmaps to build off of from the above program, but the rest is of my own doing.

I built in support for serial communication (for reading data from the Arduino), I added a Yaw indicator (tick marks), representing every 10 degrees. Plus some misc. other controls and features.

Here is a screen shot of the program when it first opens:

Attitude Indicator screen-shot

Initially you can use the sliders to play with the orientation, or even use the numerical keypad's arrows to move it around. Once you select an available COM port, the program will disable manual inputs and will display the raw Arduino data (the X, Y and Z angles). Here's a shot of 6DOF and Arduino in action:

Attitude Indicator screen-shot

I'm continually making changes to the program, so the downloadable version I'll post here may look/function slightly different from the one depicted above. There are some "bugs" in the program too that I'm working out as well. But overall, it works GREAT!!! VERY smooth too!

Here's an earlier video I shot two days ago (I've already made changes to the program since this):



As shown in my source code on my Arduino Programming page, the Arduino prints all 3 calculated angles for the X, Y and Z axis's. The format for this is:
The "\r\n" is just a carriage return and newline character. It's required at the end of the data string. If using the Arduino's Serial.println command, this is automatically sent, so you don't have to write it. The order and format is important in order for the Attitude Indicator program to read the serial data correctly. Using the Arduino's serial monitor feature, a series of serial prints looks like this:
-0.51,-0.45,-0.06
-0.50,-0.43,-0.08
-0.50,-0.39,-0.08
-0.49,-0.38,-0.09
-0.46,-0.35,-0.10
This program can of course be used with serial data sent from any device. Just make sure the data is in the proper format, and serial baud rate is set at 115200.

NOTE: In this program, level attitude is when Roll(X-axis) and Pitch(Y-axis) are equal to zero(0). The program can accept +-180 degrees on either axis. Positive roll is to the right, positive pitch is 'up'. Yaw(Z-axis) can accept 0-360 degrees.

Here is the free download for the stand-alone .exe program. It was written using Microsoft Visual C# 2008 Express Edition on Windows XP:

Most recent screen-shot:
Attitude Indicator Screen-shot


Attitude Indicator.exe (1.5mb)



The above program doesn't work with Win7 64 bit systems, however, this one should:
Attitude Indicator - For Win7-64 (1.5mb)


And by popular demand, the source code: Source Code (.zip format)