Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-pro· GoogleHugging Face LMArena Human Preference 140K

Is it expected that to maintain constant current up to 4.2V, I will need to raise the…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    Is it expected that to maintain constant current up to 4.2V, I will need to raise the charging voltage to above 4.2V?

  2. Gemini Assistant

    Yes, absolutely. That is not only expected, it is a fundamental requirement of electricity.

    To maintain a constant current flow into the battery, the voltage of your power source (VsupplyV_{\text{supply}}) must always be higher than the internal voltage of the battery (VbatteryV_{\text{battery}}).

    Let's break down why this is the case.

    The Water Analogy

    Think of electricity like water flowing between two connected tanks.

    • Voltage is the water level (potential energy).
    • Current is the rate of water flow.
    • Resistance is the narrowness of the pipe connecting them.

    For water to flow from Tank A (your power supply) to Tank B (your battery), the water level in Tank A must be higher than in Tank B. The difference in water levels is what drives the flow.

    The Electrical Explanation

    Your charging circuit can be simplified to this model:

              R_circuit
    V_supply O----/\/\/\----+----O V_battery
             |             |
             |-----> I     |
                           |
                          ---
                          GND
    

    Where:

    • VsupplyV_{\text{supply}}: The voltage you command your AP33772 to output.
    • VbatteryV_{\text{battery}}: The actual voltage of the battery cell, which increases as it charges.
    • RcircuitR_{\text{circuit}}: The total resistance of everything between the power supply and the battery terminals. This includes your wires, connectors, PCB traces, and the internal resistance of your current sensor.
    • II: The charging current you want to keep constant.

    According to Kirchhoff's Voltage Law, the relationship is:

    Vsupply=Vbattery+(I⋅Rcircuit)V_{\text{supply}} = V_{\text{battery}} + (I \cdot R_{\text{circuit}})

    The term (I⋅Rcircuit)(I \cdot R_{\text{circuit}}) is the voltage drop across your wiring and components. To maintain a constant current (II), you must constantly adjust VsupplyV_{\text{supply}} to be slightly higher than the rising VbatteryV_{\text{battery}}.

    Practical Example

    Let's assume your target constant current is 1A and the total resistance of your wiring and sensors (RcircuitR_{\text{circuit}}) is 0.1Ω.

    The voltage drop across the circuit will be: Vdrop=1A⋅0.1Ω=0.1VV_{\text{drop}} = 1\text{A} \cdot 0.1\Omega = 0.1\text{V}

    Now, let's see what VsupplyV_{\text{supply}} needs to be at different points in the charge cycle:

    1. Battery is discharged (e.g., at 3.4V): Vsupply=3.4V(battery)+0.1V(drop)=3.5VV_{\text{supply}} = 3.4\text{V} (\text{battery}) + 0.1\text{V} (\text{drop}) = \textbf{3.5V}

    2. Battery is mid-charge (e.g., at 3.8V): Vsupply=3.8V(battery)+0.1V(drop)=3.9VV_{\text{supply}} = 3.8\text{V} (\text{battery}) + 0.1\text{V} (\text{drop}) = \textbf{3.9V}

    3. Battery is nearly full (e.g., at 4.19V): Vsupply=4.19V(battery)+0.1V(drop)=4.29VV_{\text{supply}} = 4.19\text{V} (\text{battery}) + 0.1\text{V} (\text{drop}) = \textbf{4.29V}

    As you can see, to continue pushing 1A of current into the battery just before it hits 4.2V, your USB-C power supply will need to output a voltage greater than 4.2V.


    CRITICAL SAFETY WARNING

    This leads to the most important part of your charger design: The transition from Constant Current (CC) to Constant Voltage (CV).

    • Your control loop MUST monitor the battery's terminal voltage (VbatteryV_{\text{battery}}) at all times.
    • While in the CC phase, your code will be increasing VsupplyV_{\text{supply}} to keep the current constant.
    • The moment your sensor reads that VbatteryV_{\text{battery}} has reached 4.2V, you must immediately switch your algorithm.
    • Never allow the battery terminal voltage itself to go above 4.2V. Overcharging a lithium-ion cell is extremely dangerous and can lead to permanent damage, venting, or fire.

    What your code must do:

    Your main loop should look something like this:

    # Assuming you have functions to read sensors and set voltage
    TARGET_CURRENT = 1.0  # Amps
    MAX_BATTERY_VOLTAGE = 4.20 # Volts
    
    while True:
        measured_current = read_current_sensor()
        measured_battery_voltage = read_voltage_sensor()
    
        # --- PRIMARY SAFETY CHECK ---
        if measured_battery_voltage >= MAX_BATTERY_VOLTAGE:
            # ---- CONSTANT VOLTAGE (CV) PHASE ----
            # The battery has reached its max voltage. Hold it there.
            # The goal is to keep measured_battery_voltage at 4.2V
            # You may need a small PID controller here, but a simple approach is:
            # Nudge the supply voltage to keep the battery voltage at 4.2V.
            # The current will naturally taper off.
            
            current_supply_voltage = get_current_supply_voltage() # Get the last set voltage
            if measured_battery_voltage > MAX_BATTERY_VOLTAGE:
                 set_usb_c_voltage(current_supply_voltage - 0.01) # Nudge supply down
            else:
                 set_usb_c_voltage(current_supply_voltage + 0.01) # Nudge supply up if it dips
    
            # Terminate charging when current drops to a low threshold (e.g., < 0.05C)
            if measured_current < (0.05 * BATTERY_CAPACITY_AH):
                print("Charging complete.")
                set_usb_c_voltage(0) # Stop charging
                break
    
        else:
            # ---- CONSTANT CURRENT (CC) PHASE ----
            # This is the logic from the previous answer
            error = TARGET_CURRENT - measured_current
            # Use a PI or PID controller for better stability, but simple adjustment works:
            voltage_adjustment = error * KP_CONSTANT # KP_CONSTANT is a tuning factor
            
            new_supply_voltage = get_current_supply_voltage() + voltage_adjustment
            set_usb_c_voltage(new_supply_voltage)
    
        time.sleep(0.1)
    

    In summary: Yes, your supply voltage will and must exceed 4.2V to complete the constant current phase. Your safety and success depend on accurately measuring the battery terminal voltage and switching to a constant voltage phase the instant it reaches 4.2V.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.