New MinIMU-9 help not working

Hello, naschpitz.

I am sorry to hear that you received a MinIMU-9 board with a bad solder connection. We visually inspect and test all of our boards to try to minimize the number of defective boards we ship, and we are working on further improving the inspection process, but unfortunately, it seems like you got a bad one that slipped through.

Separately, however, we definitely recommend against using our products in applications where failure can lead to probable injury and material damage.

- Kevin

The issue affected both boards, this is exactly why I bought the second one. The difference is that the last one took some time to expose it’s hidden malfunction, preciselly when I had to move it inside the box.


As Kevin said, we are very sorry for the problems you’ve had with your MinIMUs. In case it helps you have more confidence in our products, we have had very few reports of problems like yours, so I think were just quite unlucky with these two boards. However, we have reviewed our testing procedure to make sure we aren’t inadvertently putting pressure on that part that would mask poor solder connections, and we have instructed quality control to pay extra attention to that MOSFET during inspection and testing.

I would also like to echo Kevin’s warning: please do not use our products in an application where failure would cause injury!

- Ben

Hi, Im a student of engineering and I want to ask you 2 things about MINIMU9 V2 ,the first, In the datasheet of the sensor, says that the registers of the accel it´s a 16 bits data, but you shift the data 4 bits to right, wich means you work with a 12 bits, Where you found information about 12 bits of data, the next question its about the configuration of the MiniMu-9 V2, I configure the registers with this values for the accel.
REG_1A (0x27)
REG_4A(0x18) .

when I read this registers and send it to PC (previous complement 2 again), the range of the data it´s 4 numbers only (I send the 16 bits data) so I want to ask you, what is the configuration that you use for Accel, Gyro and Mag. I´m working with PIC and CCS compiler. Thanks a lot for your answers.

Hello, hugo.

The outputs of the MinIMU-9 are in a 16-bit format (two 8-bit registers), but only 12 of the bits contain meaningful information for the magnetometer and accelerometer readings; the rest are always 0. You can read a more detailed explanation in my post here.

I’m not sure what you mean by “the range of the data it´s 4 numbers only”. You might try looking at our Arduino code for an example of how to configure the sensors on the MinIMU-9. If that doesn’t solve your problem, could you try to state your question more clearly and show us the code that you are using?

- Kevin

Hi Kevin, thanks for your answer. i readt your post, check the configuration of the sensor that I use, chenge the values of my configuration, I read the data sheet of the sensor, the data of the register it´s a data of 12 bits in complement 2´s format. this information it´s coming in sensor datasheet page 28, … e_id=0J564, so I want to ask you if you convert the data read from de registers OUT_L_A (28h), OUT_X_H_A (29h)???

Another want to ask you it´s about the how you convert this data readed from de sensor into G´s, for accel, how to convert the information of the mag into Gauss, and the information from the gyro to grades??? I read you code, for I don´t understand from where you take the information for your code, thank you very much for your before answer.

I atthached the code that I use. for more information.

#define WRITE_A         0x32
#define READ_A          0x33    
#define REG1_A          0x20     
#define REG4_A          0x23        
#define OUT_X_L_A       0x28    
#define OUT_X_H_A       0x29 
#define OUT_Y_L_A       0x2A 
#define OUT_Y_H_A       0x2B 
#define OUT_Z_L_A       0x2C 
#define OUT_Z_H_A       0x2D 

unsigned int16 x_accl,  y_accl,  z_accl;        //x,y,z-data_ 8 bit
unsigned int16 x_acch,  y_acch,  z_acch; 

i2c_stop();                             //Stop  I2C transmisión

i2c_start();                           //Start I2C

                     x_accl = read_acc(OUT_X_L_A);    //function to read sensor I2C
                     y_accl = read_acc(OUT_Y_L_A);     
                     z_accl = read_acc(OUT_Z_L_A);     
                     x_acch = read_acc(OUT_X_H_A);     
                     y_acch = read_acc(OUT_Y_H_A);     
                     z_acch = read_acc(OUT_Z_H_A);     
                     Xa16= (x_acch<<8)+ x_accl;         //Concatenate registers
                     Ya16= (y_acch<<8)+ y_accl;
                     Za16= (z_acch<<8)+ z_accl;
                     Xa16 = Xa16 >> 4;                       //Re-Arrange of the data                   
                     Ya16 = Ya16 >> 4;  
                     Za16 = Za16 >> 4;
                 printf(" @X=%lu@Y=%lu@Z=%lu", Xa16, Ya16, Za16  );  // Send data from the sensor to PC

One issue with your code is that x_accl, y_accl, and z_accl should be signed, not unsigned. (That way, the 2’s complement data will automatically be interpreted correctly.)

You might also be missing a cast when you combine the bytes; if your problem is that you’re only seeing 4 bits of data, that might by why. Could you try changing these lines:

                     Xa16= (x_acch<<8)+ x_accl;         //Concatenate registers
                     Ya16= (y_acch<<8)+ y_accl;
                     Za16= (z_acch<<8)+ z_accl;

to this:

                     Xa16= (int16)(x_acch<<8)+ x_accl;         //Concatenate registers
                     Ya16= (int16)(y_acch<<8)+ y_accl;
                     Za16= (int16)(z_acch<<8)+ z_accl;

and see if that gives you better results?

To convert from the raw output of the sensors to g, gauss, and dps, you need to find the conversion factors in the datasheet; the one to use depends on the full scale or gain setting you’re using. For the LSM303DLHC, look at “Linear acceleration sensitivity” and “Magnetic gain setting” on page 9. (LSB stands for least significant bit; for example, if you have FS set to 11, a change of 1 in the sensor output means a difference of 12 mg, or 0.012 g.) For the L3GD20, look at “Sensitivity”, also on page 9 of its datasheet.

By the way, I added [code] tags in your last post to make it easier to read; please use this method to post code in the future.

- Kevin

Thank you.

I will read the datasheet again. I’ll send a sample to see if it’s okay my conversion.
Thank you.

hi kevin.

I am new to this sensor, but I want to program it in c. but I have some difficulties such as I want to play in pic ccs or language to the following:

L3G :: vector_cross void (const vector * a, const vector * b, vector * out)
out-> x = a-> y * b-> z - a-> z * b-> y;
out-> y = a-> z * b-> x - a-> x * b-> z;
out-> z = a-> x * b-> y - a-> y * b-> x;

float L3G :: vector_dot (const vector * a, const vector * b)
return a-> x * b-> x + a-> y * b-> y + a-> z * b-> z;

void L3G :: vector_normalize (vector * a)
float mag = sqrt (vector_dot (a, a));
a-> x / = mag;
a-> y / = mag;
a-> z / = mag;

but are not it means or as I can translate: x = a-> and * b-> z - a-> z * b-> and
or it means:
-> Or a-> x / =

Can you help, please.

I have doubts with what he says about hugo comopasar of sensor units gravedas units, magnetic field and the inclination of the rotation.

Ing study’m not in high school and is programmed in C for pic, but some things got complicated when translating.

I hope I can help.

Thank you.

Hello, victor80.

Sorry, it’s hard for me to understand what you’re asking. It sounds like you might be confused about how the vector arithmetic functions work, so I can try to explain them a little. The functions work with pointers to structs of the type “vector”, which is defined in L3G.h:

    typedef struct vector
      float x, y, z;
    } vector;

The “->” operator is a way to access a member of a struct that you have a pointer to. So this line:

out->x = a->y*b->z - a->z*b->y;

means “set the X component of the ‘out’ vector to (the Y component of the ‘a’ vector times the Z component of the ‘b’ vector) minus (the Z component of the ‘a’ vector times the Y component of the ‘b’ vector)”.

If you’re still having trouble, I suggest trying to find someone (like a friend or teacher) with programming and electronics experience who can help you understand the datasheets, our code, and the math behind it.

- Kevin