# 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:** 20\
**Page:** 2

<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 9, 2021, 6:11pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/21 "2021-12-09T18:11:50Z")

</div>

I can also confirm that if I simply pull the Swan from the Notecarrier AF I am measuring an idle current of around 40uA.

---

<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 9, 2021, 7:24pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/22 "2021-12-09T19:24:10Z")

</div>

And I can also confirm that the Swan on its own with a wire pulled from EN to GND consumes 2.5uA…

So now to figure out where all the current is going when the two are combined!

It could be the I2C lines but does not explain the difference I am seeing against that of zfields !

---

<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 9, 2021, 7:53pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/23 "2021-12-09T19:53:41Z")

</div>

And for comparison using an Adafruit Feather M0 as a host I am seeing about 9.5mA of current when EN is pulled low so the Swan is better in this respect out of the box. Current during activity for the Swan is higher but I assume there is some trickery I can do to bring that down like lower the clock speed.

---

<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 9, 2021, 9:00pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/24 "2021-12-09T21:00:35Z")

</div>

Just to confirm:

- Do you have anything else wired up, other than a jumper between `ATTN` and `EN`?
- Are you using the same example sketch, SleepySensor?

~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 9, 2021, 9:29pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/25 "2021-12-09T21:29:06Z")

</div>

Hi Zak,

Nothing else wired up however using my own sketch. I did review the SleepySensor sketch and saw nothing special but I can of course test it as well.

Thanks

---

<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 9, 2021, 9:46pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/26 "2021-12-09T21:46:19Z")

</div>

So just tested with your SleepySensor sketch and getting same 245uA current.

 ![IMG_7760](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/ee031a1715970a144ff470cfb88090bc11c7bd5d.jpeg)

---

<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 9, 2021, 10:55pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/27 "2021-12-09T22:55:37Z")

</div>

That looks nearly identical to my setup.

 ![n-af-current](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/add2ff6da3b77e49ddd4eba9c2b13789f977b358.jpeg)

Is the Notecard connecting to Notehub successfully?

---

<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 9, 2021, 11:02pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/28 "2021-12-09T23:02:50Z")

</div>

> [@zfields](#):
>
> Is the Notecard connecting to Notehub successfully?

Yes but as I mentioned I have it set to “minimum” mode so it should not really connect …

How are you powering your test, Lipo battery ?  
Can you confirm that your “chg” LED on the Swan remains on even with EN pulled low. In your picture it looks off.

I have a second AF Notecarrier I could try for kicks.

Thanks,  
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 9, 2021, 11:26pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/29 "2021-12-09T23:26:05Z")

</div>

Looking at the schematic it appears the 3v3 output supply is off by default. I see its EN pin pulled to ground so this should be the same for both of us.

---

<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 9, 2021, 11:50pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/30 "2021-12-09T23:50:51Z")

</div>

> [@ssozonoff](#):
>
> Can you confirm that your “chg” LED on the Swan remains on even with EN pulled low. In your picture it looks off.

Never mind about that comment. Seems its only powered when USB is connected to Notecarrier.

---

<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 10, 2021, 12:52am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/31 "2021-12-10T00:52:45Z")

</div>

Yes, I am using a 2000mAh lipo.

If you have USB connected to the Notecarrier, then the Notecard will be in a “USB power state” (by design). When it is operating exclusively from battery or solar, then it will drop into its lowest power state.

Maybe this is the difference?  
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 10, 2021, 7:22am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/32 "2021-12-10T07:22:41Z")

</div>

Hi,

> [@zfields](#):
>
> If you have USB connected to the Notecarrier, then the Notecard will be in a “USB power state” (by design). When it is operating exclusively from battery or solar, then it will drop into its lowest power state.
> 
> Maybe this is the difference?

No because I am testing the same way as you, without USB. I get the same results as before with my uCurrent with an identical setup to yours. 227uA ☹  
If I can get this setup down to the 40uA you show I would be super happy!

One thing I do notice is that you are testing the high side rather than the low side. I am testing the low side. 🤷‍♂️

 ![IMG_7765_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/4ee7dcc9f4fc0fdd1f016a11ffc3f6afe8b7b9da.jpeg)

---

<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 10, 2021, 11:06am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/33 "2021-12-10T11:06:16Z")

</div>

So I tried another Notecarrier AF and another Notecard and I am still at 225uA.

Out of curiosity what firmware version are you running on your notecard ? I am on the latest 2.1.1.2013839.

---

<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 10, 2021, 11:22am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/34 "2021-12-10T11:22:16Z")

</div>

So the same test with the Notecarrier AL and Swan reveal the same sleep current as the test with the Notecarrier AF. → 227 uA

 ![IMG_7766_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/e11289d95c25776741f987872235ec28ca7ef005.jpeg)  
 ![IMG_7767_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/d1c780eab6d643d42589a3877f4a1b3f53a34670.jpeg)

---

<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 10, 2021, 11:51am UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/35 "2021-12-10T11:51:22Z")

</div>

Lastly I tried the sleeps sensor example code with the Notecarrier AL and Adafruit Huzzah 32 same as in the sample you provided. At best I get 120uA of current drain.

So I am slowly reaching the conclusion that your Current Ranger is off or then its somehow related to the Notecard firmware.  
I am slowly running our of ideas here.

 ![IMG_7769_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/147949ab2fabbdd5f62e83f6327c8983a7884976.jpeg)  
 ![IMG_7768_s](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/7367c2a8b8afabc8ef87276a1835bbc4887be74b.jpeg)

---

<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, 12:53pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/36 "2021-12-11T12:53:45Z")

</div>

Hi @ssozonoff

I’m investigating the difference in firmware at the moment, and I’ll get back to you with my findings.

Awesome research so far!  
Zak

---

<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, 2:17pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/37 "2021-12-11T14:17:44Z")

</div>

Hello again @ssozonoff

I have good news and a great lead.

First the good news. I updated my firmware to the latest firmware, and I am achieving slightly better current draw (barely noticable: ~500nA less than before).

The “great lead” came from looking at your picture again.

![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/394924fc760b7be5b49559b90fb56a33a9d07005.jpeg)

You appear to have a Swan 1.7, but I have the inferior Swan 1.5. My Swan does not have the hardware pull ups on the I2C lines.

In retrospect (it feels really silly when saying this aloud), @bsatrom had it right all along, and you _MUST_ have an isolator on your I2C lines. If you are running SleepySensor, this is easy to test. The sketch will put the MCU to sleep for 3 minutes. During this time, you can simply pull the I2C lines and see the current draw drop.

To validate/synchronize our ammeters, let’s both do the following steps:

1. Plug your Notecard into the Notecarrier-AL.
2. Connect the Notecard to your computer over USB
3. Establish a terminal connection to the Notecard using [Notecard Playground - Blues Wireless Developers](https://dev.blues.io/notecard-playground/).
4. Issue the command: `{"req":"hub.set","mode":"off"}`
5. Disconnect from USB
6. Short `<BAT` to `GND` for 5 seconds.
7. Short `<VUSB` to `GND` for 5 seconds.
8. Remove all shorts.
9. Power the Notecarrier-AL using the `BAT` JST connector.
10. Verify your ammeter reads ~10uA

Performing this test with a 2000mAh LiPo pouch, my ammeter reads 8.1uA - 11.3uA, and averages just under 9uA.

---

<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 11, 2021, 4:30pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/38 "2021-12-11T16:30:29Z")

</div>

Hi,

> [@zfields](#):
>
> First the good news. I updated my firmware to the latest firmware, and I am achieving slightly better current draw (barely noticable: ~500nA less than before).

Great 👍

> [@zfields](#):
>
> The “great lead” came from looking at your picture again.
> 
> You appear to have a Swan 1.7, but I have the inferior Swan 1.5. My Swan does not have the hardware pull ups on the I2C lines.

Happy you were able to identify this, I didn’t think of the Swan hardware being different 🙂

So its great news and less great news in that I was hoping to use the AF for my prototype for a more compact setup without the need for wiring up several PCB’s.

> You appear to have a Swan 1.7, but I have the inferior Swan 1.5. My Swan does not have the hardware pull ups on the I2C lines.

Do you have a simple explanation or pointers to some reading that further discusses the need to isolate those I2C lines ?  
If I understand correctly those I2C lines should go high when the I2C master goes to sleep because of the pull up resistors on the I2C lines. In which case there should be no current flowing. Things a probably more complex than I understand 🙂 Maybe something to do with phantom powering ?

Do we have a multi master setup in that the Notecard is also acting as an I2C master ?

Thanks guys, I am not trying to doubt what has been said rather just get my head around it so I actually understand what I am doing and why.

Kind thanks and have a great weekend.  
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 11, 2021, 6:17pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/39 "2021-12-11T18:17:42Z")

</div>

I have a plan to add the level shifter to the system without having loose pcb’s floating about.  
Will test this when I am home on Monday. I already have those level shifter’s that @bsatrom was referring me to… see I knew I was not going to escape that 🙂

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 11, 2021, 6:24pm UTC](https://discuss.blues.com/t/card-attn-restarting-my-host-and-notecard-when-running-under-battery/507/40 "2021-12-11T18:24:39Z")

</div>

> [@bsatrom](#):
>
> Even with the AL, you’re going to want to add a bi-directional level-shifter [like this one from Adafruit](https://www.adafruit.com/product/1875). To use this particular level-shifter, you can hook side A to the Notecard/Notecarrier with VCCA powered by VIO, and the B side to a Feather powered by the Feather’s 3V3 output.

I was just reading about the level shifter you refered me to and saw this

> That’s where this lovely chip, the TXB0104 bi-directional level converter comes in! This chip perform bidirectional level shifting from pretty much any voltage to any voltage and will **auto-detect the direction**. Only thing that doesn’t work well with this chip is i2c (because it uses strong pullups which confuse auto-direction sensor) or control lines with a lot of capacitance on them. If you need to use pullups, you can but they should be at least 50K ohm -

Is this going to be an issue ?

Thanks,  
Serge

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

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