[SOLVED] Getting very abrupt values reading a Gyro or Accelerometer (DUE)

Hey there,

yesterday arrived my new Arduino DUE board. It´s my first Arduino/Microcontroller that I ever used so I´m not very experienced in Hardware. How ever, I also ordered a Sparkfun 9DOF sensor stick. I soldered some headers on it and connected the 3.3V sensor stick to my 3.3V , GND, SDA (20) and SCL (21) Pins on my DUE board (which also runs on 3.3V) via 30cm cables.

So I figured out how to read the values of the sensors by accessing the different registers. The problem is, that for each axis one of the two registers gives me very abrupt values. Here are some examples from my serial monitor.

!!! these are only the values from one register. The one whose bits are on the left side (not yet bit shifted).
x y z
GYRO: 254 255 0
GYRO: 255 0 255
GYRO: 255 255 255
GYRO: 3 255 255
GYRO: 0 255 252
GYRO: 254 0 1
GYRO: 250 2 251

I tried it with different refresh rates. How ever, the values from the right side register give me some nice heterogeneous values when I move the stick. This happens for pretty much all of the sensors on the stick. But when I add them I would end up with values from 0-255 and then something around 65xxx-66xxx or something

I figured out that I could get some much better values for the accelerometer after activating the justify bit in the config register. But right now I´m not sure if these data isn´t garbage either.

How can this be? Is my Due maybe not suitable for this sensor? I wanted to have more calculation power for further filtering. Is my sensor stick maybe broken? Can this be an I2C issue?

btw: I couldn´t find a tutorial that is build with a Due and the 9DOF stick. Is it an issue that the values come in 16 bit chunks when I have a 32 bit processor? I guess not, but as mentioned: I´m a newb ,)

I hope someone can help. I would be very happy!

Cheers,

Michael

A Sparkfun 9DOF sensor stick seems to need a power supply which outputs 3.5V or more...

chipaudette | about 2 years ago 1
Dear Sparkfun,

Why does your schematic not show what the regulator is? With no datasheet for this PCB and no notation on the schematic what the regulator is, we have no idea how this device can be powered. Is it expecting 3.3V, or is it expecting 5V? Knowing what the regulator is seems like a pretty basic piece of information…could you rev the schematic to show this info?

MikeGrusin | about 2 years ago 2
It’s a MIC5205 3.3V. This is an LDO regulator, so VCC only needs to be above 3.5V.

tasasaki:
A Sparkfun 9DOF sensor stick seems to need a power supply which outputs 3.5V or more...

SparkFun 9 Degrees of Freedom - Sensor Stick - SEN-10724 - SparkFun Electronics

Hm are you sure? I don´t know physics very well. But this guy seemed to get it working with 3.3V and I followed this tutorial Connecting to Sparkfun’s 9DOF “Sensor Stick”: I2C access to ADXL345, ITG-3200, and HMC5843 | Chionotech

this guide uses a different stick, but this one also runs on 3.3V http://www.instructables.com/id/Guide-to-gyro-and-accelerometer-with-Arduino-inclu/

and, last but not least, this schematic (can´t read it really. Just intuition) says all the I/O 3.3V http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/IMU/9DoF-Stick-v13.pdf

This guy in the comments say:

It’s a MIC5205 3.3V. This is an LDO regulator, so VCC only needs to be above 3.5V.

Can this be right? Maybe he did a mistake and he meant "so VCC only needs to be above 3.3V"? Or do I have to calculate something there to get the 3.5V? The MIC5205 spec does not say anything 3.5V.

PS: I tried pretty much every data rate setting for the accelerometer. From very low to very high. Anyone else experienced something similar? The only thing that helps is setting the justify bit but I think that this is not the way to go.

Your I2C communication is not working properly. when you see 0 and 255 all over the place, those are not real numbers, the communication is just not working properly at all.

The other thing is, those numbers are two-byte numbers and you have to read the two bytes and put them together correctly to make your 16 bit integer.

Hey Michinyon,

yes I know. For debugging reasons I´m only reading the register that serves the 8 bits on the left side without applying the 8 bit-bitshift. The register for the 8 least significant bits gives me very heterogeneous values. I posted this issue also in the Due board: [SOLVED] Any experiences with Due and Sparkfun 9DOF sensor stick? - Arduino Due - Arduino Forum . I got some recommendations for some other sketches but they produced the same outputs.

Cheers,

Michael

Update: works on an arduino uno without code changes. So the stick is fine. But what could be the problem with the due? The wire library? Can my I2C port be broken? Do I need to clock my cpu down somehow? no idea...

solved here: [SOLVED] Any experiences with Due and Sparkfun 9DOF sensor stick? - Arduino Due - Arduino Forum