-1
\$\begingroup\$

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?

\$\endgroup\$
0
1
\$\begingroup\$

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.

\$\endgroup\$
7
  • \$\begingroup\$ 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. \$\endgroup\$ Sep 24 at 21:03
  • \$\begingroup\$ 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. \$\endgroup\$
    – Frog
    Sep 24 at 21:09
  • 1
    \$\begingroup\$ @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? (There's a comment on a deleted answer to that question, where problems were experienced when doing that approach.) \$\endgroup\$
    – SamGibson
    Sep 25 at 0:07
  • \$\begingroup\$ @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. \$\endgroup\$
    – Frog
    Sep 25 at 4:15
  • \$\begingroup\$ 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? \$\endgroup\$ Sep 25 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.