I2C flakiness when using battery-powered Notecarrier A with Raspberry Pi

Hi,

I’m using a Notecarrier A (housing a NOTE-NBGLN) connected to a Raspberry Pi Zero 2W. I2C connections are over the Pi GPIO 2/3 to SDA/SCL on the Notecarrier, plus a common GND.

(I’m using the Notecarrier A instead of the Notecarrier Pi as I would like to keep the notecard powered on, even when the Pi is shut off)

When the Notecarrier is powered by USB, the Pi detects the Notecard. i2cdetect shows the expected address and everything works.

However, if the Notecarrier is powered by a battery (I’m using a 3.7v 18650 connected to the LiPo JST connector), I2C only works intermittently.

I’ve tried various configurations:

  1. Notecarrier and Pi both powered by same USB source feeding into their respective USB inputs (works)
  2. Notecarrier connected to USB power source, Pi connected to battery (works)
  3. Notecarrier and Pi both connected to the battery (flaky)
  4. Notecarrier to battery and Pi to USB (flaky)

So the problem appears to be the Notecarrier being powered by the battery. However, events and status updates to notehub are being sent by the notecard as expected while on battery power (I’m running it on continuous mode for now); it’s the I2C connection that’s misbehaving.

Is the notecarrier very picky on the type of battery it works with?
I’m using a 4-cell version of this (which give me around 10k mAh)
https://www.18650batterystore.com/products/epoch-18650-2600mah-8a-protected-button-top-battery

Or is this some kind of bus timing issue? Are there additional connections/pull-ups I need to provide for this config to work? Or connect battery directly to V_in?

Notecard details: NOTE-NBGLN, Firmware version 7.5.2.17004 + Notecarrier A (non-legacy)

Thanks!

1 Like

Hi @NeilT and welcome to the Blues community!

Unfortunately I2C on the Pi is notoriously flaky, so in these situations we recommend connecting to the Notecard/Notecarrier via TX/RX (GPIO 14/15) instead of I2C. Here’s a link to our example in the note-python repo:

Hope that helps!

Thanks,
Rob

Hi @RobLauer, thanks for the pointers. I’ll try out the serial option and report back how it goes. Do you also recommend this route when using the Notecarrier Pi? I haven’t had any issues in that setup.

Hi @NeilT,

Personally I’ve never had trouble with a Pi 4 or Pi 5 when using I2C and a Notecarrier Pi. And then a colleague was unable to get his Pi 5 to communicate at all?! At this time there is so much confusion online about whether clock stretching has been “fixed” that we just don’t have any firm guidance right now. Definitely something we continue to monitor though.

Rob