Auto Pi shutdown when low battery voltage

My project is powered by 2 Lipo 18650 batteries via an Adafruit PowerBoost 1000C regulator, and I’d like an automatic Pi shut down when the low battery LED flashes. I am currently using the script from your tutorial for button shutdown; “How to Make a Safe Shutdown Button for Raspberry Pi”.
My Adafruit Powerboost 1000 regulator specs state: " LBO - … this is the Low Battery Output. By default it is pulled high to BAT but when the charger detects a low voltage (under 3.2V) the pin will drop down to 0V. You can use this to signal when its time to shut down or alert the user that the battery is low. There is also a red LED connected to this pin."
Could you please explain how to use the output from Adafruit’s LBO pin to shut down my Pi (without causing damage), and whether this output could also be connected to the same GPIO pin 26 used in your tutorial?

You can use the same GPIO pins and the LBO output but you’ll need a logic level converter to take the higher battery voltage (up to 4.3v) from the LBO pin on the Powerboost 1000 to the 3.3v Raspberry Pi GPIO pins.

The circuit in “How to Make a Safe Shutdown Button for Raspberry Pi” pulls pin 26 low which is exactly what the LBO output does. You can put the low voltage (3.3v) side of the logic level converter in parallel with your switch.

Either of these two logic level converters from Core-Electronics will work:

There’s instructions on how logic level cnverters work here:

This circuit should get you going:

Good luck!

Note : I don’t work for Core-Electronics. I’m just another forum member.

Shaun

2 Likes

Thanks for the thorough advice Shaun, I was thinking of simply using 2 resistors per the diagram at https://www.element14.com/community/thread/63677/l/powerboost-low-battery-output-to-safely-shutdown-raspberry-pi?displayFullThread=true , but that thread appeared inconclusive.
Richard

It is possible to use just two resistors but you should really force logic circuits full-on or full-off. For the couple of dollars a logic level converter costs you may as well use one and you wont have to worry about trying to calculate resistor values.

1 Like

Agree with Shaun. I have used the Sparkfun level converter boards and they work great. Rapsberry Pi to Arduino and Arduino to 433MHz RF transceiver module. I did use a resistor divider between a Blue tooth transceiver and Arduino, it worked too. Given the LBO circuit the level converter is the best option and fairly cheap.

Note: Also just a forum member and customer of Core Electronics, NOT an employee.

Cheers
Jim

EDIT: The following link discusses the GPIO ports of the Raspberry Pi and how they should be interfaced for long term reliable operation.

http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications

1 Like

Thanks Jim