8
\$\begingroup\$

I'm in the process of designing a low power sensor system. It is composed of an ultra low power ARM MCU and of 2 low power sensors.

The 2 sensors can communicate either via SPI or I2C. I need to transmit around 2200 bits from the sensors to the MCU every second.

Instinctively, the pull-up resistors required by I2C seem to make it a much worse protocol than SPI at a similar clock speed, power wise.

Is that assumption correct?

The distance between the sensors and the MCU would be of around 1 cm max.

The bus clock would probably be of around 1 MHz. The sensors would send data every 5 seconds.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ It depends on your exact implementation. Direct comparison in isolation between the two buses may look like so, but as there are no other details, it's hard to analyze what's the overall effect for the whole circuit. \$\endgroup\$
    – Justme
    Jul 17, 2023 at 9:48
  • 2
    \$\begingroup\$ The use of pull-ups just means that the ICs only need to pull the signal low to do a 0 and do high impedance to do a 1. Rather than having to drive either way to get either signal. But then SPI needs 4 lanes (well 5, as you need 2 chip select lines), rather than 2, so that's twice the number of signals being sent. The real answer for which uses less power depends on how often the interface is used, how fast the data is sent, how far the data is sent, and various other things including the impedance of all ICs on the network. \$\endgroup\$
    – Puffafish
    Jul 17, 2023 at 9:48
  • 5
    \$\begingroup\$ 1 MHz I2C may be common today, and the wires spend less time low passing current via pull-ups, but FM+ mode requires anyway fast rise time which requires low resistance and current is high. For lower power consumption, you would use slower speeds with weaker pull-ups. \$\endgroup\$
    – Justme
    Jul 17, 2023 at 10:23
  • 1
    \$\begingroup\$ My intuition is that the difference in power consumption between the two buses is very small. I2C is nice because you only need two wires, and it has built-in error checking in the protocol. SPI can usually be run faster and is simpler to implement in hardware (compared to I2C). SPI can be a lot more efficient - meaning fewer clock cycles to move the same amount of data. Part of the reason is there is no chip select in I2C, so device selection is done in-band (with the first byte, usually). \$\endgroup\$
    – Troutdog
    Jul 17, 2023 at 15:10
  • 2
    \$\begingroup\$ Out of curiosity, can you clarify how low power this low power application is? I have this suspicion that the protocol choice is not going to make much of a difference... \$\endgroup\$ Jul 18, 2023 at 6:48

1 Answer 1

6
\$\begingroup\$

It's really hard to give the right answer for all the use cases. However, as a general assumption, you can assume the I2C protocol could have lower power consumption than SPI. Don't worry about the resistors. In an idle state, the I2C lines are left floating, and the resistors only keep them at a high level. No current will be drawn from the resistors in idles state.

Bear in mind that the I2C protocol works at a lower frequency, needs less I/O, and the I/Os are simpler (just a single Open Drain transistor). These will help to reach lower power consumption.

For the SPI, the SCLK and MOSI are in totem-pole configuration (not sure about the CS). This means they are using two transistors at the output. Also, this means even in output at high states, these pins are sourcing current to the connected device. If the connected device is poorly designed, this could increase power consumption too.

\$\endgroup\$
2
  • 6
    \$\begingroup\$ This answer seems to imply that I2C allegedly works at a lower frequency than SPI. However, most I2C peripherals and most SPI peripherals work fine at any frequency lower than their max rated frequency -- so for any frequency you pick, the other kind of peripheral will accept a lower frequency. \$\endgroup\$
    – davidcary
    Jul 17, 2023 at 19:59
  • \$\begingroup\$ Inputs are high impdance so a high output will not source current - unless there is an error in the design. \$\endgroup\$
    – Justme
    Jul 24, 2023 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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