Stufin
Home Quick Cart Profile

XL4015 5A Constant Current/Voltage LED Drives Lithium Battery Charging Module

Buy Now

Input Voltage

7-32V

Output Voltage

Adjustable (up to 28V)

Output Current

Adjustable (up to 5A)

Charging Current

Up to 5A

Efficiency

Up to 95%

Operating Temperature

-40C to 85C

Storage Temperature

-40C to 125C

Dimensions

44 x 22 x 10mm

Applications

The XL4015 5A Constant Current/Voltage LED Drives Lithium Battery Charging Module is suitable for a wide range of IoT applications, including

LED lighting and display systems

Portable devices and battery-powered sensors

IoT devices and mesh networks

Automated control systems

Battery management systems

Note

The module requires external resistors to adjust the output voltage and current. Additionally, users must ensure that the module is used within its specified operating conditions to prevent damage or malfunction.

Pin Configuration

  • XL4015 5A Constant Current/Voltage LED Drives Lithium Battery Charging Module Pinout Explanation
  • The XL4015 is a versatile module that can be used as a constant current/voltage LED driver, as well as a lithium battery charger. The module has 7 pins, which are explained in detail below:
  • Pinout Structure:
  • Here is the pinout structure of the XL4015 module:
  • ```
  • +---------------+
  • | IN+ | IN- |
  • +---------------+
  • | VCC | GND |
  • +---------------+
  • | OUT+ | OUT- |
  • +---------------+
  • | SET |
  • +---------------+
  • ```
  • Pin-by-Pin Explanation:
  • 1. IN+ (Input Positive)
  • Function: Positive input voltage connection
  • Description: Connect the positive wire of your power source (e.g., wall adapter, battery) to this pin.
  • 2. IN- (Input Negative)
  • Function: Negative input voltage connection
  • Description: Connect the negative wire of your power source (e.g., wall adapter, battery) to this pin.
  • 3. VCC (Voltage Common Collector)
  • Function: Power supply voltage for the internal circuitry
  • Description: Typically, this pin is not connected externally, as the module generates its own power supply internally.
  • 4. GND (Ground)
  • Function: Ground connection
  • Description: Connect the ground wire of your power source (e.g., wall adapter, battery) to this pin.
  • 5. OUT+ (Output Positive)
  • Function: Positive output voltage connection
  • Description: Connect the positive wire of your load (e.g., LED strip, lithium battery) to this pin.
  • 6. OUT- (Output Negative)
  • Function: Negative output voltage connection
  • Description: Connect the negative wire of your load (e.g., LED strip, lithium battery) to this pin.
  • 7. SET (Setting)
  • Function: Constant current/voltage setting pin
  • Description: This pin is used to set the constant current or voltage output of the module. A potentiometer or a resistor can be connected between the SET pin and the GND pin to adjust the output.
  • Connecting the Pins:
  • When connecting the pins, ensure that you follow proper polarity and voltage ratings to avoid damaging the module or your load. Here's a general connection structure:
  • Connect the power source to IN+ and IN- pins.
  • Connect the ground wire to the GND pin.
  • Connect the load (e.g., LED strip, lithium battery) to the OUT+ and OUT- pins.
  • Connect a potentiometer or a resistor between the SET pin and the GND pin to adjust the output current/voltage.
  • Important Notes:
  • The module has a maximum input voltage of 18V and a maximum output current of 5A.
  • When using the module as a lithium battery charger, ensure that you connect the battery to the OUT+ and OUT- pins, and set the output voltage and current accordingly.
  • When using the module as a constant current/voltage LED driver, ensure that you connect the LED strip to the OUT+ and OUT- pins, and set the output current/voltage accordingly.
  • Remember to always follow proper safety precautions when working with electronic circuits, and consult the datasheet for more detailed information on the module's specifications and usage.

Code Examples

XL4015 5A Constant Current/Voltage LED Driver Lithium Battery Charging Module Documentation
Overview
The XL4015 is a high-performance, 5A constant current and voltage LED driver and lithium battery charging module. This module is designed to provide a stable and efficient power supply for LED strips, lamps, and other devices, as well as charge lithium batteries. The module features adjustable constant current and voltage settings, making it suitable for a wide range of applications.
Pinout and Connections
The XL4015 module has the following pins:
VIN: Input voltage (6-25V)
 VOUT: Output voltage (adjustable)
 Iadj: Current adjustment pin (connect a potentiometer to adjust constant current)
 EN: Enable pin (active high)
 BAT+: Lithium battery positive terminal
 BAT-: Lithium battery negative terminal
Features
Constant current and voltage output
 Adjustable output voltage (0.8-12V) and current (0.5-5A)
 Lithium battery charging function with overcharge protection
 Low dropout voltage
 High accuracy and stability
 Compact design
Code Examples
### Example 1: Arduino Controlled LED Strip
In this example, we will use an Arduino board to control the XL4015 module to drive an LED strip.
Hardware:
XL4015 module
 Arduino board (e.g., Arduino Uno)
 LED strip (compatible with constant current output)
 Breadboard and jumper wires
Code:
```c
const int enablePin = 2;  // Connect EN pin to digital pin 2 on Arduino
const int adjPin = A0;   // Connect Iadj pin to analog pin A0 on Arduino
void setup() {
  pinMode(enablePin, OUTPUT);
  pinMode(adjPin, OUTPUT);
}
void loop() {
  // Set output voltage to 10V
  analogWrite(adjPin, 1023  (10.0 / 12.0));
  digitalWrite(enablePin, HIGH);  // Enable the module
  
  // Set current to 2A
  analogWrite(adjPin, 1023  (2.0 / 5.0));
  delay(1000);
  
  digitalWrite(enablePin, LOW);  // Disable the module
  delay(1000);
}
```
In this example, the Arduino board controls the XL4015 module's output voltage and current using the `analogWrite()` function. The `enablePin` is used to turn the module on and off.
### Example 2: Lithium Battery Charging with Raspberry Pi
In this example, we will use a Raspberry Pi to monitor and control the XL4015 module's lithium battery charging function.
Hardware:
XL4015 module
 Raspberry Pi (e.g., Raspberry Pi 3)
 Lithium battery (compatible with the module's charging function)
 Breadboard and jumper wires
Code:
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
EN_PIN = 17  # Connect EN pin to GPIO 17 on Raspberry Pi
BAT_PIN = 23  # Connect BAT+ pin to GPIO 23 on Raspberry Pi
GPIO.setup(EN_PIN, GPIO.OUT)
GPIO.setup(BAT_PIN, GPIO.OUT)
while True:
    # Charge the battery
    GPIO.output(EN_PIN, GPIO.HIGH)
    GPIO.output(BAT_PIN, GPIO.HIGH)
    time.sleep(1)
    
    # Check the battery voltage
    bat_voltage = read_battery_voltage()  # Implement your own function to read battery voltage
    if bat_voltage >= 4.2:  # Stop charging when the battery is fully charged
        GPIO.output(EN_PIN, GPIO.LOW)
        break
    
    # Monitor the charging process
    print("Charging...")
    time.sleep(1)
```
In this example, the Raspberry Pi uses the `RPi.GPIO` library to control the XL4015 module's charging function. The code monitors the battery voltage and stops charging when the battery is fully charged.
Note: These code examples are for illustration purposes only and may require modification to suit your specific application. Always follow proper safety precautions when working with electrical components.