Device hang when switch power supply

kishan patel
Posts: 45
Joined: Wed Aug 30, 2017 4:56 am

Device hang when switch power supply

Postby kishan patel » Wed Apr 25, 2018 11:43 am

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.

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Device hang when switch power supply

Postby ESP_Sprite » Thu Apr 26, 2018 2:33 am

How exactly do you switch power supplies?

kishan patel
Posts: 45
Joined: Wed Aug 30, 2017 4:56 am

Re: Device hang when switch power supply

Postby kishan patel » Thu Apr 26, 2018 5:00 am

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.

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Device hang when switch power supply

Postby ESP_Sprite » Thu Apr 26, 2018 7:17 am

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.

kishan patel
Posts: 45
Joined: Wed Aug 30, 2017 4:56 am

Re: Device hang when switch power supply

Postby kishan patel » Thu Apr 26, 2018 7:29 am

Hello,
Yeah sure.I have attached schematic image of power supply.
Thanks.
Capture.PNG
Capture.PNG (67.76 KiB) Viewed 12346 times

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Device hang when switch power supply

Postby ESP_Sprite » Fri Apr 27, 2018 2:49 am

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.

kishan patel
Posts: 45
Joined: Wed Aug 30, 2017 4:56 am

Re: Device hang when switch power supply

Postby kishan patel » Fri Apr 27, 2018 12:41 pm

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.

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Device hang when switch power supply

Postby ESP_Sprite » Sat Apr 28, 2018 4:05 am

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.

abhijeet
Posts: 2
Joined: Sun Apr 29, 2018 12:44 pm

Re: Device hang when switch power supply

Postby abhijeet » Sun Apr 29, 2018 1:07 pm

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

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Device hang when switch power supply

Postby ESP_Sprite » Mon Apr 30, 2018 3:08 am

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.

Who is online

Users browsing this forum: Google [Bot] and 25 guests