> ## Documentation Index
> Fetch the complete documentation index at: https://learn.pcbcupid.com/llms.txt
> Use this file to discover all available pages before exploring further.

> The G-Mod Lithium Charger safely charges 1S (3.7V) and 2S (7.4V) lithium-ion batteries with adjustable current settings for portable projects.

# Lithium Charger

export const ShopHeader = ({title, url}) => <div style={{
  display: 'flex',
  justifyContent: 'flex-end',
  alignItems: 'center',
  width: '100%',
  marginBottom: '1rem',
  gap: '20px'
}}>
    <a href={url} target="_blank" rel="noopener noreferrer" style={{
  display: 'inline-flex',
  alignItems: 'center',
  backgroundColor: '#00b894',
  color: '#fff',
  padding: '8px 18px',
  borderRadius: '8px',
  textDecoration: 'none',
  fontSize: '0.95rem',
  fontWeight: 600,
  whiteSpace: 'nowrap',
  flexShrink: 0
}}>
      Shop now
    </a>
  </div>;

export const ImgGallery = ({images, modelUrl}) => {
  var [active, setActive] = useState(0);
  var [show3D, setShow3D] = useState(false);
  useEffect(function () {
    if (show3D || images.length <= 1) return;
    var t = setTimeout(function () {
      setActive(function (p) {
        return (p + 1) % images.length;
      });
    }, 3500);
    return function () {
      clearTimeout(t);
    };
  });
  var img = images[active];
  return <div style={{
    position: 'relative',
    background: 'linear-gradient(to bottom, #fff 0%, #fff 80%, #f8f8f8 100%)',
    borderRadius: '32px',
    border: '1px solid rgba(0,0,0,0.08)',
    overflow: 'hidden',
    marginTop: '0.75rem',
    marginBottom: '1.5rem'
  }}>
      <div style={{
    position: 'relative',
    height: '450px',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    background: '#fff',
    padding: '1rem'
  }}>
        {show3D && modelUrl ? <div ref={function (el) {
    if (!el || el._mv) return;
    el._mv = true;
    var s = document.createElement('script');
    s.src = "https://ajax.googleapis.com/ajax/libs/model-viewer/4.2.0/model-viewer.min.js";
    s.type = "module";
    s.onload = function () {
      var mv = document.createElement('model-viewer');
      mv.setAttribute('src', modelUrl);
      mv.setAttribute('camera-controls', '');
      mv.setAttribute('auto-rotate', '');
      mv.style.width = "100%";
      mv.style.height = "100%";
      mv.style.backgroundColor = "#f8f8f8";
      el.innerHTML = "";
      el.appendChild(mv);
    };
    document.head.appendChild(s);
  }} style={{
    width: "100%",
    height: "100%"
  }} /> : <img src={img && img.url} alt={img && img.label} loading="lazy" style={{
    maxWidth: '100%',
    maxHeight: '100%',
    objectFit: 'contain',
    borderRadius: '8px'
  }} />}
      </div>
      <div style={{
    display: 'flex',
    justifyContent: 'center',
    gap: '12px',
    padding: '1rem',
    background: '#eee',
    borderTop: '1px solid rgba(0,0,0,0.08)'
  }}>
        {images.map(function (img, idx) {
    return <button key={img.id || idx} onClick={function () {
      setActive(idx);
      setShow3D(false);
    }} style={{
      padding: '0.6rem 1.5rem',
      borderRadius: '12px',
      border: !show3D && idx === active ? '1px solid #00b894' : '1px solid rgba(0,184,148,0.4)',
      background: !show3D && idx === active ? '#00b894' : '#fff',
      color: !show3D && idx === active ? '#fff' : '#000',
      cursor: 'pointer',
      fontSize: '0.75rem',
      fontWeight: 700,
      textTransform: 'uppercase',
      fontFamily: 'inherit'
    }}>
              {img.label}
            </button>;
  })}
        {modelUrl ? <button onClick={function () {
    setShow3D(true);
  }} style={{
    padding: '0.6rem 1.5rem',
    borderRadius: '12px',
    border: show3D ? '1px solid #00b894' : '1px solid rgba(0,184,148,0.4)',
    background: show3D ? '#00b894' : '#fff',
    color: show3D ? '#fff' : '#000',
    cursor: 'pointer',
    fontSize: '0.75rem',
    fontWeight: 700,
    textTransform: 'uppercase',
    fontFamily: 'inherit'
  }}>
            3D VIEW
          </button> : null}
      </div>
    </div>;
};

<ShopHeader title="Lithium Battery Charger Module" url="https://shop.pcbcupid.com/product/gm014/" />

<ImgGallery images={[{url: "https://files.pcbcupid.com/Documentation/Boards/g-mod/Li-ion%20charging%20/lithium_charger_illustration.avif", label: "ILLUSTRATION", id: "illustrat"}]} />

A **lithium charger** is a versatile power management module used to safely charge either a single (1S) or double (2S) lithium-ion battery pack. It employs the Constant Current / Constant Voltage (CC/CV) method to ensure maximum battery life and safety. This module is ideal for robotics, portable electronics, and any application requiring reliable battery recharging.

<br />

\`

***

## ⚙️ Charging Mode Configuration

The module can be configured for two different battery types by modifying a hardware solder point on the board labeled **2S**.

### 1. Mode Selection

* **1S Mode (3.7V / 4.2V Full)**: Leave the **2S** solder point **OPEN** (default).
* **2S Mode (7.4V / 8.4V Full)**: **SHORT** (solder) the **2S** point to select 2S charging.

### 2. Input Voltage Requirements

To ensure proper charging, your input power supply must meet the following minimums:

* **1S Mode**: 5.0V – 18V DC input.
* **2S Mode**: 10V – 18V DC input (12V recommended).

***

## 🔌 Pin Configuration

* **IN+** – DC Power Input Positive
* **GND** – DC Power Input Ground
* **B+** – Battery Positive Terminal
* **B−** – Battery Negative Terminal
* **G** – Ground
* **NTC** – Temperature sensor input
* **LED+** – LED Positive (for external status)
* **CHR** – Charging status output (Red LED)
* **STB** – Standby / Full status output (Blue/Green LED)

***

## 🚀 Key Features

* **Dual Mode Support**: Charges 1S (3.7V) and 2S (7.4V) packs.
* **High Current Rating**: Supports up to **2A** default charging current.
* **Adjustable Current**: The charging current can be varied by changing the **current limiting resistors** on the board.
* **CC/CV Charging**: Automatic transition from constant current to constant voltage.
* **Status Monitoring**: Dedicated pins for external status LEDs.
* **Safety**: Includes overcharge protection and NTC temperature sensing support.

***

## 🛠️ Step 1: Hardware Required

1. G-MOD Lithium Charger Module (GM014)
2. Lithium-ion Battery:
   * **1S**: 3.7V Cell
   * **2S**: 7.4V Battery Pack
3. DC Power Supply (5V for 1S, 12V for 2S)
4. Connecting Wires
5. Screwdriver (for terminal connections)

***

## ⚡ Step 2: Circuit Connection

> \[!IMPORTANT]
> Always verify the **2S** solder point configuration before connecting your battery. Connecting a 1S battery while the board is in 2S mode will damage the battery.

![Lithium-Charger-Wiring](https://example.com/dummy-image-url-for-wiring.png)

***

## 📊 Step 3: Observe the Output

Once connected, the **CHR** pin will pull low to indicate charging is active. Once the battery reaches its target voltage (**4.2V for 1S** or **8.4V for 2S**), the **STB** pin will trigger to signal a full charge.

* **Current Limiting**: If you need to charge smaller batteries, replace the surface-mount current-sensing resistors to lower the 2A output to a safer level for your specific cells.
