为什么不应该通过 GPIO 引脚为树莓派供电
Why a Raspberry Pi shouldn't be powered through its GPIO pins

原始链接: https://82mhz.net/posts/2026/08/why-a-raspberry-pi-shouldn-t-be-powered-through-it-s-gpio-pins/

在维修了一台旧树莓派的 Micro USB 电源接口后,作者提醒大家,应避免直接通过 GPIO 引脚为设备供电。 虽然绕过专用电源接口在技术上可行,但这会使主板失去关键保护电路,从而面临风险。官方的电源输入级包含一个用于防止过流损坏的保险丝、一个用于抵御危险电压尖峰的瞬态电压抑制器,以及用于滤除电噪声并稳定电源的电容器。 通过 GPIO 引脚供电会使这些保护措施失效,这意味着不稳定的电源可能会直接永久性损坏主板元件,而不是仅烧断可更换的保险丝。因此,作者建议用户始终使用专用电源接口。唯一的例外是,如果外部供电电路包含了同等级别的保护元件,确保主板不受电涌、噪声和短路的威胁。

这篇 Hacker News 讨论聚焦于通过树莓派的 GPIO 引脚而非指定 USB 端口供电所引发的争议。 原文主张反对通过 GPIO 供电,理由是担心缺乏保护电路。然而,评论者大多对此表示反驳,并指出了文中的技术谬误。用户解释称,树莓派使用的是自恢复保险丝(可复位 PTC 热敏电阻)而非一次性保险丝,并指出电容和保护二极管的电气功能在电力通过 USB 或 GPIO/电源引脚进入时均保持有效。 虽然有人提醒瞬态电压抑制(TVS)二极管的物理位置非常重要,但经验丰富的开发者认为,如果实施得当,通过 GPIO 供电是常见且安全的,并指出官方的 PoE 扩展板正是使用了这种方式。除技术争论外,该讨论串也反映了用户对树莓派生态系统更广泛的不满;一些用户批评了该平台相比其他更标准的单板计算机(SBC)替代品所具有的专有特性、电源方案及硬件架构。
相关文章

原文

I recently repaired the Micro USB socket of an old Raspberry Pi; the one through which the Pi receives it's power. It was a bit of a fiddly soldering job because the connections for the USB port are tiny. Because of this, I briefly considered just sending the power straight into the 5V and GND pins on the Pi's pin header. I've seen projects where a Raspberry Pi was powered through it's GPIO pins, and even ones where the Pi itself wasn't connected to a power supply at all and instead to a powered USB hub through it's normal USB ports and then the USB hub was modified to send the power back through the USB cable into the Pi. These solutions work, but they're not necessarily a good idea, and here's why.

In order to understand how the Raspi is powered, it helps to take a look at the board's schematics. This is the power input section from the Raspberry Pi 1's schematics, which is what I was working on. Newer models have slightly different components, but the functionality is the same.

Excerpt from the schematic of a Raspberry Pi 1
Power input section from the Raspberry Pi 1 schematic

If you've never seen something like this, this might not mean much to you, so let's walk through it step by step, left to right.

The first component (1) is the Micro USB socket through which the Pi is powered. It has five pins, but only two are connected: GND and VBUS. VBUS is the 5V coming through the USB cable. This is labeled as VIN after the connector, but it's the same thing. It's the Pi's input voltage.

Next in line (2) is a fuse. This will blow if the current going into the board becomes too high, which can happen if a component on the board shorts out or if something is connected to the GPIO pins which draws too much current or shorts the power rails. If that happens the board will appear dead, but the only thing that's broken is the fuse which can easily be replaced.

Then we have a transient voltage suppressor (3), which is essentially just two diodes connected in opposite directions. In normal operation these diodes don't conduct, so this component does nothing. If there is a sudden spike in the input voltage however, which can happen during a lightning strike or from a faulty power supply, these diodes will conduct and short out the voltage spike before it can reach the more sensitive components on the board.

This might seem unneccessary because we already have a fuse, but fuses take some time before they blow open, and during this time the board would receive the high voltage spike which would probably damage the chips and other components. Diodes react much quicker than fuses, so these protect against sudden or very short spikes in the input voltage.

Lastly we have a series of capacitors (4), a big electrolytic capacitor and two small ones. They serve as filters for the input voltage. Low quality power supplies might not deliver a very steady 5V but have some noise or ripple on it, which might cause glitches in the chips. The capacitors smooth out these ripples so that the other components on the board receive a clean input voltage. They also act as buffers for sudden current spikes. If a component on the board or connected to the Pi suddenly draws a large amount of current, the power supply might be too slow to supply the current quickly enough, resulting in a voltage drop. The capacitors can react quicker than the power supply and supply the high current, keeping the voltage stable.

After this the now filtered voltage goes to the 5V power rail of the board (that's the +5V0 top right) which supplies the chips, the USB ports, the GIPO pins and a few voltage regulators which step it down to lower voltages that some components require.

So now back to the original question, why shouldn't the Pi be powered by sending 5V straight through the GPIO pins into the 5V power rail? After all, it does work. But it skips all this protective circuitry that we just looked at. And so if there's a low quality or faulty power supply connected to the GPIO pins, there's a chance that it will damage the components on the board if something goes wrong, killing the Pi in the process and not just blowing the fuse like it would if it were connected to the proper power input.

So in order to avoid risking damage, a Raspberry Pi and similiar boards should always be powered through their dedicated power input.

The exception to this rule of course is if the circuit that sends power into the GPIO pins has the same type of protective circuitry on it that the original power input stage has, in which case the Pi is protected through that and powering it this way is fine.

联系我们 contact @ memedata.com