Switch off Feather and STEMMA peripherals??

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
superg2
 
Posts: 41
Joined: Wed Aug 31, 2022 12:27 pm

Re: Switch off Feather and STEMMA peripherals??

Post by superg2 »

Of course, now I just tried again and the green light is out, I haven't changed anything. Flipped a couple more times, sometimes the GPS lights turns off and other times not.

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Switch off Feather and STEMMA peripherals??

Post by danhalbert »

I am wondering about whether the switch or its wiring is not working right, or is high resistance or something.

What kind of switch is it?

If you ground the EN pin with a jumper connected to ground, does the GPS go off consistently?

User avatar
dg3
 
Posts: 4
Joined: Tue Dec 13, 2022 10:55 pm

Re: Switch off Feather and STEMMA peripherals??

Post by dg3 »

I'm having the same/ a similar issue on my board. I have several peripherals (mostly adafruit dev boards) daisy chained down the STEMMA line and 2 power supplies that source from the 3.3V rail of the Feather ESP32 V2. The hope was to turn off the peripherals and power supplies via the EN pin. I bought this ESP32 V2 in the last couple of months, so it is a recent build (I presume).

TL/DR: In summary, EN prevents power on, but does not shutdown once powered, unless EN is grounded when reset is pressed.

I am using a PCB and the connections are solid. Multi-meter confirms < 1ohm between GND and EN when the switch is engaged and ~100k when open. If the EN is grounded when I power Vbus (USB or external 5V) the system does not turn on - no peripherals, no power supplies. I can confirm the USB driver and battery charger are still active though! (USB port keeps dinging and my LED on Vbat is lit up). When I flip the switch and float EN, everything powers on. Yay! When I flip the switch back and ground EN, everything stays on. Nooo! All STEMMA devices are powered, my extra power rails are active, I can see the processor updating the OLED display... major bummer. If I press reset in this state, it goes back to fully shut down, waiting for EN to float again.

These are very common, 200V/5A, reliable switches that I've used for dozens of power entries. The behavior is very consistent with every power cycle of the board.

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Switch off Feather and STEMMA peripherals??

Post by danhalbert »

I have managed to reproduce this intermittently by stringing multiple I2C devices on the I2C bus. I suspect some backpowering is going on from the I2C pullup resistors and various capacitors and is holding the I2C_POWER pin up long enough to hold the STEMMA regulator EN which then latches things on. I am going to inquire further.

User avatar
dg3
 
Posts: 4
Joined: Tue Dec 13, 2022 10:55 pm

Re: Switch off Feather and STEMMA peripherals??

Post by dg3 »

danhalbert wrote: Fri Jan 27, 2023 9:10 pm I have managed to reproduce this intermittently by stringing multiple I2C devices on the I2C bus. I suspect some backpowering is going on from the I2C pullup resistors and various capacitors and is holding the I2C_POWER pin up long enough to hold the STEMMA regulator EN which then latches things on. I am going to inquire further.
Disconnected all peripherals and one of the power supplies - minimal power draw other than code, but with no periph's it isn't doing much. The shutdown still does not work. I have an LED on the 3.3V line.. bright blue. Same behavior with reset button. I can break out the reset pin and give it the ole 1-2, but I need this to be user friendly.

I am likely to resort to off-board supply with shutdown into Vbus with diode protection. Still wont get shutdown with USB, but at least it would with external power.

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Switch off Feather and STEMMA peripherals??

Post by adafruit2 »

yah this is likely a backpowering thing - i could only get it to happen with 3 items chained - which ends up being about 2K per pullup in parallel.
there's no instant solution, we'll think of what could be done in a respin... but there are likely workarounds: instead of using EN can you detect the switch on an interrupt pin, then turn off the GPIO to the second regulator enable and go into a deep sleep? its been a while since we did ESP32 wakeups but pretty sure you can use the switch level to then know when its time to wake from deep sleep

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Switch off Feather and STEMMA peripherals??

Post by danhalbert »

A mechanical solution for now is to use a double-pole double-throw switch: one pole (using the "make" side of the switch) grounds EN, and the other (on the break side) breaks the power line on the STEMMA chain, which you will need to wire through the switch.

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Switch off Feather and STEMMA peripherals??

Post by adafruit2 »

yeah that will *definitely* also work, good suggestion!

User avatar
superg2
 
Posts: 41
Joined: Wed Aug 31, 2022 12:27 pm

Re: Switch off Feather and STEMMA peripherals??

Post by superg2 »

I think I'm following can you confirm I'm on the right direction.

1. This solution will mean I do not use the STEMMA QT cable. I'll solder wires behind the GPS and feather
2. Get a switch similar to the following
https://smile.amazon.com/gp/product/B07LBNFC1R
3. One side of the switch will go between the feather and GPS power and the other side will be between Ground and Enable

Does that seem correct? I would like to use the STEMMA cable but I don't see how in this solution.

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Switch off Feather and STEMMA peripherals??

Post by danhalbert »

dpdt.png
dpdt.png (31.89 KiB) Viewed 82 times
In the above, the switch is up, and power is being supplied to the miniGPS. The EN pin is not connected, so the Feather is enabled. If the switch is switched the other way, power to the miniGPS is disconnected, and the EN pin is grounded.

Yes, you could just use wires to the miniGPS, or you could cut the power line on the STEMMA cable and splice it into the switch contacts, so that the switch can interrupt just the power line.

We normally have these but they are out of stock: https://www.adafruit.com/product/3220 :(

User avatar
dg3
 
Posts: 4
Joined: Tue Dec 13, 2022 10:55 pm

Re: Switch off Feather and STEMMA peripherals??

Post by dg3 »

adafruit2 wrote: Fri Jan 27, 2023 9:42 pm yah this is likely a backpowering thing - i could only get it to happen with 3 items chained - which ends up being about 2K per pullup in parallel.
there's no instant solution, we'll think of what could be done in a respin... but there are likely workarounds: instead of using EN can you detect the switch on an interrupt pin, then turn off the GPIO to the second regulator enable and go into a deep sleep? its been a while since we did ESP32 wakeups but pretty sure you can use the switch level to then know when its time to wake from deep sleep
Edit/ update: I jump the STEMMA/QWIIC connector from the feather to my PCB so that I can have the I2C lines available on the PCB (less cables daisy chaining around). I have LEDs (~2Vfwd) and a 4.7k resistors on the SCL and SDA lines for diagnostic. These LEDs alone appear to be sufficient to back-power and prevent shutdown. If I pull my jumper so the LEDs don't power, then the board does shutdown with the 3V3 enable pin.

I am still confused how/ where this power is getting fed that prevents the grounded EN pin from shutting down the 3V3 regulator though. How/ what is back-feeding power and to where? Can someone help explain that?

User avatar
dg3
 
Posts: 4
Joined: Tue Dec 13, 2022 10:55 pm

Re: Switch off Feather and STEMMA peripherals??

Post by dg3 »

If I'm not mistaken, it is the SENSOR/NEOPIXEL I2C 3.3 reg that is not getting power sequenced properly, and thus this power supply is able to back-feed to the primary 3.3 reg when there enough quiescent current draw from module pullups on SDA/SCL, or in my case from indicator LEDs on SDA/SCL.

So, would another solution be to ditch the STEMA port and regulator entirely (shut it down on startup even), power my peripheral modules with the primary, EN-tied 3.3V, and use the secondary I2C bus from the header pins? Does the ESP chip eat up too much of the current headroom on the primary 3.3V?

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Switch off Feather and STEMMA peripherals??

Post by danhalbert »

I believe the second regulator was added more for control than for additional regulator headroom, but it has that secondary effect.

You mentioned you have power supplies on the 3.3V line, not the 5V line. Not sure what you mean: do you mean you regulate that down further, or you boost it up? Could you use the 5V line instead?

I think the use case of using EN to switch off all power was not as a major design consideration for the STEMMA power scheme as controlling the STEMMA power when the Espressif chip was in deep sleep, etc. Switching off power to the whole board would be easier.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”