Sparkfun HMC5583 magnetometer

I am wiring up a special-purpose GPS box, including a compass. The Sparkfun HMC5583 breakout board is, apparently, a 3.3 v. device which can tolerate the 5 v. I2C lines from any of the Arduino boards. But, I am also going to include a 3.3 v. device for which the I/O lines are limited to 3.3 v., so I am going to include some level-shifter transistors in the circuit.

The question is, if the HMC5583 is 5 v. compatible, is it also 3.3 v. compatible on its SDA/SCL lines?

0 results for HMC5583

But, seriously, why not pull the manufacturer's data sheet just for piece-of-mind. I am a EE and I honestly try to assist folks with accurate info, but I have been known to make a mistake. When working with sensors, pulling the data sheet is job #1 before purchase.

IMO

Ray

Unless you have some other constraints that mean you need a 5V arduino then why not get a 3.3V version or convert your UNO? to 3.3V

Unfortunately, the Sparkfun people never clearly elaborate on this, and of course, the data sheet applies to the chip, not the Sparkfun breakout board, so what I read on a data sheet about voltages may not be accurate after Sparkfun has done their thing. It only takes a MOSFET and two resistors to build a bidirectional level shifter, so I'll drive the UNO side of the bus at 5v. and shift to 3.3v for the two attached 3.3 v. devices.

jrdoner: It only takes a MOSFET and two resistors to build a bidirectional level shifter, so I'll drive the UNO side of the bus at 5v. and shift to 3.3v for the two attached 3.3 v. devices.

Just be wise with your design:

MikeGrusin / about 2 years ago / 1 It works because the Arduino Wire library turns on the ATmega’s internal weak pull-up resistors by default. This situation will work but isn’t ideal; you should really have external pull-up resistors to 3.3V.

Final report: for a level-shifter, I used a 2N7000 N-channel MOSFET and two 10K pullup resistors as per the diagram from Philips AN97055. It's an ingenious little scheme, and testing with an OScope, it delivered very good performance at 100 KHz., and it likewise worked fine for talking to the HMC5883. The OScope plot didn't look so good at 400KHz. (high speed I2C), but would probably improve with a more careful choice of components.

I recommend this circuit to anybody looking for level-shifting: it can operate with any two input levels, and it's much cheaper than buying the $3.00 commercailly available version.