charge li on battery through arduino without running connect

Adafruit cellular platform - SMS and IoT over celluar

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jpuigdef
 
Posts: 37
Joined: Thu May 18, 2017 2:35 pm

charge li on battery through arduino without running connect

Post by jpuigdef »

Hi,

I have fona 808 shield correctly working on an arduino genuino uno. It is intended to send positions to a web until the battery runs out (24 hour aprox). The charging switch is on 'RUN'

Then I want to recharge the battery through the fona808 shield charger. Therefore I plug power to the Arduino and put the switch on 'CHARGE' mode. It charges while the skecth is running, so the fona keeps sending messages

I do'nt want the fona to send messages while charging. Is there any way to read the CHARGE/RUN mode from the arduino sketch to decide if a message has to be sent?

Thanks

joan

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: charge li on battery through arduino without running con

Post by adafruit_support_mike »

Hmm.. that would be tricky.

If you set the Arduino to use its internal 1.1V voltage reference for the analog input pins, you can connect a 47k-12k voltage divider between the Arduino's 5V pin and GND, then measure the voltage at the center of the divider with an analog pin.

When the switch is in the CHARGE position, the voltage on the 5V pin will be 5V and the analog pin will see about 1V at the center of the voltage divider.

When the switch is in the RUN position, the voltage on the 5V pin will be between 4.2V and 3.3V, and the analog pin will see between 850mV and 650mV at the center of the divider.

Those are far enough apart that you can identify the state of the switch.

User avatar
jpuigdef
 
Posts: 37
Joined: Thu May 18, 2017 2:35 pm

Re: charge li on battery through arduino without running con

Post by jpuigdef »

Thanks Mike for your support.

I still did'nt put the resistors bridge (I expect to have them tomorrow) but I did some measurements with the tester and have a question for which I would appreciate your opinion.

The measurements are done with the tester between 5V pin and GND. The battery (2000mAh) is around 50% capacity

1- When the fona808 shield + arduino are running on 'RUN' mode without USB connection the voltage read is 3.5V
2- When the fona808 shield + arduino are running on 'RUN' mode with USB connection the voltage read is 4,88V
3- When the fona808 shield + arduino are running on 'CHARGE' mode with USB connetcion the voltage read is 4V, slowly increasing (maybe it depends on battery charging?)

The voltages I want to distiguish are 1 and 3 to inhibit the fona sending messages while charging

The question is why is voltage in situation 3 only of 4V? Does it depend on the charging status of the battery (ie, would it be still lower with a discharged battery and higher with a fully charged battery?) If so, the distance between voltages read on situations 1 and 3 would be hard to discriminate if th ebattery is low...

Would'nt it be possible to read the voltage between the legs on the CHARGE/RUN switch?

Thanks
joan

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: charge li on battery through arduino without running con

Post by adafruit_support_mike »

jpuigdef wrote:The question is why is voltage in situation 3 only of 4V? Does it depend on the charging status of the battery (ie, would it be still lower with a discharged battery and higher with a fully charged battery?) If so, the distance between voltages read on situations 1 and 3 would be hard to discriminate if th ebattery is low...
That's the voltage of the charging LiPo.

All batteries start off with a higher voltage when they're fully charged, then lose voltage as the discharge. The LiPos we carry (and ones that will work with the FONA Shield) start off at 4.2V when fully charged, and end at about 3.3V by the time they're 95% discharged. They spend most of their time within about 200mV of 3.7V.

A LiPo charger starts by sending a fixed amount of current into the cell, and watching the cell voltage rise in the process. The cell voltage will reach 4.2V when the polymer is about 80% charged, but that voltage only applies to the polymer in direct contact with the anode and cathode plates. If you let the LiPo sit for a while, you'd see the cell voltage drop as the energy diffuses to the polymer farther away from the plates.

Once the cell voltage hits 4.2V, the LiPo charger changes its approach. Instead of hiolding the current constant and watching the voltage, it holds the voltage at 4.2V and watches the current. As energy diffuses into the polymer, the amount of current flowing into the LiPo decreases, and by the time the current has fallen to 1% of its original value, the cell is considered fully charged.

User avatar
jpuigdef
 
Posts: 37
Joined: Thu May 18, 2017 2:35 pm

Re: charge li on battery through arduino without running con

Post by jpuigdef »

THanks Mike,

I found out that when the Arduino+fonashield is connected to a 7V adaptator through Arduino's barrel jack, tension in pin5V is about 5V in CHARGE mode. That happens not so when it is connected to the USB of the computer (then voltage is lower)

In any case, with the help of the resistances of 12k,47k, I am able to distinguish when the system is on CHARGE mode and fed through a 7V external supply and when it works on RUN mode from the li po battery. Then I simply inhibit sending messages when charging
.

Thanks for your help!

joan

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: charge li on battery through arduino without running con

Post by adafruit_support_mike »

Glad to hear you got it working. Happy hacking!

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

Return to “FONA”