Go Down

Topic: using 9 Degrees of Freedom - Razor IMU - AHRS (Read 22700 times) previous topic - next topic


i am trying to built synthitic vision system EFIS to be used with real smal airplane.
am using sparkfun component 9 degree AHRS
connected to my laptop and gps RX

i Just got the component
1- 9 Degrees of Freedom - Razor IMU - AHRS Compatible
2- FTDI Basic Breakout - 3.3V
3- Single Row Break Away Pin Header - Straight
4- Polymer Lithium Ion Batteries - 860mAh 3.7V With JST Connector
5- LiPoly Charger - Single Cell 3.7-7V Input
6- USB- GPS reciver

i am searching for a right code to get real output from AHRS and then convert it to picture display same as aircraft instrument


¨i am trying to built synthitic vision system EFIS¨

I do not understand .Is this a video stream live or a recorded stream or not a video stream at all ?
What is EFIS stand for ?


EFIS : Electronic Flight Instrument System
for aircraft


Apr 08, 2010, 09:17 pm Last Edit: Apr 08, 2010, 09:19 pm by AWOL Reason: 1
built synthitic vision system EFIS

Head-up display?
Augmented reality?
Glass cockpit?


How does the 9-DOF module communicate with the PC?
This is an Arduino forum - you haven't mentioned one of those.



9DOF IMU AHRS, connected to the PC through FTDI USB serial,
i can show output

as number, is there any code through ardiuno wich can read outpot from 9DOF IMU AHRS and convert it display picture as in the video


I have used the 9DOF IMU connected to an arduino.  First I flashed the IMU with the AHRS code from http://code.google.com/p/sf9domahrs/source/list  Then I just connected the tx and rx of the imu to the rx and tx pins of the arduino. Also connect the grounds together.  I powered the imu on my breadboard with a separate regulated 3.3V supply.  Then you can just read the imu serial data using the following code:

Code: [Select]
void setup()
char thisChar;

void loop()
 while (Serial.available() > 0) {
 //do something with this value from the 9DOF imu

Hope this helps.



I tried to do the same thing as you suggested...but no result.
Here is what i did, Please correct me if i am wrong:

1). I have 9DOF Razor IMU with ATMega168 on it...something similar to http://www.sparkfun.com/commerce/product_info.php?products_id=9510

2). First of all i connected it with PC using FTDI breakout board (i.e. http://www.sparkfun.com/commerce/product_info.php?products_id=8772) through USB miniCable. then i programmed on it DCM_AHRS code as given on the link provided by you or more specifically:


3). Then i connected the Rx and Tx of IMU with Tx and Rx of Arduino Duemilanove (ATMEGA168) and power (3.3v) and ground from arduino.

4). Finally i burned the small code posted by you on arduino to read serial data and print it in arduino Serial Monitor but i didn't get anything.

I have already tested the IMU by connecting it to PC through FTDI_USB breakout board and watching its output in X-CTU. It is working perfectly well as seen in X-CTU. There is one difference that its baud rate is 38400. I tried to change the baud rate in your code snippet but it didn't work either.

If you have any idea why its not working, please let me know.

Thanks a lot!



I have recently acquired the same board.  You won't see any output with the suggested code.  

The first problem is that the code doesn't print() any information.  I'm sure it's working fine but you, like I, want to see the numbers and know everything is working right.

Unfortunately Serial can only be used on a single serial connection at a time.  The IMU - Arduino connection is one, but the PC - Arduino connection takes precendent.  (citation needed)

I'm trying NewSoftSerial but so far no luck.  I have not tried connecting directly to the IMU to see what data I get.  I need to get an USB-FTDI plug so I can try it.

If you have solved this challenge, please update!

Dance as if no one is watching; post as if it is going to be read aloud as evidence in court.



Can yo please guide me on how you interfaced the IMU to Arduino....i tried your code to read data but i got nothing.....thought the IMU is working with the arduino?



I have the razor with the 328 chip and an arduino with a similar 328.

  • I connect the PC to the arduino with the USB.
  • I connect arduino RESET to arduino GND.
  • I connect arduino 3.3V to razor 3.3V
  • I connect arduino GND to razor GND
  • I connect arduino TX1 to razor TX0
  • I connect arduino RX0 to razor RX1
  • I open the serial window in arduino at 38400 baud.
  • I reset the razor.
  • Text appears, and I follow the on-screen instructions.

  • I should have a diode/resistor combo between the 5V arduino TX0 and the 3.3V razor RX1 (don't want to fry the razor)
  • I do not yet understand the RAW output.
  • I don't know where to get the test firmware.  (sparkfun product page?)
  • I'm thinking about trying the http://code.google.com/p/sf9domahrs/ code.  Anyone know if it's any good?
Dance as if no one is watching; post as if it is going to be read aloud as evidence in court.


Unfortunately Serial can only be used on a single serial connection at a time.  The IMU - Arduino connection is one, but the PC - Arduino connection takes precendent.  (citation needed)

Have you tried connecting your gizmo to the standard tx/rx pins on the arduino, then monitoring the arduino/gizmo traffic using the arduino IDE serial monitor?
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0



cool...you solved my big problem....thanks.

Regarding your raw output question...as far as i can understand it the first three values correspond to the accelerometer readings X, Y, Z and the other 3 correpond to gyro readings X, Y, Z...the last ones are for magnetometer...

I think we can use these values directly for stabilization purposes...i dont understand why you need the firmware from google?


When you say readings, what do they mean, exactly?  I don't know what the values represent.
Dance as if no one is watching; post as if it is going to be read aloud as evidence in court.


I mean if you choose one of the 4 options by selecting 1or 2 or 3 or 4 by printing it on serial port then 1 corresponds to accelerometer readings i.e. what is the value of x-axis acceleration of board, y -axis acceleration of board and its z axis acceleration...in rest the z axis is either -260 or 260 depending on whether its face up or down....it correspond to acceleration due to gravity "g = 9.8m/sec" actually....

similarly if you print 2 then the IMU will give you Magnetometer data....if 3 it will give gyro i.e. gyro average position (i am not sure about it but its something like this)...if you tilt board in one direction its value increases in other direction its value decreases...its true for all 3 axis..

printing 4 will give you all this data together...so that you can code it easily getting all data you need at one place...its first three readings corresponds to x,y,x axis acceleration. next 3 readins corresponds to gyro and last three to the magnetomer....

let me know if you got it or not?

Go Up