Feather Power Switch and i2c?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
tmarion
 
Posts: 1
Joined: Fri Oct 01, 2021 11:47 pm

Feather Power Switch and i2c?

Post by tmarion »

So I’m attempting to make an IoT device with a Feather ESP32-S2 and I added a power switch with the GND and EN pins as shown here:
https://io.adafruit.com/blog/tip/2016/1 ... er-switch/

This works for the Feather, but the sensor I have using the stemma port still gets power and thus drains the battery. Based on the docs, it sounds like that’s expected, but I was hoping there was some way to power down the sensor based on that power switch position?

I was thinking I could simply snip the GND wire on the stemma cable and solder it to the third (unused) switch pin, so GND is either tied to EN (off) or the stemma cable for the sensor (on) but is that unsafe for the sensor?

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

(Community member)
I know what you mean. I consider that a bug in the design, if the goal was to shut the entire design off.

You can address a lot of the current drain if you remove the resistors from the LED power indicators on any Stemma breakouts you have installed.

User avatar
Timeline
 
Posts: 1359
Joined: Sun Feb 18, 2024 7:13 pm

Re: Feather Power Switch and i2c?

Post by Timeline »

(Community member, not an Adafruit rep)
tmarion wrote: Tue Jan 21, 2025 7:47 pmI was hoping there was some way to power down the sensor based on that power switch position?
Looking at the schematic, it is not clear to me why driving the EN line low doesn't also turn off the stemma power. While the Stemma connector gets power from a separate regulator than the ESP does, the enable pin of the Stemma LDO regulator is driven by an ESP GPIO pin and the Stemma LDO also has a pull down resistor on it's EN line to GND.

So the way it should work, if you pull the EN pin on the board low (as you are doing), the ESP's LDO regulator shuts off, the ESP pins go to an unknown high-z (floating) state, and the Stemma regulator's EN pin is now pulled low by the resistor and should shut off the Stemma power.

As I look at it some more, the SDA and the SCL lines are both being kept active by the battery monitoring circuit so I wonder if these two lines are basically "back feeding" power into the ESP enough that the Stemma LDO regulator's EN line is biasing high.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

If I recall correctly, all of the Feather boards I've used have the Stemma regulator EN pin pulled-up without any access to managing the pin value.

I ran into exactly this issue, where I had a switch on the Feather EN signal, and the LEDs on the Stemma breakouts stayed on and drained the battery over time. Which left at least some of the +V nodes hot, which is what I was trying to avoid with the switch.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

I think the issue is that as long as the processor is running, you can turn the Stemma I2C power off under software control.

But when you disable the main power regulator via the EN pin, then the I2C_PWR signal is unpowered, and itsn't able to prevent the 10K resistor from turning the Stemma regulator on. The Stemma regulator gets its Vcc from VHI (the higher of the USB or battery input).

User avatar
Timeline
 
Posts: 1359
Joined: Sun Feb 18, 2024 7:13 pm

Re: Feather Power Switch and i2c?

Post by Timeline »

T_Mo wrote: Tue Jan 21, 2025 9:11 pm The Stemma regulator gets its Vcc from VHI (the higher of the USB or battery input).
But that regulator's EN line is I2C_PWR which is ESP's GPIO pin 11 (IO7) and in theory should float (or go low) when the ESP loses power and the pull down resistor on that same pin/net should, again in theory, pull down that line when the ESP is unpowered and turn off the Stemma regulator as well. So why the Stemma connector remains powered in not clear to me.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

I agree, in theory it should work as designed.
In practice, it does not seem to.

User avatar
adafruit_support_mike
 
Posts: 68250
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather Power Switch and i2c?

Post by adafruit_support_mike »

T_Mo wrote: Tue Jan 21, 2025 8:07 pm (Community member)
I know what you mean. I consider that a bug in the design, if the goal was to shut the entire design off.
STEMMA has always been a convenience-for-prototyping feature. It saves you the work of running VCC, GND, SDA, and SCL wires individually, but that's pretty much it.

The decision to take STEMMA's VCC power from upstream of the Feather's regulator is based on what people do with external connections.

The AP2112 regulator has a 600mA absolute maximum and 500mA comfortable peak current, but you start dealing with heat issues above about 200mA continuous current.

You're thinking about the board in terms of low-powered portable devices, but other people want to run a couple of 8x8 LED displays or 4x14-segment alphanumeric LED displays:

https://learn.adafruit.com/animating-mu ... -backpacks

Each HT16K33 can draw up to 200mA. The IS31FL3731 can use up to 270mA:

https://www.adafruit.com/product/2946

And even though we tell people you can't power a NeoPixel strip through the I2C NeoPixel Driver's STEMMA connection:

https://www.adafruit.com/product/5766

that just means the question is, "how *many* pixels can I power through the STEMMA connection?"

The point is that I2C and STEMMA aren't limited to low-current sensor applications. With things like the DRV2605, EMC2101, and environmental sensors, it's not hard to connect enough pieces to make a Feather's onboard regulator brown out or go into thermal overload. Routing STEMMA power around the AP2112 avoids those problems.

I do see the point of wanting a portable device that can charge the LiPo while the microcontroller and off-board I2C network are shut down. I can see wanting to use a Feather and its built-in LiPo charger instead of something like an ItsyBitsy and a LiPoly Backpack with a power switch:

https://www.adafruit.com/product/2124

I can see wanting to use STEMMA cables instead of wiring the I2C network by hand.

The cost of those design choices is having to move one connection: cut the VCC wire in the STEMMA cable that connects to the Feather, and re-route it to the Feather's 3V pin.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

Thanks for the tip.
Design is always a tradeoff.

User avatar
Timeline
 
Posts: 1359
Joined: Sun Feb 18, 2024 7:13 pm

Re: Feather Power Switch and i2c?

Post by Timeline »

Thanks Mike, although I am still confused by the fundamental question of why doesn't the stemma power get disabled when the board's EN line is disabled as the schematic indicates it should? As I mentioned above, I don't think that is by design but some sort of parasitic effect through the ESP's internal switch matrix that is allowing that Stemma power LDO to stay enabled even though the ESP has no power.

While I appreciate your explanation as to some of the design choices made, the fact remains that the Feather line includes a lipo battery connector with built in lipo charging. It is no stretch to assume there will be some people who want to be able to power off the Stemma connected devices when disabling power to the ESP while running off a lipo. Reviewing the schematic would seem to imply this should be the case.

To be fair though, this is a different application than a deep sleep mode where the ESP remains powered and I assume you can command the Stemma power off first then deep sleep the ESP. Or put another way, if one wants to use the Feather in a deep sleep mode, they should be able to power down the Stemma connector first. However if one wants to disable the ESP (power it down), then this isn't an actual "sleep" or "low power" mode so an unpowered ESP may result in unknown operation of other devices wires to it. Is that accurate?

User avatar
adafruit_support_mike
 
Posts: 68250
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather Power Switch and i2c?

Post by adafruit_support_mike »

Hmm.. I can't find my S3 to take direct measurements right now.

What voltage do you see on this pin when the Feather's EN pin is pulled low?
stemma-en.jpg
stemma-en.jpg (63.09 KiB) Viewed 16 times

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

Sorry, can't measure it.
When I pull EN down, the Feather +3.3 volts goes to zero, but the StemmaQT bus power stays On (all of the I2C sensor green LEDs are on).
But as soon as I touch a voltmeter probe to that node, the green LEDs turn off and the node voltage reads zero.
It's an awfully hard pin to probe and not short something out when I glance at the voltmeter.

This is on an ESP32-S2 Feather (no display) with two sensors in series on the StemmaQT bus.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

Maybe a problem with the 10K resistor pack that is supposed to pull I2C_PWR low after the ESP32-S2 shuts down?

User avatar
adafruit_support_mike
 
Posts: 68250
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather Power Switch and i2c?

Post by adafruit_support_mike »

It sounds like there's some weak leakage current holding the enable pin just high enough to keep the regulator going. I'll order a new board and check it out with my own high impedance gear.

The resistor array isn't very high on my list of suspects.. those are so simple it's hard for anything to go wrong. The weak current and total change of state when probed smells like a semiconductor.

User avatar
T_Mo
 
Posts: 1481
Joined: Thu Mar 15, 2018 7:10 pm

Re: Feather Power Switch and i2c?

Post by T_Mo »

Indeed it does. I'm suspicious of input protection diodes on the ESP32 chip.

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”