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.

개인정보 보호정책이 업데이트되었습니다. 잠시 시간을 내어 변경사항을 검토하시기 바랍니다. 동의를 클릭하면 Arrow Electronics 개인정보 보호정책 및 이용 조건에 동의하는 것입니다.

당사의 웹사이트에서는 사용자의 경험 향상과 사이트 개선을 위해 사용자의 기기에 쿠키를 저장합니다. 당사에서 사용하는 쿠키 및 쿠키 비활성화 방법에 대해 자세히 알아보십시오. 쿠키와 추적 기술은 마케팅 목적으로 사용될 수 있습니다. '동의'를 클릭하면 기기에 쿠키를 배치하고 추적 기술을 사용하는 데 동의하는 것입니다. 쿠키 및 추적 기술을 해제하는 방법에 대한 자세한 내용과 지침을 알아보려면 아래의 '자세히 알아보기'를 클릭하십시오. 쿠키 및 추적 기술 수락은 사용자의 자발적 선택이지만, 웹사이트가 제대로 작동하지 않을 수 있으며 사용자와 관련이 적은 광고가 표시될 수 있습니다. Arrow는 사용자의 개인정보를 존중합니다. 여기에서 당사의 개인정보 보호정책을 읽을 수 있습니다.