# IMU 5 DOF

Hey guys, I just bought a IMU 5DOF sensor, and when i run the program

``````int x=0;
int y=1;
int z=2;

void setup()
{
Serial.begin(9600);      // sets the serial port to 9600
}

void loop()
{
Serial.print("accelerations are x, y: ");
Serial.print(x, DEC);    // print the acceleration in the X axis
Serial.print(" ");       // prints a space between the numbers
Serial.print(y, DEC);
Serial.print(" ");       // prints a space between the numbers
Serial.println(z, DEC);
delay(100);              // wait 100ms for next reading
}
``````

i get the foll: output that doesnt change even though i tilt or move the sensor accelerations are x, y, z : 103 105 106 accelerations are x, y, z : 103 105 106 accelerations are x, y, z : 103 105 106 accelerations are x, y, z : 103 105 106 etc (I use an old version of arduino , so i used a voltage divider network of 12K and 20K resistors to get 3.3V from 5 V) Please help, what would be wrong??

Sounds like something isn’t wired correctly.

Exactly what sensor do you have and how is it wired?

I have a IMU 5 DOF (adxl335 and IDG500).........i connected the 3.3V pin of the sensor to a voltage divider arrangement of 12k and 20k to get 3.3V from the 5V of my arduino, then i connected the X-acc,Y-acc,Z-acc pins to analog 0,1,2 respectively and connected the GND.This is the product page of my sensor:http://www.rhydolabz.com/index.php?main_page=product_info&cPath=137_148&products_id=581.Please help.

The specification for the accelerometer shows that the output should be about 1/2 the supply voltage +/- 0.3v

3.3/2 = 1.65v

That SHOULD produce an analog input value of 338 +/-61. Something is definitely wrong.

It's just a guess but a resistor voltage divider might not be good enough for powering an active device. You should supply a regulated voltage. You can use the regulated 3.3v supply from the Arduino.