I was testing the PCB of an electronics design (attached) when I noticed that when I put SW1 into the "OFF" position, there was still a small voltage (~1V) on U37 (MT3608 boost converter) which was boosted to about ~3V and as such my microcontroller did not turn off (I disabled brownout detection).

I did a quick test with the multimeter and it seems that there was still a closed circuit (albeit with high resistance of 7M) between the legs of the switch. I desoldered the switch to test if the switch was faulty but it was not and the PCB pads themselves still show the same resistance (not fully open circuit).

The only chip that is in "contact" with SW1 is U5 (TP4056). As such I suspect that the TP4056 is providing some path for a small amount of current through GND or via LED1 and LED2. I desoldered both LEDs and the problem persists, leading me to suspect the former. Moreover, I tested a blank PCB with no components soldered on and there is an open circuit between the 2 legs, meaning that is most definitely a component that is causing this.

Has anyone experienced something similar with TP4056? How can I modify my circuit/placement of the switch such that the load is fully turned off when the switch is opened?

A potential workaround would be to set a higher brown-out detection on the ATMEGA328P so that even with this small voltage it would not turn on.

Thank you for any advice in advance! :)Full Schematic Circuit in question

  • \$\begingroup\$ What's VFF? That has a 200 Ohm resistor connecting it to +5V \$\endgroup\$
    – Finbarr
    Apr 30, 2023 at 9:17
  • \$\begingroup\$ Actually, scrub that unless it's connected to some external source. You have BATP going directly into one of the I/O pins of your Atmega. It's probably conducting to +5V through protection diodes. \$\endgroup\$
    – Finbarr
    Apr 30, 2023 at 9:25

1 Answer 1


The battery positive is connected to MCU GPIO pin.

It will power up the MCU, via the MCU internal protection diode from that GPIO pin to VCC.

Also the USB connector ID pin is ìncorrectly connected to signal that this device is always the host.

  • \$\begingroup\$ Thanks for pointing it out. I am using an analog pin to probe the battery voltage. Didn't cross my mind that it would be able to power the MCU from there. Let me cut the trace and observe what happens. \$\endgroup\$
    – Ethan Chua
    Apr 30, 2023 at 16:19
  • \$\begingroup\$ Regarding the USB ID connection, I have always just connected it to GND because I was under the impression that the CH340G doesn't use the ID line. In any case I infer that I should leave it floating so that the computer will be the host? Thanks! \$\endgroup\$
    – Ethan Chua
    Apr 30, 2023 at 16:21
  • \$\begingroup\$ @EthanChua It's not an analog pin. It's a standard GPIO pin, which just has an option to select it for ADC measurement. The ID pin should be floating ( or an input, because it is the role of the cable to tell the device if this OTG port will be used as USB host or USB device). \$\endgroup\$
    – Justme
    Apr 30, 2023 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.