Raspberry Pi Power Supply Switch
This is an intelligent ON-OFF power supply switch for the Raspberry Pi in that it is a momentary switch with electronic latching circuitry. It is very similar to the software power switch, which enables the user to use the Sudo command to power OFF the Pi, except I am using a large pink button instead. Hence, this is a digital toggle switch or a 555 momentary switch.
My niece saw a large pink button on eBay and wanted to use it for switching the Raspberry Pi. I told her it was a momentary non-locking switch and could not be used for that purpose but she wanted it because it was large and pink and that was the end of the discussion.
It is very easy to use an electronic latching circuit to hold the state of the switch. Latching circuits are typically bi-stable memories that have been around for a long time. The very first transistor memory was a bi-stable latching circuit consisting of two transistors in a bi-stable arrangement.
The Pink Button
The pink button has a 35 mm diameter at the front and requires a panel mount hole of 25 mm diameter. The cost was £1 including postage, and my time for building the circuit was priceless. Based on a 555 momentary switch, this circuit achieves two objectives simultaneously, because my niece wanted to use the "Pink Button" and my nephew wanted to use the 555 chip for his GCSE project. This circuit consists of the power supply, which is identical to that shown in the previous articles, and an additional circuit for a soft switch. The yellow pads are where the USB socket fits, as documented in the previous sections of this article.
Latching MOSFET Switch
MOSFET Q3 performs the current switching, and the pink non-latching switch provides the trigger signal to the NE555 timer IC. With a little modification, it is possible to use a triggering signal from a GPIO instead of a switch. Since the Raspberry Pi presents itself as a load of approximately 5 V at 700 mA, I decided to use the IRFZ44N MOSFET power transistor. Their absolute maximum voltage and current rating is 55 V, and 49 A respectively, and they could be used in automotive applications to switch lights. I might use some for making landing lights for my Cessna, as it would be nice if I could phone-in to the computer and switch them on exactly when I am landing on the runway, however that is a future project.
Using a MOSFET as a switch is very simple to understand and any GCSE Technology student should be able to explain how it works. This is a three terminal device where the first pin is the gate (G), where one applies the 5 V switching signal. The second pin (middle pin) is the drain (D), which connects to the +5 V side of the rail, through a load. The third pin is the source (S) which usually connects directly to ground.
IC1: 555 Momentary Switch Circuit
I have drawn the circuit in such a way so that it is easier to translate it into a prototyping board layout. Therefore, the pinouts of the NE555 IC and the IRFZ44N MOSFET appear as they would on the actual package. The circuit above will help GCSE Technology students to see how it works.
The 10 kΩ resistors form a potential divider network and the midpoint is exactly between ground and +5 V, thus it should read 2.5 V on a meter. This midpoint provides a bias for the trigger pin 2 and the threshold pin 6.
Biasing pin 6 at 2.5 V, also known as "programming" the threshold level, means that any trigger signal above or below this level is a valid trigger signal.
A 1 µF capacitor holds a small charge, which triggers a change of state. When the switch is pressed, the charge in the capacitor rises above 2.5 V and the IC interprets this as a trigger event.
Since this is a non-locking momentary switch, it becomes open again, leaving the capacitor discharged. However, the output from pin 3 -- which will be around 5 V -- drives the gate of the MOSFET, and recharges the capacitor through the 100 kΩ resistor. The 5 V into the gate of the MOSFET causes the FET to fully switch ON in saturation and therefore the drain and source conduct providing a ground to any load connected to the USB socket.
Software Power Switch
The red pad next to the NE555 chip is one possible point where one could feed a signal from a computer to trigger a change in state. If you wish to experiment with sending a short pulse from a computer, then that might be a place to solder a header pin. You may need to use a small decoupling capacitor of 1 µF value in series. The pulse would have to be a short duration OFF-ON-OFF to trigger a change in state.
This Article Continues...
Raspberry Pi Power Supply CircuitRaspberry Pi 3.3 V Power Supply
5 V Power Supply Kit with 3.3 V
Raspberry Pi Power Supply Switch
Raspberry Pi Power Circuit Build
Raspberry Pi Power Circuit Results
Reference
5 V Voltage Regulator3.3 V Voltage Regulators
IRFZ44N