Raspberry Pi Power Controller Adds Shutdown And Startup Functionality

This breadboarded circuit uses a PIC chip to control the Raspberry Pi’s power supply. We first noticed this gap in the RPi features when we built an XBMC setup around the RPi board. It’s not the end of the world, but since installing the Raspberry Pi we have been unplugging it after each use. [Kevin Sangeelee’s] circuit could be the path to automating this process.

This is not really aimed at media applications. The PIC circuit does switch power to the RPi, but the goal was to add a push-button to do so. Other goals of the project include scheduled shutdown and data logging of brownout events on the power rail. As you can see, there’s a coin cell in the mix which keeps time when the system is in power down. The RPi communicates with the PIC via i2c. This facilitates full power-down using the Linux command ‘shudown -h’, as well as the ability to schedule a restart time.

Adding an IR receiver and tweaking the PIC code are all it would take to trigger the power controller from the couch.

[Thanks Donn]

22 thoughts on “Raspberry Pi Power Controller Adds Shutdown And Startup Functionality

      1. Yes, but I meant with this. They mention that there would need to be some kind of extra hardware modification, but if you already have remote input there’s no need to make it hardware based.

  1. NO no no no no no no!
    For the sake of other devices that might be powered from the same supply, please don’t switch the ground, switch the VCC!!!!
    Also, is your PIC running at 3.3V? The MOS you used has a threshold level as high as 4V, which means it is not good for this.
    Here is a good one:IRF7204. It’s a PMOS so you can swith the VCC with a threshold of max 2.5V.

    Other than this: the pi really would need some sort of zero current off, it reminds me of old computers with win95 that showed a message that it was safe to turn off.

    I thought about doing a power off circuit for the PI:a simple RS filp flop. S is connected to a button, you push it to turn on the PI. Reset is connected to a PI pin with a small rc for delay. Last command on the PI is to trigger the reset of the flip flop.

    1. It is a bit laggy, depending on SD card and distro, Raspbmc is quite good but i find OpenElec a little bit more fluid. As for 720 and 1080 content, takes a couple of seconds to start one but once on, it’s flawless.
      It did occur lag when i had the 1080 content on network and server under heavy load.

    2. The latest Raspbmc release run great. Little to no lag at all. If you are on your existing install go to Settings > System > Video > Always enable vsync. The interface runs much smoother.

  2. Overkill! 128KB flash? How many pins? You could do something like this with an ATtiny85 or less.

    Also sounds like the sort of thing Dallas/Maxim would have a chip for. Are they still open for abuse of their free samples?

    1. I wish to remind you that there is very little difference in prices for the larger chip, and it allows for expansion of the project later. Sure, the price may be around double, but that’s nothing when the chips never peak $5.

  3. Would it not be easier and more cost effective to use a simple push button (on-off) and a cut usb cable to control the power than this ? PICs are awesome but come on! Even if you use a tiny pic at like $0.20USD you still need a PCB if not you are going to need to dead bug it only after programming it… Way to funky for me.

  4. Man. You people always beat me to it… I wanted to do this myself, but haven’t had time to.
    I wanted to use a smallish PIC 16(L)F1503 and an MCP79410 RTC (has alarms too, so it can wake up the Pi). The PIC runs at 5V and switches an IRF7103 and I added an additional MCP1703-3.3 for more 3.3V current. Everything communicates via I²C. The PIC has some I/O pins left over, which gives you the possibility to add more input/outputs/pwms to the circuit, controllable from the Pi via I²C.
    Another nice thing would be to have an LIRC transmitter circuit, but I couldn’t find a good way to notify the Pi when commands arrive other than using another pin as an interrupt pin…
    Anyway. Here’s the raw sketch of my circuit: http://s14.postimage.org/8blk29ib5/pipoboard.png

    If anyone finishes a good version, please kickstart(er) it, so I can buy it, mkay?! ;)

  5. I use a heavily discounted Xmas tree light wireless switched outlet. I can powercycle the pi via remote and keep the cords hidden from the Cat of DOOM. Micro b connectors are not as durable as they could be so not unplugging that power cable will extend the life of the pi.

Leave a Reply to BogdanCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.