I am using USB / DC / Solar Lithium Ion/Polymer charger - v2 to charge LiPo battery that will power a micro controller.
I want to be able to have the micro controller monitor the charging so that it can alert the user if there's too little sun for charging and it will result in low battery.
Ideally, I would also like to use this to dynamically adjust the operations of the micro controller. If we aren't charging, I may limit or eliminate high-power functionality.
When I attempt to monitor the charge/done led outputs from the board, I noticed that power seems to be flowing backwards from the micro controller to the led on the board. I was attempting to us a digital input pin on the micro controller (with pullup resistor) and was reading HI/LOW to determine the status.
I think that it was working, I was just concerned that I was feeding current back into the LED circuit which wasn't my intention. I don't want to short out the charger by monitoring it.
From the tutorial (for version 1) I understand that the charge led will be active when no solar power is present and the battery falls to 3.1v or below.
In order to monitor this from the micro controller, I would need to tap into both the PG led and the STAT1 led to know when STAT1 is "charging" or "low batt". How can I best go about capturing a digital signal for PG?
My micro controller will periodically post status updates and sensor readings to the internet, and I want to be able to send bit flags to indicate the state of the power/charging system to the user.
Thanks in advance for your advice.
Monitoring USB / DC / Solar Lithium Ion/Polymer charger - v2
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- hortocam
- Posts: 4
- Joined: Wed May 06, 2015 2:24 pm
- adafruit2
- Posts: 22556
- Joined: Fri Mar 11, 2005 7:36 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
what we recommend, actually, is measuring LOAD and BATT
if LOAD == BATT then its not charging, if LOAD > BATT then you're getting sunlight
LOAD's voltage level will also tell you how much sun you've got, and BATT's voltage level will tell you how much power you've got left :)
https://www.google.com/search?q=lithium ... arge+curve
if LOAD == BATT then its not charging, if LOAD > BATT then you're getting sunlight
LOAD's voltage level will also tell you how much sun you've got, and BATT's voltage level will tell you how much power you've got left :)
https://www.google.com/search?q=lithium ... arge+curve
- bilica
- Posts: 28
- Joined: Tue Jun 17, 2014 1:08 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
Thanks adafruit2 - I would like to do the same thing with mine but I do not know exactly how to connect all together to read this info from an Arduino.adafruit2 wrote:what we recommend, actually, is measuring LOAD and BATT
if LOAD == BATT then its not charging, if LOAD > BATT then you're getting sunlight
LOAD's voltage level will also tell you how much sun you've got, and BATT's voltage level will tell you how much power you've got left :)
https://www.google.com/search?q=lithium ... arge+curve
Would you mind providing a simple schematics on how to connect these pins to Arduino pins so I can effectively measure if the systems is charging ?
Thanks in advance!
-
- Posts: 11
- Joined: Sat Mar 28, 2015 1:22 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
I too am using the V2 Solar Lipoly charger and need to monitor the battery power on my pyboard in order to put the pyboard into a deep sleep while the battery continues charging. In the above post the following is recommended.
Does this charger make these two parameter (Load and Batt) available for reading from an mcu? I know of only the digital C,+,D status pins. If not, do you have a product which does?adafruit2 wrote:
what we recommend, actually, is measuring LOAD and BATT
if LOAD == BATT then its not charging, if LOAD > BATT then you're getting sunlight
LOAD's voltage level will also tell you how much sun you've got, and BATT's voltage level will tell you how much power you've got left :)
- adafruit_support_mike
- Posts: 67903
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
There are holes on the PCB marked L+ and B+. You can connect an ADC to those.
-
- Posts: 11
- Joined: Sat Mar 28, 2015 1:22 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
Where can I get instructions about using these B+ and L+ analog outputs?
Instructions Like:
1. Is it necessary to also connect to the GND pins next to B+ and L+ for each analog connection.
2. What is the output voltage range, (is my mcu safe) ?
3. Is there a formula used to interpret the analog data, like mV measured = _mA
Another question the pin marked + between the C and D pins means Battery Power is GOOD as per my understanding. Can you please define what GOOD means?
Edit: I used a multimeter to measure the voltages at all above mentioned pins. The values I get are:
C < 3.0V varies
+ = 4.3V steady
D = 2.8 V
B+ = 3.996
L+ = 4.08V
so, as per your explanation, since L+ > B+ it is currently charging and since the + pin is high it means the battery is GOOD? Correct?
Instructions Like:
1. Is it necessary to also connect to the GND pins next to B+ and L+ for each analog connection.
2. What is the output voltage range, (is my mcu safe) ?
3. Is there a formula used to interpret the analog data, like mV measured = _mA
Another question the pin marked + between the C and D pins means Battery Power is GOOD as per my understanding. Can you please define what GOOD means?
Edit: I used a multimeter to measure the voltages at all above mentioned pins. The values I get are:
C < 3.0V varies
+ = 4.3V steady
D = 2.8 V
B+ = 3.996
L+ = 4.08V
so, as per your explanation, since L+ > B+ it is currently charging and since the + pin is high it means the battery is GOOD? Correct?
- adafruit_support_mike
- Posts: 67903
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
1) You'll need a GND connection as a common reference voltage to measure the voltages at B+ and L+, but that will only be relevant if you're using an ADC that takes its power from something other than the Solar Charger. Everything on the board shares a common GND connection, including the output power.
2) The voltage at L+ can rise to whatever comes out of your solar panel. The voltage at B+ will range from 3.2v to 4.2v for a properly functioning LiPo. If either of those voltages is higher than the limits of your ADC, you'll want to use voltage dividers to drop the voltages to a safe/measurable range.
3) There's no way to calculate current from the voltage readings. You can use the voltage at B+ to estimate the amount of energy stored in the LiPo though. If the voltage is higher than 3.7v, you've used less than about 5% of the LiPo's stored energy. The battery voltage will drop from 3.7v to about 3.5v in a more or less linear way as you use 5% to 90% of the stored energy. If the voltage is between 3.5v and 3.2v, The battery is on the last 10% to 5% of its stored energy. If the voltage is below 3.2v, the battery has less than 5% stored energy, and can't do anything useful.
If the voltage at L+ is more than 150mV higher than the voltage at B+, the load is being powered by the solar panel and the battery is charging. If the voltage at L+ is higher than the voltage at B+, but not by 150mV, the battery isn't charging but the load is getting most of its power from the solar panel. If the voltage at L+ is equal to or less than the voltage at B+, the load is getting its power from the battery.
The "battery good" signal tells you the battery has completed a charging cycle, and still holds enough energy that it doesn't need to be charged.
2) The voltage at L+ can rise to whatever comes out of your solar panel. The voltage at B+ will range from 3.2v to 4.2v for a properly functioning LiPo. If either of those voltages is higher than the limits of your ADC, you'll want to use voltage dividers to drop the voltages to a safe/measurable range.
3) There's no way to calculate current from the voltage readings. You can use the voltage at B+ to estimate the amount of energy stored in the LiPo though. If the voltage is higher than 3.7v, you've used less than about 5% of the LiPo's stored energy. The battery voltage will drop from 3.7v to about 3.5v in a more or less linear way as you use 5% to 90% of the stored energy. If the voltage is between 3.5v and 3.2v, The battery is on the last 10% to 5% of its stored energy. If the voltage is below 3.2v, the battery has less than 5% stored energy, and can't do anything useful.
If the voltage at L+ is more than 150mV higher than the voltage at B+, the load is being powered by the solar panel and the battery is charging. If the voltage at L+ is higher than the voltage at B+, but not by 150mV, the battery isn't charging but the load is getting most of its power from the solar panel. If the voltage at L+ is equal to or less than the voltage at B+, the load is getting its power from the battery.
The "battery good" signal tells you the battery has completed a charging cycle, and still holds enough energy that it doesn't need to be charged.
-
- Posts: 11
- Joined: Sat Mar 28, 2015 1:22 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
Thank you for the clear explanation. Your response should be added to the "learning" information of the Solar Charger.
Questions:
1. What are the conditions which turn ON the DONE LED? Currently, on my board the Done LED is Off and the voltage level of the D pin is around 3.1V. I'm guessing when B+ >= 3.7V
2. what are the min and max voltage values at C, + and D pins ?
Questions:
1. What are the conditions which turn ON the DONE LED? Currently, on my board the Done LED is Off and the voltage level of the D pin is around 3.1V. I'm guessing when B+ >= 3.7V
2. what are the min and max voltage values at C, + and D pins ?
- bilica
- Posts: 28
- Joined: Tue Jun 17, 2014 1:08 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
Thanks Mike - and what about just reading the values from the 'C' pin ?
Is the circuit attached correct ?
Thanks again!
Is the circuit attached correct ?
Thanks again!
adafruit_support_mike wrote:1) You'll need a GND connection as a common reference voltage to measure the voltages at B+ and L+, but that will only be relevant if you're using an ADC that takes its power from something other than the Solar Charger. Everything on the board shares a common GND connection, including the output power.
2) The voltage at L+ can rise to whatever comes out of your solar panel. The voltage at B+ will range from 3.2v to 4.2v for a properly functioning LiPo. If either of those voltages is higher than the limits of your ADC, you'll want to use voltage dividers to drop the voltages to a safe/measurable range.
3) There's no way to calculate current from the voltage readings. You can use the voltage at B+ to estimate the amount of energy stored in the LiPo though. If the voltage is higher than 3.7v, you've used less than about 5% of the LiPo's stored energy. The battery voltage will drop from 3.7v to about 3.5v in a more or less linear way as you use 5% to 90% of the stored energy. If the voltage is between 3.5v and 3.2v, The battery is on the last 10% to 5% of its stored energy. If the voltage is below 3.2v, the battery has less than 5% stored energy, and can't do anything useful.
If the voltage at L+ is more than 150mV higher than the voltage at B+, the load is being powered by the solar panel and the battery is charging. If the voltage at L+ is higher than the voltage at B+, but not by 150mV, the battery isn't charging but the load is getting most of its power from the solar panel. If the voltage at L+ is equal to or less than the voltage at B+, the load is getting its power from the battery.
The "battery good" signal tells you the battery has completed a charging cycle, and still holds enough energy that it doesn't need to be charged.
- Attachments
-
- solar_c_status.jpg (21.19 KiB) Viewed 828 times
- adafruit_support_mike
- Posts: 67903
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
C and D are connected to the MCP73871's open-drain status pins. The voltage you measure across them has no meaningful value until the pin opens a low-impedance connection to GND. Until then, you're measuring the voltage at the bottom of a 1k resistor and LED connected to an unknown high-side voltage, carrying an unknown amount of current, modified by the tolerance error of the resistor and process variations in the LED.
The conditions that set the C and D pins are listed in the MCP73871 datasheet:
http://www.adafruit.com/datasheets/MCP73871.pdf
Table 5-1 on page 23 lists all the conditions and status codes.
The conditions that set the C and D pins are listed in the MCP73871 datasheet:
http://www.adafruit.com/datasheets/MCP73871.pdf
Table 5-1 on page 23 lists all the conditions and status codes.
- wpavalko
- Posts: 69
- Joined: Wed Mar 09, 2016 9:42 pm
Re: Monitoring USB / DC / Solar Lithium Ion/Polymer charger
Can anyone answer this?
-------
I understand this may be obvious for some of you looking at page 23 of the reference, but for me it isn't (yet).
Q1: Is Status 2 the D(one) pin on the Solar LiPo Charger V2?
Q2: If so, what should DigitalRead(input pin connected to D) return if the battery is fully charged and the panel is still supplying power (green LED also lit) ?
Q3: What about if the battery is full, but it's evening and the panel is no longer supplying power (green LED is not lit)?
Q4: What is the appropriate Pull-Up resistor size? 10K?
Thanks.
-------
I understand this may be obvious for some of you looking at page 23 of the reference, but for me it isn't (yet).
Q1: Is Status 2 the D(one) pin on the Solar LiPo Charger V2?
Q2: If so, what should DigitalRead(input pin connected to D) return if the battery is fully charged and the panel is still supplying power (green LED also lit) ?
Q3: What about if the battery is full, but it's evening and the panel is no longer supplying power (green LED is not lit)?
Q4: What is the appropriate Pull-Up resistor size? 10K?
Thanks.
Please be positive and constructive with your questions and comments.