New MinIMU-9 help not working

Hello, Chuck.

Thanks for posting your pictures. I couldn’t see anything wrong in them, so I will contact you via email with RMA information.

I did test one MinIMU board from our stock after you first reported your problem, and it seemed to work fine for me. I will verify that the replacement board we send you is good before we ship it.

- Kevin

Kevin,
Thanks.

I’m actually going to order another one right now.
Along with some other parts. I’m taking advantage of the sale.

I just wanted you to know so not to confuse everyone.

I appear to be having the same problem. I have not been able to go through the thorough troubleshooting steps that chuck has, but I managed to determine that the program is hanging at “while (Wire.available() < 6);” line in the L3G4200D library and the same in LSM303.

I’m using an arduino mega. There’s a good electrical connection between all my pins:
5V -> VIN
GND -> GND
Analog Pin 21 -> SCL
Analog Pin 20 -> SDA

Was there ever a resolution or solution?

Hello.

Chuck’s MinIMU-9 had a damaged MOSFET on the SDA level-shifter. We don’t know what caused it, but it could have been from something as simple as an inadvertent static zap. Can you use your oscilloscope to verify that the Arduino is doing what you expect? Can you post a screenshots/pictures of your oscilloscope that make it possible to see exactly what pins 20 and 21 are doing (similar to what Chuck posted, if possible)? Can you also post some close-up, in-focus pictures of your board?

- Ben

Thanks for your help, Ben. I took a look with my scope and the Arduino appeared to be behaving. I got up bright and early this morning to speak to my advisor about this and he told me there didn’t appear to be anything wrong with the IMU chip, at least not visibly. He mentioned that he had a stock of mega’s with something screwy about their firmware that interfered with their I2C communications. I’m sure it’s no coincidence that I’m having this problem and the mega I’m using was borrowed from his stock. I swapped out the boards and the MinIMU spectacularly streamed it’s heading estimations to the serial port! I reprogrammed the firmware on the original and it also worked.
I suppose hanging at “while (Wire.available() < 6);” is actually a fairly general problem of failed communications, so it was a little hasty of me to assume that my problem must have been related to Chucks
Thanks again!

I got my Minimu9 on the black friday sale and have only now started to use it. I got the arduino libraries working and had everything up an running, all the examples worked fine for a while. After having it run for maybe an hour, it stopped working. The compass.init() function would not return. I traced where it was hanging, and it was in the TwoWire library (specificallt the twi utility endTransmission function). At one point, the Serial example program ran for about 2 seconds, then it started hanging again. After some troubleshooting, I looked at it this morning, and it is running again without any changes from where it was not working in the previous night.

I hooked it up the way the examples say to. I am running an Arduino Duemilinove. 5V to VIN, gnd to gnd, scl to analog pin 5, sda to analog pin 4. I am wondering if you might have any insight to this. I might to let it run more today to see if I get the same behavior.

Hello, eakers.

The behavior you are describing suggests that you might have an intermittent connection somewhere. Have you soldered header pins to the IMU and tested them for good electrical connectivity, and checked for any loose wires in your setup? Could you try inspecting the surface mount components on the board carefully to look for any bad solder joints?

- Kevin

Hello there,

I think I have the same issue…

The first IMU that I bought didn’t work at all. I thought I was doing something wrong, despite the fact that a SparkFun BMP085 i2c barometric sensor (btw, fed by the miniIMU) was being detected. I triple-checked the header’s soldering, everything seemed to be fine. When I was removing the IMU from my protoboard I decided to take another try: this time it worked fine, with the 3 address being detected as they should, but as soon as I stoped applying the force that I was doing to remove it from the protoboard it stoped working and I never saw it working again.

The second one worked fine since the beginning, worked for weeks, until today that I decided to change it’s location inside my plastic box, since then the symptoms seem to be like the first board: I saw it working just once when I placed it in my protoboard, then when I removed to connect it back to it’s primary location (inside the box) it just stoped working, not even on the protoboard it is showing activity anymore.

PS.: in both cases the BMP085 continued to work fine. I tried with an Arduino UNO and an Arduino MEGA 1280 - same result.

I just don’t know what to do anymore…
Is there anyway to send these boards back to you for a deeper analysis?

Thanks in advance.

Hello again,

Today in the morning I realized what the problem is about: a tiny MOSFET connected to the SDA pin has a lousy soldering. Pressing it with my fingertip made the device to show up in the detection routine, as shown below (0x77 is the barometric sensor):

Found device at address - 0x77

Scanning for devices…please wait

Found device at address - 0x77

Scanning for devices…please wait

Found device at address - 0x69

Found device at address - 0x77

Scanning for devices…please wait

Found device at address - 0x18

Found device at address - 0x1E

Found device at address - 0x69

Found device at address - 0x77

Scanning for devices…please wait

I decided to try the same procedure with the first board - worked perfectly, but as soon as I stop pressing it, it stoped.

I took some courage and reworked the soldering on the tiny MOSFET: now I have two fully working boards again.

I don’t know if I’m happy or concerned. Happy because I won’t need to spend more money, concerced because I don’t know if I can trust in this piece of hardware; how can I be 100% sure that the other solderings won’t show the same misbehaviour?
This board is critical for my application, a failure will certainly led to a total destruction of it, followed by a very probable personal and material injuries.

But there is one thing I’m pretty sure: my next projects will not relly on Polulu’s boards.

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.

Hello.

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, pololu.com/file/download/LSM … 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; 

//write_sensor 
i2c_start();                            
i2c_write(WRITE_A);                      
i2c_write(REG1_A);                      
i2c_write(0x27);                        
i2c_stop();                             //Stop  I2C transmisión
delay_ms(10);                            

i2c_start();                           //Start I2C
i2c_write(WRITE_A);                     
i2c_write(REG4_A);                     
i2c_write(0x08);                       
i2c_stop();                           

                     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