I'm making a circuit te be able to shutdown my Raspberry Pi after the shutdown sequence is complete to avoid sd card corruption. The circuit looks like this:

Implemented circuit

A little explanation:

The battery input which is variable from 2,5 to 3,6V and 3V average, is controlled by the switch named KEY1. When the switch is activated, the input feeds EN and the system powers up. Because the switch output is connected to a transistor, it controls the state of the GPIO that will trigger the shutdown script once the switch goes OFF. The TX pin will feed those 3V to the EN pin keeping the Raspberry Pi on while the shutdown sequence is going and the switch has already switched OFF.

As you can see, the circuit already has some protection resistors, but my concern is: could the battery input (VIN) damage the TX GPIO pin when the switch is ON by feeding voltage into the GPIO PIN directly?

  • \$\begingroup\$ You could use a resistor-divider to lower the voltage to a gpio-acceptable level. \$\endgroup\$ – Ananas_hoi Oct 1 at 11:34
  • \$\begingroup\$ Does the "GPIO" pin have the pull-down resistor feature enabled? Otherwise it could be floating and register as anything. \$\endgroup\$ – rdtsc Oct 1 at 12:18
  • \$\begingroup\$ Research your particular chip's datasheet. What does it say for absolute maximum input (voltage, current) on EN pin? \$\endgroup\$ – rdtsc Oct 1 at 12:19
  • \$\begingroup\$ The EN input can go from 0 to 26V, so that is not a problem in terms of maximum input. The TX GPIO outputs 3V which is really similar to the battery voltage that feeds EN to enable the power boost.The TX GPIO acts as a EN power backup so the raspebrry pi can execute the shutdown commands after the switch is OFF before cutting the power. What I'm worried about is connecting the battery to the TX gpio together, and yes, the used GPIO have all internal pull down resistors and can be enabled or disabled via software (they are enabled by default I think but I enable them via software just in case). \$\endgroup\$ – Electrical Voyager Oct 1 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.