-1

I'm trying to design around Sparkfun's I2C products to work with Adafruit sensors, specifically Sparkfun's I2C Multiplexer, Differential Endpoint, and Differential Midpoint. From what it looks like, Sparkfun's schematics of their devices are based around 3.3 volts. However, is it also possible to run off of 5-volt logic as well?

Based on Sparkfun's schematics, if you start with an endpoint, you bring in power through their header at VCC, which depends on the I2C voltage that your MCU operates at. A short on the endpoint would pass it to the Blue wire on the RJ-45 line. From there, it can go to another endpoint and receive the same voltage (as same pin out). The same appears with the midpoint, with the Blue line on RJ-45 being shorted to their 3.3V net, which powers everything else (assuming the buck regulator is bypassed). With regards to the MUX, it's all powered via a Qwiic connector, so the 3.3V net can easily be 5-volts as well. From this reasoning, does it seem like the Sparkfun boards can work with 3.3V and 5V I2C logic depending on what logic level your MCU runs at?

1 Answers1

1

In general it is possible to interoperate 5V and 3.3V systems with I2C - provided that (a) you pull-up to 3.3V and (b) the minimum high-level for the 5V side is below 3.3V. You’d have to look at datasheets for specific devices to be sure, but I’ve certainly done this successfully with a handful of devices.

Frog
  • 6,686
  • 1
  • 8
  • 12
  • But wouldn't you run the risk of screwing up the MCU? As it is, the Sparkfun boards have no level translator. The Adafruit sensor modules have level translators allowing them to work at 3.3 or 5 volts. So, assuming no other level translators are present, wouldn't all this be dependent on the MCU? You can't just operate 5-volts off of a 3.3V processor. – BestQualityVacuum Sep 24 '21 at 21:03
  • The power to each device should be either 3.3 or 5 V, whichever it needs, but the pull-up should be to 3.3. This should be enough to satisfy the high-logic-level requirements of 5V devices but won’t over-voltage the 3.3 devices. For I2C you typically have only one pull-up resistor on each line, as I2C is designed for short distances and runs at moderate speed. That said, when implementing I2C in firmware I’ll often omit a pull-up on the clock line and drive it actively in both directions, partly because it saves power but mainly because I’m a heretic. – Frog Sep 24 '21 at 21:09
  • 1
    @Frog - Hi, Re: "*the pull-up should be to 3.3. This should be enough to satisfy the high-logic-level requirements of 5V devices*" That approach is *not* guaranteed to work, as it does not meet the I2C specification (0.7 x 5V is > 3.3V) (although, as you found, people will sometimes "get away with it"). The highly-upvoted answers on this linked question, explain why that approach is *risky* - see: [I2C: 3.3V and 5V devices without level-shifting on 3.3V-bus?](/q/35042/101852) (There's a comment on a deleted answer to that question, where problems *were* experienced when doing that approach.) – SamGibson Sep 25 '21 at 00:07
  • @SamGibson agreed this approach doesn’t meet the I2C spec and there will be cases where it doesn’t work, or not reliably. However, microprocessors that implement I2C (or TWI to confuse matters further) typically do so on general-purpose pins where the voltage thresholds are known, and sometimes as low as 2V for a high logic level. – Frog Sep 25 '21 at 04:15
  • I don't believe I'm talking about interoperability here. From what I read, all the Sparkfun/Adafruit devices can take 3.3-5 volts. It's just that Sparkfun assumes 3.3V on their schematic. That 3.3V could be 5V following the net as I explained above, depending on the voltage of the Endpoint header. In that sense, if you're working with a fixed voltage because of the MCU, either 5V or 3.3V but not both, it should be fine if hooked up appropriately? – BestQualityVacuum Sep 25 '21 at 14:53
  • As an example, I inherited a design that used an Adafruit TCS34725 board with a 5V Arduino Leonardo and upgraded to a 3.3V Arduino Due. The TCS34725 board has a bit of trickery built in to ensure that the I2C gets full swing at 5V even though the sensor IC itself operates at 3.3 so you should be quite safe with either voltage micro, but do check other devices. As an aside, it’s my experience that I2C problems are more often caused by having too high value pull-ups than voltage incompatibilities – Frog Sep 25 '21 at 21:25
  • In fact I’ve seen more than one I2C setup where a 3.3V device is in use but with a pull-up to 5V. That’s terrible design, obviously, but since IO pins are often protected by a diode with cathode to VCC (whether by design or side-effect), it means that the pins bleed less than 1mA to 3.3V – Frog Sep 25 '21 at 21:33