1

I'm working on a device that would restore voltage on my collection of used 18650 cells. The theory is that they need to be charged extremely slowly with constant current of max 100mA until they are around 3V. This can take above 24 hours. To make the device cheaper I decided to create 40mA-50mA constant current source using just NE5532 opAmp it should not have any problems delivering that amount as it can provide up to 60mA.

NE5532 datasheet

I used Tinkercad for simulation and divided the device into two parts. On the left there is a simple DAC design using 4.7kOhm resistor, 10uF capacitor and opAmp in buffer configuration. This part works without a problem and is easily controlled by analogWrite command.

Firs part of device

Second part is the charging circuit. There is a 1 Ohm resistor to detect voltage drop, opAmp in 100x amplifier configuration (with 2 x 10kOhm and 2 x 1MOhm resistors) with a 10uF capacitor to smooth out the error. There is a diode to prevent discharge of the battery before voltage in the device is high enough to charge it (broken cell voltage can be between 0.5V and 2.5V so a slow ramping up is required)

Second part of device

Everything is OK in simulation when I try to keep amperage at 10mA level. (The 18650 cell is represented as 1.5V battery) As you can see 12mA of voltage to flow into device and the amplifier turns that into 1.2V that is read by Arduino, and it stops ramping up the voltage.

Device at 10mA

But as soon as I try to set amperage to 20mA or higher this happens.

Device at 20mA

The system stabilizes at 31mA and 2V from the opAmp. At 31mA opAmp should return 3.1V. the 2V should correspond with 20mA of charge current.

The question is. Can I somehow decrease the error in 100x amplifier circuit? Is it just a behavior of the simulator, or real NE5532 will have the same issue? Should I simply fix the non linearity in the Arduino code?

Code I used:

float INITIAL_VOLTAGE_V = 1.90;
float CHARGE_AMPERAGE_A = 0.02;

int v = 0;
int a = 0;

void setup()
{
  pinMode(A0, OUTPUT);
  pinMode(11, OUTPUT);

  v = map(INITIAL_VOLTAGE_V * 100, 0,500,0,255);
  a = map(CHARGE_AMPERAGE_A * 100, 0,5,0,1024);

  Serial.begin(9600);

  analogWrite(11, v);
  delay(1000);
}



void loop()
{
  int x = analogRead(A0);

  if (x < a)
    v += 1;

  if (v > 255)
    v = 255;

  analogWrite(11, v);

  Serial.print(x);
  Serial.print("->");
  Serial.println(v);

  delay(500);
}

EDIT I prepared the device schema.

LTSplice schema

After some simulation I found out that the issue is in the voltages I put into the opAmp. Tinkercad uses LM741 in it's opAmp, and I wanted to use NE5532. they both are extremely nonlinear close (around 1V) to the Vcc- and Vcc and their values are completely unreliable.

It was suggested to me to use LM358 for the feedback loop.

Filip Franik
  • 113
  • 5
  • 4
    please draw a proper schematic – it's very hard for us to follow what your circuit actually does based on breadboard wiring pictures. A schematic abstracts away the wiring and shows the "pure essence" of a circuit. – Marcus Müller Jun 20 '19 at 11:32
  • Isn't the NE5532 ancient? Why are you using such an old part instead of a better-spec modern one? – Hearth Jun 20 '19 at 11:34
  • 1
    Is it just me, or you are not powering up the OpAmps? I don't know whether the OpAmps are automatically powered in the simulator, but I'd try to connect pin 8 of the OpAmp (Vcc) to the actual Vcc – frarugi87 Jun 20 '19 at 11:41
  • Sorry. I will draw a schema as soon as i'll be back at my PC. I'm using NE5532 only because i already have a bag full of them. I'm powering the opAmps. Look at red and black wires. It will be more visible after i'll draw a proper schematic. Also Tinkercad is wierd and pin8 of the opAmp is not used. Vcc is on pin7. – Filip Franik Jun 20 '19 at 11:53
  • @FilipFranik then you are not using the NE5532 part on Thinkercad, but a generic single package OpAmp... Then please provide the pinout of the opamp you are using in the simulation (and the schematic) – frarugi87 Jun 20 '19 at 11:55
  • A Lithium rechargeable battery that has been discharged below about 3V is ruined and might catch on fire if charging it is attempted. – Audioguru Jun 20 '19 at 13:57
  • @Audioguru Correct. You shound NEVER attempt charging LiPo that was discharged below 2.5V! The internal resistance of the battery goes up, and when charger will try to charge it with 1A will cause excessive heat and pressure buildup inside the cell turning it into a pipe-bomb! But slow cell restoration with low current (<100mA) is possible even from 0.5V bringing the battery back to safe operational parameters. (WARNING! NOT ALL CELLS CAN BE RESTORED! EXTENSIVE TESTING IS REQUIRED!) – Filip Franik Jun 21 '19 at 10:23

2 Answers2

2

I think you have misunderstood the specifications for your op-amp. The NE5532 is only guaranteed to provide at least 10mA under short-circuit conditions. That's the worst-case value. You should never design assuming "typical" behavior.

Furthermore, the "short circuit current" specification is measured with the output shorted to ground. In other words, if you try to draw the specified short-circuit current from the op-amp then the output voltage is zero. You can't expect to get that much current at any output voltage greater than zero.

The specification you should be looking at is output swing if you look at these numbers you will see that this op-amp is typically used with output currents around 5mA or less.

There are many ways to boost the current from an op-amp. In this case, I think it would be better to look for a device or circuit that is specifically designed to charge your LiPo cell.

Elliot Alderson
  • 31,521
  • 5
  • 30
  • 67
  • I can't use a circuit designed to charge a LiPo because discharged cell has little to none internal resistance, and all "out of box" chargers are pumping high current and it ends up in unequal layer growth (thicker near the anode) this growth breaks the isolator layer and you end up with just a very expensive resistor that might explode. I can use any constant current source with max voltage (lab power supply) but I want to make something cheap that can be made in dozens. I will redesign it using LM2575T-ADJ that I also have on stock. – Filip Franik Jun 20 '19 at 16:11
0

This is more of a comment than an answer, but important enough to post as an answer.

LiPos can be dangerous to dork around with, and thus chargers make a pretty poor project for someone asking the questions you're asking. The only approach you should be considering is battery management ICs that are meant for the job.

Scott Seidman
  • 29,939
  • 4
  • 44
  • 110
  • I'm less incompetent then I appear ;) I have been restoring "dead" cells for powerwall purposes for around 6 months. Unfortunately the tools available are pretty expensive (only commercial grade stuff) or you are stuck with manual restoration using bench power supply and thermistor. If charge is slow enough the battery can be restored with up to 50% of it's original capacity and zero self-discharge. Only about 25% of cells end up actually dead. It's the actual act of "charging" on the discharged cell the reason of them to end up dead and start acting as a large resistor inside a pipe-bomb. – Filip Franik Jun 20 '19 at 16:00