PowerBoost LBO read with Raspberry Pi

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
martinohanlon
 
Posts: 17
Joined: Fri Jan 08, 2016 3:17 pm

PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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.

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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.

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

Thanks for the info...

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

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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.

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

So (excusing the ridiculous drawing), a bit like this?
lbo.jpg
lbo.jpg (198.96 KiB) Viewed 1766 times

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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.

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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 1675 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 viewtopic.php?f=19&t=58281.

Any thoughts?

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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.

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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.

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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.

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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

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

Re: PowerBoost LBO read with Raspberry Pi

Post by martinohanlon »

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 1585 times

User avatar
adafruit_support_bill
 
Posts: 88954
Joined: Sat Feb 07, 2009 10:11 am

Re: PowerBoost LBO read with Raspberry Pi

Post by adafruit_support_bill »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”