# Card.attn restarting my host and notecard when running under battery

**URL:** <https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507>\
**Category:** Troubleshooting\
**Created:** [November 29, 2021, 7:49pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507 "2021-11-29T19:49:10Z")\
**Posts on this page:** 10\
**Page:** 3

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [December 11, 2021, 9:55pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/41 "2021-12-11T21:55:40Z")

</div>

Hi @ssozonoff ,

I dug through the chips in my office, and I didn’t see one of those in my drawers. I have an off-brand level-shifter, and I don’t want to lead you any further down the road of apples and oranges.

Again, you can run SleepySensor as an easy test. The sketch will put the MCU to sleep for 3 minutes. During this time, you can simply pull the I2C lines and confirm the current draw drops as expected. That should help you identify a target value, then you can see how the isolator you have compares to the target.

~Zak

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 12, 2021, 8:50am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/42 "2021-12-12T08:50:22Z")

</div>

> [@zfields](#):
>
> Again, you can run SleepySensor as an easy test. The sketch will put the MCU to sleep for 3 minutes. During this time, you can simply pull the I2C lines and confirm the current draw drops as expected. That should help you identify a target value, then you can see how the isolator you have compares to the target.

Agreed this is a good approach.

Serge

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 12, 2021, 8:07pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/43 "2021-12-12T20:07:58Z")

</div>

Evening Zak.

So I can confirm that using my code, the AL Notecarrier and a Swan if I pull the I2C lines after powering down the host I am seeing 12uA idle current which is awesome.

If re-read the discussion about isolating the I2C lines with the level shifter I need a way to access the hosts (Swan’s) MCU 3V3 supply so that I can power down the level shifter at the same time as the MCU. It seems that the only 3V3 output easily accessible from a header pin is from the Output Supply which is not the same as the MCU aka Main Supply, is powered directly from VMAIN, and has its own EN wired directly to MCU pin PE4 which is not exposed via a header pin.

If I were to use the Output Supply and pull the EN pin low via PE4 just before sleep I would no longer be able to communicate with the notecard in order to send the attn command 🤷‍♂️

My plan was to use the Output Supply in order to power up and down my sensor.

Maybe I am missing something obvious ? Could I use the EN pin host side to provide power to the level shifter (I am assuming the current is signal level) and when its pulled low it would isolate the I2C lines ?

BR,  
Serge

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 12, 2021, 9:07pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/44 "2021-12-12T21:07:49Z")

</div>

> [@ssozonoff](#):
>
> TXB0104

I tested with this level shifter and could not get the I2C communication working. Have ordered a different one compatible with I2C to test with.

Serge

---

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [December 12, 2021, 9:16pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/45 "2021-12-12T21:16:41Z")

</div>

> [@ssozonoff](#):
>
> So I can confirm that using my code, the AL Notecarrier and a Swan if I pull the I2C lines after powering down the host I am seeing 12uA idle current which is awesome.

That’s great, glad to hear it!

> If I were to use the Output Supply and pull the EN pin low via PE4 just before sleep I would no longer be able to communicate with the notecard in order to send the attn command 🤷‍♂️

What if you drove both the level-shifter `EN` and the Swan `EN` from the Notecard `ATTN` pin? Wouldn’t that give you the behavior you need?

~Zak

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 13, 2021, 8:37pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/46 "2021-12-13T20:37:36Z")

</div>

Hi Zak,

> [@zfields](#):
>
> What if you drove both the level-shifter `EN` and the Swan `EN` from the Notecard `ATTN` pin? Wouldn’t that give you the behavior you need?

Yes this is my thinking as well. Waiting for a new level shifter…

Serge

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 13, 2021, 9:18pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/47 "2021-12-13T21:18:11Z")

</div>

As an alternative to a level shifter on the I2C lines could one of these be used ?

> ISO154x Low-Power Bidirectional I2C Isolators

> **[iso1540.pdf](https://www.ti.com/lit/ds/symlink/iso1540.pdf?ts=1639380598024)**
>
> 1262.59 KB

Serge

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 14, 2021, 9:01am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/48 "2021-12-14T09:01:22Z")

</div>

So here we go, sleeping at ~10uA using a level shifter on the I2C lines 👍 Super happy about that!! Now I just need to figure out how to package all this up nicely. Thanks for your help @zfields and @bsatrom

 ![IMG_7796_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/f89b6c2ee0b4edaea11e048f330d390b50b1acbe.jpeg)  
 ![IMG_7795_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/15749e8a4ed653d0b5ef6ea6d2af86ab383a2f3c.jpeg)

For this interested this test was done using the following level shifter

> **[4-channel I2C-safe Bi-directional Logic Level Converter](https://www.adafruit.com/product/757)**
>
> Because the Arduino (and Basic Stamp) are 5V devices, and most modern sensors, displays, flashcards, and modes are 3.3V-only, many makers find that they need to perform level ...

---

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [December 14, 2021, 1:15pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/49 "2021-12-14T13:15:56Z")

</div>

Awesome work @ssozonoff!

I’m glad to see you were able to get this worked out. I think this progression will serve not only as a great reference for us, but for many customers to come.

It was great working with you,  
Zak

---

<div class="post-metadata">

**Author:** ![ssozonoff](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@ssozonoff](https://discuss.blues.com/u/ssozonoff)\
**Post date:** [December 14, 2021, 4:21pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/50 "2021-12-14T16:21:21Z")

</div>

And here is a Notecarrier AF at ~40uA using the level shifter. Its a bit of a Frankenstein but it all fits nice and compact.

 ![IMG_7799_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/ceeba98e9259c66695180f0d5c36346d309dff11.jpeg)  
 ![IMG_7798_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/6ededc92d59c9af299c8f789a9b5ca91ffa8aee0.jpeg)

Serge

[Previous page](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507.md?page=2)
