USE DISCOUNT CODEEXPERT30TO SAVE $30 USD
ESP32 restarts when I connect my 12V sensor on a custom board
Martin Avorgah , 10-27-2025, 04:09 PM
Hi @Robert Feranec I have an ESP32-based NPK sensor device. I have been able to get it to work as intended, but every time I connect the 12V sensor while the device is on, the ESP32 restarts. Aside from that, everything works fine. I want to figure out the solution before the next board order. I have added the schematic images to help understand my problem. I would be glad to get some feedback on this. I am using an MCP73871 power path LiPo charger. The output from the PMIC feeds into the 3.3V buck converter and 12V boost converter. I suspect the issue could be the sensor drawing too much power, but the sensor is rated 4-20mA. I have a feeling it is because of some missing decoupling capacitors.
QDrives , 10-28-2025, 04:23 AM
4-20mA is just the current for the signal, not what the sensor consumes.What is the type of the 22uF capacitors you have?How long is your USB cable?What if you add a >=220uF aluminium or tantalum capacitor to V_Out?Probably the sensor also has a large input capacitance and that drains all the capacitance you have on your board.The MT3608 is a 2A regulator so the current limit from the MCP74871 kicks in. That 2A is at 12V and the MCP limits the 5V [2 * 12 / (5 * n)] and n being something like 80%. So something like 6A drawn from the 5V!You could check to connect the power good pin of the MCP to the enable of the MT3608 with a pull-up from V_Out.
Martin Avorgah , 10-28-2025, 09:07 AM
22uF are ceramic capacitorsIt is a standard 1m USB cable, but inside the enclosure, I am using an Adafruit USB-C to JSTI will try adding a 220uF to V_outI don't quite understand the second part of your response. Do you mean the MT3608 is drawing too much current from the MCP73871?Why connect the power good to the enable of the MT3608?The power good of the MCP73871 is an open-drain signal to indicate that a valid connector is plugged in.
QDrives , 10-28-2025, 05:08 PM
Ceramic capacitor, but voltage rating? DC bias? AC bias? X7R, X5R, Y5V or other?Yes, the MT3608 can draw large currents as the output is rated 2A (@12V) = 24W.Hmm, yes the PG is no good 😉 Then perhaps add a load load distribution switch with adjustable current limit (between U3 and U6) : https://www.digikey.nl/en/products/filter/power-management-pmic/power-distribution-switches-load-drivers/726?s=N4IgjCBcoGwJxVAYygMwIYBsDOBTANCAPZQDaIALAAxwUDMVIh1cdrIAuoQA4AuUIAMq8ATgEsAdgHMQAX0IAOAOyIQKSBhwFiZEGxgwArJx79IQ0ZJnyQAJkPHoatFjyESkcnUMUFdBUx6PkowEITeFEoOJiB8AsLi0nKEYAqpquqabjqeIFFKShRhet5whnSBUfTwgTAKBkoIhEp0MLZgTXkdYAaBdKXR4QMwgRRjtq2VYGClfQMqirYw-Z1KYLa2cJ39hmUBQ7u7c7swjAdwoYEKFPaDJSe2lVRgRQsgdfbTxxcV5zAU3yMlQYCmugJGXFiZgsiWshAAtI8nOpRABXbQecidYwcGzwirIqBojG6MCMXEIhCEyDE9ykziyGwjJxiAAmAnhZOKcXMgQAjrwAJ4CMlnEBC7i4ATobAoRlAA
Martin Avorgah , 10-28-2025, 08:14 PM
22uf - 25V X5R 10%10uf - 50V X5R 10%0.1uf - 50v X7R 10%1uf - 50V X7R 10%4.7uf - 50V X7R 10%I think they are DC-biased, I'm not very sure.I connected a 220 μF electrolytic capacitor to the V_out of the MCP73871, as well as the input and output of the MT3608 and also the output of the AP63203. It stops restarting when the sensor is connected. I am yet to hook it up to a scope to look for any problems I don't see. The MCP73871 is a bit expensive, so I am switching to BQ24074.
QDrives , 10-29-2025, 12:47 AM
Well I am very sure that your capacitors have a lot of DC bias losses. I would not be surprised if the 22uF on the 12V is > 70% (loss!)
Martin Avorgah , 10-29-2025, 06:20 AM
How can I reduce those loses
Use our interactive
Discord forum to reply or ask new questions.