Im looking for some advice...
How can I read the value of the powerboost LBO (low battery output) with a Raspberry Pi. As I understand it, when the battery level is 'ok', the LBO pin is pulled high to the voltage of the BAT (LIPO), so anywhere between 3.0v and 4.2v, when the battery voltage is running low (less than 3.2v) it is pulled LOW to ground.
Using an appropriate resistor could I pull the 4.2v down to 3.3v and connect this to the GPIO pin on the Pi, but as the battery runs down to 3.2v, how is the Pi going to read that?
This is where my electronics knowledge runs out. It seems like I should be (somehow) comparing the voltages between BAT and LBO, where they are equal, the battery is ok, when there is a difference the battery is running low.
Any advice, comments, thoughts, words of wisdom?
Mart
PowerBoost LBO read with Raspberry Pi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
According to https://www.raspberrypi.org/forums/view ... 44&t=55039
The GPIO maximum low level voltage is 0.8v and minimum high level voltage is 1.3v so perhaps dropping the voltage from the LBO from 4.2 to 3.3 is an option and at 3.2 it would still be over the 1.3v to trigger a HIGH.
The GPIO maximum low level voltage is 0.8v and minimum high level voltage is 1.3v so perhaps dropping the voltage from the LBO from 4.2 to 3.3 is an option and at 3.2 it would still be over the 1.3v to trigger a HIGH.
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
A better alternative is to clamp the voltage to a safe level at the pin with a blue LED. These have a Vf of about 3.4v, so the voltage at the pin won't go any higher. But when the battery voltage drops below the Vf of the diode, the voltage at the pin will follow.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
Thanks for the info...
What do you mean by clamp the voltage? How would I go about doing that?
What do you mean by clamp the voltage? How would I go about doing that?
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
Wire the led between the GPIO in and ground. Then connect the GPIO pin to the LBO pin. If the voltage exceeds 3.4v, current will flow through the LED (limited by the existing resistor in the LBO circuit). This will 'clamp' the voltage to 3.4v or lower.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
So (excusing the ridiculous drawing), a bit like this?
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
Sort-of. Except that you will need to supply your own blue (white will work also) LED.
The LED you have indicated on the diagram is already tied to 5v and connecting as shown will certainly damage the Pi GPIO.
The LED you have indicated on the diagram is already tied to 5v and connecting as shown will certainly damage the Pi GPIO.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
So, rather than putting an LED in the circuit to clamp the voltage, I decided to see if I could use a transistor as a switch to turn the GPIO pin to ground depending on whether there is a voltage present on the LBO pin.
This works perfectly but as soon as I connect the LBO pin up the red led on the board lights up stating that the battery needs charging. The same behaviour is seen regardless of whether the powerbooster is plugged in.
There seemed to be a similar post relating to the powerboost 500 product viewtopic.php?f=19&t=58281.
Any thoughts?
This works perfectly but as soon as I connect the LBO pin up the red led on the board lights up stating that the battery needs charging. The same behaviour is seen regardless of whether the powerbooster is plugged in.
There seemed to be a similar post relating to the powerboost 500 product viewtopic.php?f=19&t=58281.
Any thoughts?
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
As an experiment I connected the LBO pin (via a suitably sized resistor) to a GPIO pin (pulled down) and it had the same effect of turning on the red led on the power booster board.
The red led also lights up if I connect the LBO to GND.
The red led also lights up if I connect the LBO to GND.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
I dont know if this is important, but the information says that LBO should be pulled high to BAT. When I test the voltage there is a pretty significant difference BAT = 3.6v LBO = 3.35v
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
If you look at the schematic, the LBO is pulled up to VBAT. The circuit alternatives you are trying to use, all pull it back down to some extent.
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
I was just looking at the schematic myself and conclude the same thing. So is it possible to read the value from LBO without the red LED coming on? If not, I will just ignore it.
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
The chip specs don't say so explicitly, but if that pin is being used for general battery level sensing, then anything that alters the voltage on that pin directly will affect the charge cycle.
A level shifter might be the best choice: https://www.adafruit.com/products/735
A level shifter might be the best choice: https://www.adafruit.com/products/735
- martinohanlon
- Posts: 17
- Joined: Fri Jan 08, 2016 3:17 pm
Re: PowerBoost LBO read with Raspberry Pi
This just gets stranger.
So I let the battery run down so I can test LBO going to GND.
When I test the voltage between ground and LBO, expecting it to be zero as according to the spec LBO should be pulled to ground, I get a measurement of 0.33v!
So I let the battery run down so I can test LBO going to GND.
When I test the voltage between ground and LBO, expecting it to be zero as according to the spec LBO should be pulled to ground, I get a measurement of 0.33v!
- adafruit_support_bill
- Posts: 88954
- Joined: Sat Feb 07, 2009 10:11 am
Re: PowerBoost LBO read with Raspberry Pi
There is always some voltage drop through a BJT or MOSFET. It will never be zero. 0.33v will register as logic LOW on most any 2.2v or 5v microprocessors.
Please be positive and constructive with your questions and comments.