AeroQuad – Sensors (Part 1)

James Young · May 10, 2011

As discussed in my last post about the AeroQuad, I wasn’t having much luck with the Wii sensors and wound out getting a BMA180 accelerometer and ITG3200 gyroscope ordered in.  Short results:  Gyroscope’s fine, accelerometer’s not.  But it’s being replaced by the supplier, so all’s good.


The BMA180 Breakout Board

The BMA180 board was fitted up to a breadboard using the following schematic (courtesy Sparkfun Forums);

BMA180 Wiring Schematic

After wiring, I went and set up an I2C Scanner sketch which I found at todbot.com.  The idea here was to just see the BMA180 respond on the I2C bus.  However, it didn’t work.  After a lot of stuffing around, checking wiring, and reading the Sparkfun schematic and the Bosch datasheet, I did a brief experiment.

The BMA180 was locking up the I2C bus whenever it was connected, which made me think that SDO (which was tied to ground) may have been dragging SDI to ground also.  SDO is used in I2C mode as the address select switch - tie it to ground to select I2C address 0x40, tie it to Vccio to select I2C address 0x41.  So I decided to leave SDO floating instead of tying it to ground.

The BMA180 then worked fine!  Cracking out the multimeter after a lot more reading, I checked pins 6 and 7 on the breakout board for a short, and sure enough they’re shorted.  So I then very carefully went over my soldering job with a big magnifying glass to make sure there’s no bridges, and everything looks fine on my side;

BMA180 Breakout Board

Pins 6 and 7 are on the right on that picture.  Significant gap between the two.  Then I came across threads on forums with other people who have had similar problems, and looking at the BMA180 chip itself, I notice that the soldering looks a bit heavy (pretty big blobs of solder under the chip).  Therefore it’s pretty likely that the chip is shorted under the board.  Unfortunate, but the manufacturer is replacing it for me.

The ITG3200 Breakout Board

The ITG3200 is a much happier tale.  Note that both the BMA180 and the ITG3200 are 3.3v devices, so you need to push their signals through a logic level converter to get them to the 5v required by the Arduino.  You should use the Tx0 and Tx1 lines, since they are bidirectional.

Wiring was very straightforward, I just followed the AeroQuad v1.7 wiring schematic and linked up the gyroscope as appropriate.  The SCL (I2C clock) is the yellow line and should go to Analog Pin 5 on the Arduino.  SDA (I2C data) is the green wire and should go to Analog Pin 4.

ITG3200 Test Overview
ITG3200 Closeup
LLC Closeup
I2C Wiring to Arduino

Pay special attention to the breadboard.  The left side of the breadboard is the “high voltage” side, where the +5V from the Arduino goes onto the power rails, and the right side is the “low voltage” side, where the +3.3V from the Arduino goes in.  Note that the logic level converter bridges the “middle”, with the HV side on the left, and the LV side on the right.  It’s very important you don’t mix them up, since if you do you’ll blow up your gyro.

Anyway, after wiring, I used the I2CScanner sketch I found.  I had to modify it slightly to scan above 100, since the I2C address for the ITG3200 is 0x69, which is 105 in decimal.  No matter, I just set up the scanner to scan up to 127.  Found it first go.

Then, I uploaded and ran this itg3200_test.pde sketch (on my GoogleCode repository).  Sketch runs, and shows valid data coming from the gyro - I pitch, yaw, and roll it and the X,Y,Z figures change.  All’s good!

Next Steps

I’ve verified the gyro works fine, so that’s going back in the ESD bag and into my breakout box.  Now I need to wait for a replacement BMA180 and test that.  I’m also still waiting for my receiver and AeroQuad shield.

Twitter, Facebook