Page 1 of 2

Device hang when switch power supply

Posted: Wed Apr 25, 2018 11:43 am
by kishan patel
Hello,
Actually,i am using 2 type power sources with esp-wrrom32 module.
One is 12 volt dc supply and another is 3.7 volt(back_up battery purpose).
Problem which i have facing is that when i try to switch power supply,sometimes device will detect Brownout and reset,then start application as it is.But sometimes device has hang_up.
So,what should be reason behind this.If any one can guide me,its great for me.

Thanks in advance.
Regards,
Kishan Patel.

Re: Device hang when switch power supply

Posted: Thu Apr 26, 2018 2:33 am
by ESP_Sprite
How exactly do you switch power supplies?

Re: Device hang when switch power supply

Posted: Thu Apr 26, 2018 5:00 am
by kishan patel
Hello,
I have used MOSFET.When i remove 12 volt,device has hangup.If i again give 12 volt when device has working on backup battery,there is no issue.But when remove 12 volt,sometimes Brownout reset occur and sometimes device has hang.

Thanks.

Re: Device hang when switch power supply

Posted: Thu Apr 26, 2018 7:17 am
by ESP_Sprite
Do you have a schematic? I'm asking because your way of switching may leave the esp32 out of power for a fraction of a second.

Re: Device hang when switch power supply

Posted: Thu Apr 26, 2018 7:29 am
by kishan patel
Hello,
Yeah sure.I have attached schematic image of power supply.
Thanks.
Capture.PNG
Capture.PNG (67.76 KiB) Viewed 12052 times

Re: Device hang when switch power supply

Posted: Fri Apr 27, 2018 2:49 am
by ESP_Sprite
That's what I thought. Your issue most likely is that when you remove the 12V, your 4.2V doesn't immediately collapse to zero; instead, it goes down slowly. This means that Q2 won't switch supplies instantaneously, but only when the voltage is Vbat minus its gate threshold voltage. You didn't specify what mosfet you use, but let's say you're using a logic-level mosfet with a gate threshold of 1.5V: this means that you'll only switch over to battery power when the 4.2V line is 1.5V under the Vbat level. With a 'normal' Vbat of 3.7V, this means the 4.2V rail node will drop to (3.7-1.5=)2.2V before switching over. Add to that the drop of D1 as well, which is give-or-take 0.4V, and your poor ESP32 only gets 1.8V (minus whatever the 3.3V regulator eats up) to live off.

The hacky way to solve this would be to just increase C24 so it doesn't drain during the switchover. The non-hacky way would probably either mean adding some logic so Q2 switches sooner, or maybe getting rid of it entirely so only D1/D2 are responsible for the switchover. If you go for the 2nd solution, I'd also advise setting U4 to output more than 4.2V (make it 5V or so) so you don't accidentally have a full battery sourcing current when the 12V supply is still plugged in.

Re: Device hang when switch power supply

Posted: Fri Apr 27, 2018 12:41 pm
by kishan patel
Thanks,
We have using CPH6341 MOSFET. We have tried as you told(remove MOSFET circuit) then check the process.But our TLV chip has blown-out.

Regards,
Kishan Patel.

Re: Device hang when switch power supply

Posted: Sat Apr 28, 2018 4:05 am
by ESP_Sprite
Yeah, that mosfet has a gate threshold voltage of about 2V, so the scenario I sketched is probably what happened. I don't get how removing that mosfet (and connecting the pads of its source and drain, if that wasn't obvious) would kill the TLV, though... there's no voltage on either side of the mosfet that can kill that chip.

Re: Device hang when switch power supply

Posted: Sun Apr 29, 2018 1:07 pm
by abhijeet
Hello

I am having some question related to this problem of esp wroom 32 hang.If i go with solution :-

1)Will the problem of device hang will be solved if c24 value is increased to 47uf or any other if any suggestion for value.
2) Please can you suggest any logic so Q2 switches sooner to solve this problem.

Accepting favorable reply.


Thanks and Regards
Abhijeet Gupte

Re: Device hang when switch power supply

Posted: Mon Apr 30, 2018 3:08 am
by ESP_Sprite
abhijeet wrote: 1)Will the problem of device hang will be solved if c24 value is increased to 47uf or any other if any suggestion for value.
Dunno. I can probably calculate a value, but I'd say it's easier and less error-prone to look up the minimum working voltage for your TLV chip, taking a prototype and a scope, change the ESP32 for a resistor that burns up 500mA (to simulate the worst-case scenario) and just solder on various capacitance values until the value on the input stays comfortably above the minimum working voltage.
2) Please can you suggest any logic so Q2 switches sooner to solve this problem.
As I said: just remove it (and short the source and drain pads) and increase your 4.2V output to something higher. I honestly can't see why that would destroy your TLV; if it did last time I'd say it may have been an artifact of reworking the prototype, not the schematic change.