Watch video: https://youtu.be/BINHFtPJi7o
As Raspberry Pies are increasingly being used as desktop computers, there is a growing number of issues that will have to be addressed in the future models, but I'm not willing to wait that long. Power on management is crucial for providing computer safety and preventing excessive wear.
Though Dialog D A 9091 Power Management chip adds a power on button to Raspberry Pi 5, classics PC's like settings for it seem to be missing. Raspberry Pi 5 always turns on after a power outage regardless of its previous power state. This is certainly not preferable, if you are planning for a long vacation.
Another setback observed by many users is that Raspberry Pi 4 and 5 do not power off completely when instructed to do so by a shutdown or a power-off command. A 3.3-volt power rail on 40-pin expansion connector remains powered. If you are using an audio hat with a substantial power consumption, disconnecting the power supply from the electric grid may still be a better option. Interestingly, the 3.3-volt rail is turned off, if the computer is shut down by holding an inbuilt or an external power button. I never the less prefer the shutdown command to avoid any possible data loss.
I've therefore designed Remote Power On Management Hat with e-Lock that also prevents Raspberry Pi 5's unauthorized use, similarly to Google's Family Link. The hat is based on AI Thinker's E S P 32 camera module and it is mounted sideways not to obstruct Raspberry Pi 5's cooling. Extended functionalities include: a remote power on and power off, an electronic lock, a scheduled power on and power off, a correction of 3.3-volt power rail operation and a L E D indicator of power on state transition.
The hat also supports Omni Vision O V 2640 digital camera which may be occasionally used to survey a room, where Raspberry Pi 5 is located. We'll discuss the camera functionality and a software support for it in the forthcoming videos. In this video, we are rather focusing on the hat's basic functionalities without a digital camera attached.
E S P 32 camera module has dual 8-pin headers from each side that provide power and control signals. An inbuilt 3.3-volt regulator enables the module to be powered from Raspberry Pi 5's 5-volt power rail, which is directly connected to the external power supply and it is not depending on Raspberry Pi 5's internal power states.
Is Remote Power On Management Hat easy to build? E S P 32 camera module may be connected to Raspberry Pi 5's 40-pin expansion connector with jumper wires only. But it also requires a voltage reduction circuit with at last two resistors to reduce a 5-volt USB voltage sense signal to a 3.3-volt signal suitable to be fed to an E S P 32 digital input.
I had no jumper cables at hand, so I've used a prototyping printed circuit board instead. A relatively tin cable strip forced me to use three wires for the ground and another three for the power supply. The rest are used for data and control signals. I've also used an electrolyte capacitor increase power supply stability.
If you are going to use jumper wires instead, the power jumper wires must be tick enough for E S P 32 camera module to be able to power and maintain its Wi-Fi connection. I've made several tests with in sufficient powering, which resulted in the Wi-Fi connection poor performance and unreliability.
I've also placed some protective resistors on the signal lines to protect against firmware errors during development phase. However, I believe that they may be omitted for a regular use. But I've not tested such a design, yet. You may also solder resistors to jumper wires.
How does it work? E S P 32 camera module controls Raspberry Pi 5's power state through the external power button pin. Watch video Raspberry Pi 5 External Button to see how to add an external button header. E S P 32 camera module also has two voltage sense pins for the 3.3-volt rail voltage sense and the USB voltage sense. Raspberry Pi 5 powers off its USB ports during all shut down power states and it is an indication, when the 3.3-volt rail should be powered off, too. If the rail is not powered off automatically E S P 32 camera module turns it off by holding the power button signal low until the rail powers off.
I've designed a short USB 2.0 pass-through dongle that provides the USB voltage indication to E S P 32 camera module. However, E S P 32 module has no 5-volt tolerant inputs and it needs a voltage reduction circuit to receive the signal. I've made the 2-thirds voltage reduction circuit from three miniatures 4.7 kilo ohms' resistors.
How about programming? E S P 32 camera module comes with a preinstalled camera firmware, which has to be replaced with an open-source power on management application. Raspberry Pi 5 has an inbuilt serial port named T T Y A M A zero that is available on the expansion connector pins 8 and 10. Pin 8 carries transmitted data and pin 10 carries received data. A parameter setup must be added to end of the Raspberry pi 5 firmware configuration file to enable the serial port functionality: D T parameter equals U art zero equals on.
The rest is easy! Install Arduino integrated development environment and add E S P 32 support as shown in the video. Open Serial Monitor from Tools menu and run a predefined program dot S H script from a command window while pressing the reset button on E S P 32 module. Release the reset button and wait until the module enters programming mode. When in programming mode, E S P 32 module should be easily programmable from Raspberry Pi 5's Arduino Integrated Development Environment. Just click the green encircled right arrow to compile and upload the program to E S P 32 module. Next, go to the command window run script run dot S H to restart E S P 32 module in normal mode. Power On Manager is now ready! You can test it by pressing and holding power on button for about 3 seconds until Remote Power On Management Hat L E D lights up. Raspberry Pi will shut down afterwards.
Next, we are going to test a power on remote functionality. Use a smart phone or another Wi-Fi capable device to connect to Remote Power On Management Hat access point named R P I Power Manager. Once connected, you will need a telnet application to communicate to the module. Press plus to start Raspberry Pi 5 remotely. Press minus to turn off Raspberry Pi and question mark to monitor Raspberry Pi 5 Remote Power On Manager with e-Lock status.
e-Lock is triggered each time Raspberry Pi 5 is turned off remotely. If one tries to power it on with the power on button, the control L E D would lite as the button is pressed and will go off immediately after it is released. But Raspberry Pi 5 would only boot, if it is started remotely from a Wi-Fi device. It will again boot after pressing the power on button, until it is turned off with a Wi-Fi device.
https://sites.google.com/site/pcusbprojects
Watch video: https://youtu.be/BINHFtPJi7o
Comments