![]() ![]() The script is launched at startup using a systemd service. Adding the Voltage, Current, and Power MonitoringĪ Python script is used to collect the voltage and current and track power used. Pressing the pushbutton between ground and pin GPIO24 should shut down the Raspberry Pi. ![]() # input pin to start the shut down sequence dtoverlay=gpio-shutdown,gpio_pin= 24,active_low= 1,gpio_pull=up # output pin to enable power source dtoverlay=gpio-power off,gpiopin= 26,active_low= 1 Test the Raspberry Pi Startup and Shutdownīy pressing the pushbutton attached to the Shutdown Interface board, the Raspberry PI should start up. This can be done by adding the below two lines to the /boot/config.txt file on the Rasperry Pi. Also, configure gpio pin 26 as an output to provide a power-off signal to the buck controller. We want to configure gpio pin 24 as an input pin that when grounded, will start the shutdown. Updating the Raspberry Pi config.txt file This resistor can be carefully removed with the tip of a soldering iron This is needed to allow power to be off by default.See the image below. The next modification is to remove the pull-up resistor on the enable pin on the board. After this modification you check the voltage with a meter to guarantee its in the range of 4.95 to 5.2 so that it does not cause problems with the Raspberry Pi. This can be done by following the directions for the converter and cutting the proper trace and bridging the pads for 5V output with some solder. The first is to set it to an output voltage of 5V. There are two modifications to make on the buck converter. MP2315 Adjustable Buck Converter Modifications The same process occurs if the user requests shutdown from the command line. The RPI has a different pushbutton on another GPIO pin to trigger shutdown request. The buck converter shuts down and the RPI is no longer receiving power. This pulls down the enable on the buck converter, and it stops producing 5V on it's output, reducing the latch voltage. ![]() When the RPI has an internal request to be shut down, it does a safe shutdown and at the end of that process it pulls the GPIO pin low. The 10K resistor R2 ensures the current driven into the GPIO pin stays low enough to not damage the pin - needed because P4 could be as high as ~5.6 volts. While the RPI is powered up it keeps the GPIO pin high (3.3v). The RPI is attached at JP2 with pin 2 being a GPIO pin. In this process Zener Diode D1 keeps the voltage on P4 below 5.6 volts. This keeps the buck converter enabled keeping power supplied to the RPI even after the push button is let go. The 5V passes through R1 and the Diode D2 and latches the Enable pin of the buck converter high. When the push button is pressed, 12v is supplied through the 330K resistor R4 to the Enable pin of the buck converter, which begins to turn on and supply 5V power on pin P3 and power to the Raspberry Pi (RPI), which starts up. The buck converter board is attached at J1 with P4 as the Enable pin of the buck converter. INA226 Bi-Directional Current and Power Monitor Also, the I2C interface is used to communicate with the INA226 (GPIO pin 02 and GPIO pin 03). Another as output to disable the buck converter (GPIO pin 26). One as input for a pushbutton switch to trigger safe shut down of the Pi (GPIO pin 24). The other breakout board is the INA226 Two GPIO pins are used on the Rasberry PI. A breakout board with the MP2315 buck converter is used to step down the voltage to 5 volts and introduces an enable input. This project uses 2 commonly found breakout boards and one custom board to handle startup and shutdown.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |