Adjustable Voltage Regulator Project
Learn how to make an adjustable voltage regulator using LM317 or LM338. Perfect for DIY electronics projects requiring a variable DC output voltage.
Simple variable voltage circuit
A Voltage adjustable circuit is one of the easiest and effective methods of regulating the output voltage of a power supply. It is common in electronic laboratories and Do-It-Yourself projects as a means of providing power to other devices that need a different amount of voltage. The circuit schematic is usually constructed with an LM317 adjustable regulator so the output can vary anywhere between 1.25V to up to 30V, depending on what input and resistor combinations are hooked up.
1S battery charger TP4056 circuit
A Single Circuit 3.7 V 1S Battery Charger Circuit is a miniature charger of single-cell (1S) and two-cell (2S) lithium-ion / LiPo packs in small devices, power banks, internet of things (IoT) nodes, and hobby projects. The correct charging of Li-ion cells must have a constant-current/constant-voltage (CC-CV) profile and must terminate correctly, or the capacity and safety of the battery is lost. A practical, single-cell charger was discussed in this guide based on the popular TP4056 1S charging chip, and safe, realistic charging of the 2S pack was addressed either with two, isolated, 1S chargers with balancing, or with a special 2S charger/BMS IC (advocated). You will have component lists, wiring directions, sample resistor values to use to set charge current, non-ideal operation to be aware of, and understandable safety precautions that will enable you to construct and test a reliable Single Circuit 3.7 V 1S 2S Battery Charger Circuit as part of your project.
1S (3.7V) & 2S Li-ion Battery Charger Guide — TP4056 and Safe 2S Charging Methods
1S (3.7 V) Single-Cell Charger — TP4056 Circuit
The TP4056 is a low-cost, popular linear charger IC for single 3.7 V Li-ion cells. It provides CC–CV charging and a programmable charge current using a single PROG resistor.
Components Required (1S)
- TP4056 IC or module
- Rprog resistor (sets charge current)
- 5V USB or regulated 5V supply
- Fuse (PTC or 500 mA slow blow)
- Protection diode (optional)
- Battery connector (JST-PH)
- Optional DW01 + 8205A MOSFET protection board
TP4056 Pin & Schematic Explanation
- VCC (IN+): Connect to 5V
- GND: Ground
- BAT+: Battery positive
- BAT−: Battery negative
- PROG: Resistor to ground (sets charging current)
- STAT1 / STAT2: LED indicators for Charging / Full
Setting Charge Current (Rprog Calculation)
Formula: I (mA) ≈ 1200 / Rprog (kΩ)
| Charge Current | Rprog Value |
|---|---|
| 100 mA | 12 kΩ |
| 500 mA | 2.4 kΩ |
| 1 A | 1.2 kΩ |
Practical Wiring Tips (1S)
- Use a 10 µF capacitor at the input
- Keep battery wires short and thick
- Use fused USB input
- Ensure proper ventilation — TP4056 heats up at high currents
- Use a BMS for cell protection
2S (7.4 V) Li-ion Charger — Safe Options
Charging a 2S (two cells in series) battery is more complex than a 1S pack because both cells must charge evenly. Safe charging requires balancing.
Safe Charging Options
A) Two TP4056 Chargers (NOT Recommended)
Only safe if cells are disconnected from the series and charged individually.
B) Dedicated 2S Charger IC / BMS (Recommended)
Use proper 2S charging modules with balancing (best option).
C) Charge the Pack with CC–CV + BMS
Charge at 8.4V with a BMS that provides balancing.
Balancing Types
- Passive balancing: Bleeds excess charge as heat.
- Active balancing: Moves charge between cells.
Design Notes
- Use fuses and reverse polarity protection.
- Ensure proper thermal paths.
- Use correct connectors (JST-PH, XT30, etc.).
- Monitor voltage and temperature.
Troubleshooting
- Battery not charging → Check wiring and 5V input.
- Module overheating → Reduce charge current.
- Overvoltage detection → Replace BMS or charger module.
- Cell imbalance → Use proper balancing charger.
Safety Warnings
- Do NOT charge Li-ion packs without proper protection.
- Do NOT leave batteries charging unattended.
- Use matched cells in series.
- Stop charging immediately if the temperature exceeds safe limits.
Frequently Asked Questions - Adjustable Voltage Regulator Project:
What is an adjustable voltage regulator?
It is a circuit that allows output voltage control using components like LM317.
Which IC is best for variable voltage?
LM317 is widely used for 1.25V to 37V output range.
Can I use a potentiometer to adjust voltage?
Yes, a potentiometer is used as R2 in the voltage divider.
What is the input voltage range for LM317?
Typically 3V to 40V depending on the application.
Do I need a heatsink?
Yes, if output current exceeds 500mA, a heatsink is recommended.
What is Iadj in the formula?
A small adjustment pin current, often neglected in calculations.
How accurate is LM317?
It provides ±1.5% voltage accuracy under typical conditions.
Can I use LM317 for battery charging?
Yes, but with current limiting and careful design.
Is filtering needed?
Input and output capacitors improve stability and filtering.
Can I use LM338 for higher current?
Yes, LM338 handles up to 5A with proper heatsinking.


