i am having some trouble with the accelerometer in the 5 DOF IMU. The 5 dof imu have a ADXL335 accelerometer. The output of the accelerometer is weird. The values that i have gotten using analogRead() is between 100+ to 300+, which i find it strange. The adc value should be around 500 and the value should be able to vary between 0 to 1024 but for my case it is apparently my values for x,y,z axis never got over 500. i am not sure why it is this way. i also built a regulator to provide 3.3v to IMU, from 5V on ardupilot.
Any help would be greatly appreciated. Thanks in advance
I have no experience whatsoever of this but based on you mentioning 3.3v supply for it - are it's outputs 0v - 3.3v rather than the 0v - 5v you were expecting?
The ADC is expecting 1023 to be 5volts, but thats impossible with only 3.3 available..
You need to set the Vref voltage to 3.3v
i am not sure if it is possible to set vref of ardupilot but i know that there is no way i can set verf of the accelerometer. Even if the output of the accelerometer is 0v -3.3v, the adc value that i got also does not correspond. At zero g, my adc value is about 110 which translates to ~0.54V, while the datasheet say it shld be 1.5 given Vs=3v. hmm ... i am wondering if the problem is due to the regulator that i am having ... anyone have any advise on how to build a 3.3v regulator suitable for 5 dof IMU which have 5v input from ardupilot ?
just a little air guitar play here..
I think that andpe ment to adjust the aref voltage to the Arduino, just put 3.3V into the Arduino Aref pin to match the output of the Accelerometer.
ah i see ... ok let me try that out, and see if it works ... thanks