Close

Raspberry Pi On/Off circuit

A project log for Pi Chart

A wireless nautical chart plotter based on a Raspberry Pi and a sunlight readable screen.

Erland LewinErland Lewin 02/05/2016 at 15:050 Comments

I just uploaded a block diagram of the 'tablet', and a sketch of a circuit diagram for turning the Raspberry Pi power on and off.

The thing about turning the Raspberry Pi off, is that you want to do an orderly shut down, or your SD-card could be corrupted.

The circuit works as follows:

When the momentary power switch is pushed, the capacitor is charged, and the lower transistor is turned on. This turns the upper transistor on, and power is delivered to the Pi. When the power switch is released, the capacitor will start discharging through the 30k resistor.

However, when the Pi is turned on, it starts outputting 3.3V on the TxD output. This will charge the capacitor, and keep the Pi turned on.

I need to add something so the Pi can sense if the on/off switch is pushed. If it is, and the Pi is on, the Pi can start it's orderly shutdown (/sbin/shutdown -h now). When shutdown is complete, the TxD signal will go low, and the capacitor will start discharging through the 30k resistance. When it has discharged, the lower transistor will turn off, which will turn the upper transistor off, which will turn off the power to the Pi (and the video board).

Detailed component values have not been chosen yet, the above circuit was simulated in iCircuit on the iPad to get it working right. I did build it on a breadboard to test that it works.

The 20k resistor is used as a voltage divider, so that the TxD pin is not exposed to more than 3.3V. The 10k resistor is so too much current won't be drawn from the TxD pin when charging the capacitor.

I've seen other solutions, but most of them seemed overly complicated.

I have not yet decided whether to just wire this up on a perfboard, or have a PCB made.

Discussions