Lithium Battery Doctor 3D Printer Model

Author: @
License: CC BY
File formats: stl,ino,zip,txt
Download type: zip
Size:4.7MB

The file 'Lithium Battery Doctor 3D Printer Model' is (stl,ino,zip,txt) file type, size is 4.7MB.

Summary

Li Ion battery Doctor

Features: Charge, discharge, amp hours counter, test for short or open circuit, weak battery indicator, measure internal resistance.
Charge : TP4056 module (modified), selectable 200 or 500 mA current. TP4056 circuit, monitored by Arduino.
Discharge : current 200 or 500mA, PWM controlled. Internal resistance is calculated from battery voltage drop under load.
Capacity : Battery gets fully charged, then discharged, amp hour at 200 or 500 mA load is counted.
Recovery : Deep discharged battery charged with 100mA current.

Parts : Arduino (mini, nano), LCD 1602, TP4056 module, 5V relay, TIP120 Darlington, LMV358, small parts.

Four switch selectable menus:

1.Test : The battery connector is biased to 2.3V. Open battery shows this value. Short circuit battery shows 0.1V or less. Weak battery : 3.2V minimum, current less than 100mA. Good battery shows at least 3.2V and 100 mA, the internal resistance is calculated from the voltage drop 0/200/500mA. Switch selects 200 or 500mA.

2.Charge : Relay connects TP4056 and battery. The battery will be charged by the 4056 chip's hardware, Arduino only monitors its status, the voltage and current (Switch selects 200 or 500mA). Relay can not be activated if the battery is reversed or very low.

3.Capacity: Battery will be fully charged by TP4056, then discharged by a PWM-LMV358-TIP120 circuit. Discharge current 200 or 500mA is switch selectable. Arduino accumulates the current every second, shows total mAh value.

4.Repair : Deep discharged batteries - below 2.6V - will be charged gently until they reach the minimal voltage to begin the normal charge process. The charge current is about 100mA, supplied by a PNP transistor current generator.

Main circuits (Dx , Ax refers to Arduino pin):

Charge : TP4056 module, resistor to pin 2 is replaced by 5K6 (200mA charge) and a switched 4K7 (500mA charge). Pin7 (red LED) pulses 200uS in standby mode, which is filtered by 10k/1uF and fed to D8. Pin6 (blue or green LED) is connected to D9. If the input of NMOS Q4 is positive enough, the relay can be activated by D10 and charge will begin.

Discharge : PWM D6 output is smoothed by 20k-10uF and a positive current 0-125uA is fed to +ve input of the opamp LMV358. Same time, 0-125uA negative current causes a feedback from the 0.05 ohm shunt resistor, sensing the discharge current. The opamp output drives the TIP120 current sink transistor, if this is enabled by D7.

Current sense : The 0.05 ohm shunt resistor's range (+ or - 25mV) senses + or - 500mA. The LMV358 opamp pin 3 is biased from the 1.1V Vref of the Arduino, the constant current from there raises the output pin 1 to 2.6V, which in turn corresponds to zero mA current on the 0.05 ohm shunt. The opamp's amplification A=74 results that the output swing covers the +-500mA range. You should check this - very much component tolerance dependant - zero value (uncomment Serial.println(mA) in measA(void)) and recalculate the subtracted value (32500). See code.

Recovery current generator : A3 output (low) pulls the base of Q1 down to 3.4V, so the PNP transistor will generate about 100mA positive current.

Arduino : 1.1V internal analog reference is used, so the A1(voltage) A2(current) inputs have voltage dividers. A0 senses the position of the 4-throw mode switch.

User program : code size 6k, no external libraries. I had to write very compact and strictly hardware dependant LCD driver code to reduce code size ( ~to fit in a 8K chip, see https://www.thingiverse.com/thing:5223844), the LiquidCrystal library was too big. However, if your chip size allows, you could use that too.

Construction : 3D printed case. I mounted the relay circuit on the TP4056 PCB. The TIP120, LMV358, PNP current generator circuit is on perfboard attached to a coolplate.

Ground loop issue: uV-s make the difference, it's very important to follow the "high" current paths, and never mix it with opamp input circuit or the A/D inputs. In practice, this means the Tip120 emitter, the 0.05 ohm and the wire from the - of the TP4056 module is the same central point for current ground. The opamp ground points are connected here too. A single wire runs from here to the Arduino board, used for signal and supply of the board. Keep the battery socket wires thick (0.5mm2) and short.

Probably must correct calculations in the program. measV(); play up-down with the 411 multiplier , measA(); play with 453 divider until your DVM and the Doctor shows nearly the same.

Update 6 Feb 22 : Adaptor for banana jack 2mm. The adaptor's purpose is to connect cables to any form of lithium battery. Use solderable screws tacks etc. for contacts. For 4mm banana socket drill the holes to 7mm.

3D files : version for rotary / slide switch SP4T, banana adaptor. Print with (full) support.

Note : Files are in disorder, reason is that Thingiverse does not let me upload PDF or ZIP what's more sometimes I can't edit at all - 404 error of my saved files! But everything is there, hope you guys find the way.

banadapter.stl 44.7KB
LiBatRotSw.stl 61.4KB
LiBatSliSw.stl 63.9KB
LiBatTop.stl 430.3KB
LiIonDoc.ino 7.3KB
Schematic.zip 192.4KB
text.txt 4.4KB
zipFiles.zip 4.4MB