I've purchased the new APM 2.6 and I don't' want to buy the $80 GPS/magnetometer since I already have a GPS. I imagine any generic/arduino magnetometer can be interfaced with the 2.6 with the correct wiring.
Does anyone have experience on this?
Here, save yourself some hassle:
Thanks, I'm under a time crunch though and can't wait for shipment from HK/China.
I bought a gy-271 board (off amazon) using the same HMC5883L as the 3DR magnetometer chip and hooked it up to the I2C port on the board. I got an error though when running the compass setup through the mission plannner. The board has a voltage regulator for the 5V, but I think there is some proprietary design in the 3DR Ardupilot which prevents non-3DR magnetometers from being used... :(
I broke down and paid overnight shipping for the 3DR compass board...ugh...I just keep throwing money at this thing. In the meantime I'm looking for wiring diagrams of the 3DR compass so I can modify this gy-271 board.
For reference, I followed the wiring instructions located here (under step 4):
Does anyone know how to force an I2C device to be slave? Is it done using an interrupt pin such as the DRDY (connection 15) on the honeywell HMC5883L?
Nolan, you can't differentiate between two HMCs. Just make sure SCL goes to SCL and SDA to SDA. I2C is not like a serial port where Rx goes to Tx.
Then pay attention to mag orientation. Default APM orientation is chip facing up and pin1 dot on capsule towards the corner with the GPS connectors, or you can read the markings on the mag chip with the APM USB connector towards you.
I just found this thread today...would have been nice to have it seen it a few days ago :/ It's not the same chip but is still helpful info.
Thanks for your reply Para. I double-checked the wiring (SCL, SDA, power, ground) just to be sure everything was connected properly (per the link I shared below). I also tried it with different orientations but it seemed to give me the same error.
When I start up the APM 2.6 with the compass connected to the Ardupilot (through the I2C) and open the terminal, the board boots up to the setup but has the compass init error. Then when I go into setup and try to turn it on manually it gives me the same error.
I noticed though that when I try to calibrate the barometer with the compass connected, the barometer stops working. As soon as I remove it, the barometer works fine. I'm taking this to mean that the compass is taking over the I2C bus.
From what I read the barometer is on the I2C channel as a slave, and multiple I2C slaves can be hooked up onto the same bus. From what I understand this is accomplished through each slave having an address. From this I am guessing there are two possible causes to the problem:
1. The compass needs to have a specific address in order to work with the barometer on the same I2C channel (I have limited knowledge on I2C communication so I could be blowing smoke... :/)
2. The DRDY interrupt pin is needed with multiple devices on the I2C bus in order to differentiate between them (Again...probably blowing smoke). This connection is broken out on my board and I don't know where to hook it, so I imagine it could be causing my problem. Yet on all the pictures of the 3DR external compass PCB's, it looks like connection 15 (DRDY) on the honeywell magnetometer chip is NC...which confuses me.
I've got the GY 271 and it was almost plug and play with my APM 2.5
I only needed to cut the trace to disable the onboard compass. Its hundreds of flights old and it still functions like new.
Maybe there is something wrong with your board?
I find myself researching this issue again due to issues on my Cub build with magnetic catches on the door which are sure to interfere.
It looks like the APM itself and the 3DR module both use a PCA9306 level translator, which "allows bidirectional voltage translations between 1.0 V and 5 V without the use of a direction pin". As you can see, the I2C bus on the APM does not have this.
The GY-271 DOES have a Level-Translator built-in; the GY-273 doesn't. On the other hand, this:
is the same module as the SparkFun module which was used successfully here:
which has no level translation and no direction pin.
However, Quadzimodo posts in that thread links to a GY-271 and a GY-273 and states they both work. Confused yet? Me too. I find myself wondering why the devs put in a level translator when all the intended applications only use 3.3V anyways.
But Stefan on that thread states he's used the HMC5983 successfully:
And that it's an upgrade part; both better sensitivity and better interference rejection.
I'm going to try the HMC5983, since as an added bonus it's also SPI bus compatible. I'm pretty sure I can find a use for it SOMEWHERE.
I've also ordered one of these to see if it can be made to work:
Because, as iskess says "Not much of a risk if it can't.". ;)