Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PowerBoost LBO read with Raspberry Pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PowerBoost LBO read with Raspberry Pi

by martinohanlon on Wed Jan 13, 2016 6:20 pm

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

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Wed Jan 13, 2016 6:50 pm

According to https://www.raspberrypi.org/forums/viewtopic.php?f=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.

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Wed Jan 13, 2016 6:57 pm

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.

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Wed Jan 13, 2016 7:10 pm

Thanks for the info...

What do you mean by clamp the voltage? How would I go about doing that?

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Wed Jan 13, 2016 7:13 pm

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.

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Wed Jan 13, 2016 7:27 pm

So (excusing the ridiculous drawing), a bit like this?

lbo.jpg
lbo.jpg (198.96 KiB) Viewed 1491 times

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Wed Jan 13, 2016 7:32 pm

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.

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Fri Jan 15, 2016 5:05 pm

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.

lbo_transistor.jpg
lbo_transistor.jpg (12.99 KiB) Viewed 1400 times


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 https://forums.adafruit.com/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

by martinohanlon on Fri Jan 15, 2016 5:15 pm

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.

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Fri Jan 15, 2016 5:23 pm

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

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Fri Jan 15, 2016 6:53 pm

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.

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Fri Jan 15, 2016 7:00 pm

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.

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Sat Jan 16, 2016 6:16 am

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

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

by martinohanlon on Sun Jan 17, 2016 11:49 am

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!

IMG_20160117_154336732.jpg
IMG_20160117_154336732.jpg (374.88 KiB) Viewed 1310 times

martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

Re: PowerBoost LBO read with Raspberry Pi

by adafruit_support_bill on Sun Jan 17, 2016 12:04 pm

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.

adafruit_support_bill
 
Posts: 78960
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.