How to Use a Low Power MOSFET for Raspberry Pi Power Cycling

发布人是

We previously explored powering a Raspberry Pi via solar energy, as well as how such a system can be cycled on and off with a relay to conserve electricity. While this can result in substantial power savings — especially when there’s a long time between actions that the Pi needs to take — one drawback is that just holding the relay on requires around 70mA, compared to the Pi itself, which runs at roughly 130mA. The system also consumes around 5mA when off — more than you’d expect from just the power-efficient ATtiny85 “sleep coprocessor” alone.

MOSFET for Power Efficiency

Is there a better solution? While it’s hard to beat the simple operation of a magnetically operated switch — i.e. a relay — using a solid-state device like a low power MOSFET transistor can allow you to cut your usage even further.

To test this, I chose an FQP30N0L MOSFET. This particular component has a maximum gate threshold voltage of 2.5V, making it fully switchable via an Arduino, ATtiny85 or other such devices. The drain-source breakdown voltage is a minimum of 60V, and it can handle a continuous current draw of 22.6A, both well above the needs of the Pi Zero W (or any Pi, for that matter). Despite this excellent performance, they’re still available, as of this writing, meaning a substantial cost savings over the relay module used previously.

MOSFET Switch

Low Power MOSFET for Raspberry Pi Image 2

To control power with this MOSFET, the path to ground is switched on and off, not the positive line (as was the case with the relay implementation). Here, the USB positive going to the Pi is connected to the 5V bus, while the negative connects to the MOSFET’s gate pin. The MOSFET source is connected to the ground bus, while the gate is connected to the ATtiny85’s output pin.

Results

This new setup resulted in significant power savings when compared to using a relay:

·      136 mA total current draw with Pi Zero W on, including extra LED

·      2.75 mA with Pi off

·      Savings over Pi/Relay on (200mA) condition: 64mA

This comes out to a roughly 32 percent drop in power (when on) over the relay setup, and around a 2mA — or 40 percent — drop when off. Regardless of how long your Pi’s power cycle is, this represents a huge increase in performance. For low-power applications, it pays to consider your switching hardware. Otherwise you’ll have to pay in the form of a larger solar panel and/or battery equipment.

Power Cycle Code

Low Power MOSFET for Raspberry Pi Image 1

I used the same code as in the earlier experiment, but when testing over several hours, I found that the ATtiny85 eventually stopped cycling properly. It’s possible there was an issue with the long delay() function, so the new code instead uses millis()for timing. Using millis() is generally considered good programming practice, though it does roll over after about 50 days. This may or may not be an issue, but should be considered for projects with an extremely long time span.

Raspberry Pi code, as well as both versions of the ATtiny85 shutdown code are available here on GitHub. Note that application of current measurement equipment during testing resulted in a small voltage drop. A 2200µF capacitor was applied during evaluation to help compensate.

Overstock AV Page Footer 560x140 2 1 1

最新消息

Sorry, your filter selection returned no results.

请仔细阅读我们近期更改的隐私政策。当按下确认键时,您已了解并同意艾睿电子的隐私政策和用户协议。

本网站需使用cookies以改善用户您的体验并进一步改进我们的网站。此处阅读了解关于网站cookies的使用以及如何禁用cookies。网页cookies和追踪功能或許用于市场分析。当您按下同意按钮,您已经了解并同意在您的设备上接受cookies,并给予网站追踪权限。更多关于如何取消网站cookies及追踪的信息,请点击下方“阅读更多”。尽管同意启用cookies追踪与否取决用户意愿,取消网页cookies及追踪可能导致网站运作或显示异常,亦或导致相关推荐广告减少。

我们尊重您的隐私。请在此阅读我们的隐私政策。