Skip to content
CN3065

Charger

Using CN3065 Charger with ESP32

What is the CN3065?

What is the CN3065 solar charger?

The CN3065 is a charging chip for a single lithium-ion or LiPo cell, made for small solar panels. The boards sold under its name put it on a 40 × 20 mm PCB with two JST connectors (one for the panel, one for the battery) and a micro-USB port as a second way in. Plug a panel into one side and a cell into the other, and it charges.

Inside, it runs the usual lithium cycle. A gentle precharge starts a deeply discharged cell, then constant current until the cell nears 4.2 V, then constant voltage while the current tapers off. When the current falls to a tenth of the set value, it stops, and it starts again if the cell drops below 4.1 V. When the panel goes dark, the chip sleeps and draws under 3 µA from the battery.

The red LED shows charging and the green LED shows charged.

Danger

The module has no battery protection. It will not stop a cell from over-discharging, and it does not protect against a short on the load side. Use a cell with a protection board, such as a protected 18650. It charges to 4.2 V only, so it is for a single Li-ion or LiPo cell, never LiFePO4 or a multi-cell pack.

Solar-friendly, but not MPPT

A small panel cannot always deliver the current a charger asks for. If it is forced to, its voltage collapses and the charge stalls. The CN3065 has an 8-bit ADC that watches the input and lowers the charge current to what the panel can supply, so the panel keeps working instead of sagging. That is why you can set the current for the best case and still charge under cloud.

This is not true maximum power point tracking. An MPPT controller such as the CN3791 steers the panel to its best operating point and converts the difference efficiently. The CN3065 is a linear charger, so everything above the battery voltage is burned as heat:

Heat (W) = (Vin − Vbat) × charge current

From a 6 V panel into a 3.7 V cell at 500 mA that is (6 − 3.7) × 0.5 = 1.15 W, on a board the size of a stamp. From 5 V it is 0.65 W. The chip has thermal feedback and will reduce the current when it gets hot, so nothing breaks, but charging slows down. Give the board some airflow and keep it out of direct sun.

Choosing a panel

Two numbers matter: voltage and power.

Voltage. The input range is 4.4 to 6 V. A panel's open-circuit voltage (Voc) is higher than its working voltage, and it shows up when the charger draws little current, for example just before charging starts. Check the Voc on the label, or measure it in sun, and keep it at or below 6 V. A panel sold as 6 V can exceed that in bright light, so a 5 V-class panel is the safer match. Below about 4.4 V the chip does not start.

Power. The charge current can never be more than the panel's watts divided by its volts. A 1 W panel at 5 V gives at most about 200 mA, so a 2000 mAh cell needs about 10 hours of full sun, and in practice more. To reach the module's full 500 mA you need roughly 2.5 W. A larger panel of the same voltage does no harm. It only reaches the current limit sooner.

Charge current

On common modules the charge current is fixed at 500 mA by a small resistor between the chip's ISET pin and ground. The chip can be programmed up to about 1 A, and the resistor value sets it. A larger resistor means less current, as on most charger chips.

The usual rule is to charge at no more than the cell's capacity per hour (1C), so 500 mA suits a cell of 500 mAh or more. For a smaller cell, such as a 150 mAh LiPo, you need to lower the current. Look up the resistor table in the CN3065 datasheet before changing anything, and read the marking on your own board, because makers use different values.

What the LEDs tell you

RedGreenMeaning
OnOffCharging
OffOnCharge finished, or a full cell sitting on the charger
OffOffNo input (dark panel, or below about 4.4 V) and the chip is asleep
On for many hoursOffSomething else is taking the charge current: a load on the battery, or a worn cell
  1. 1Measure the panel's open-circuit voltage in sun with a multimeter. It must be 6 V or less.
  2. 2Check the polarity of every JST connector against your panel and cell before plugging in. The pin order is not standard between makers, and you may need to swap the wires in the plug.
  3. 3Plug the protected cell into the battery connector first, then the panel.
  4. 4Wait for the red LED, and measure the cell voltage to confirm it rises toward 4.2 V.
  5. 5For a 5 V board, take wires from the battery connection to the input of an MT3608. With nothing connected to its output, set it to about 5.1 V, then connect the board to the output.
  6. 6Expect the load to share the charge current. If it draws more than about a tenth of the set current, the charger may never reach its end-of-charge point and the red LED stays on. The cell is still held at 4.2 V, so this is harmless, but you will not see the green LED.
Solar power chain: panel, CN3065, protected Li-ion cell, MT3608 boost converter and a 5 V board
Solar power chain: panel, CN3065, protected Li-ion cell, MT3608 boost converter and a 5 V board

Troubleshooting

SymptomLikely causeFix
No LED at allPanel voltage below about 4.4 V, or a polarity mix-upMeasure at the panel in sun and check the JST polarity
Red LED stays on for hoursA load on the battery takes the charge current, or the cell is wornDisconnect the load and see if the green LED comes on
Charging is slowPanel cannot supply the set current, cloud, or the board is hot and has cut the currentUse a bigger 5 V-class panel, better sun, more airflow
Board gets hotLinear charger loses (Vin − Vbat) × current as heatUse a 5 V panel rather than 6 V, lower the charge current, add airflow
Cell stays dead after a deep dischargeThe cell or its protection board has cut outDo not force it. Try USB charging, and replace the cell if it does not recover

Frequently asked questions

Can I charge from USB instead of a panel? Yes. The micro-USB port feeds the same charger at 5 V.

Can I power my project while the cell charges? Yes, the load goes in parallel with the battery. It shares the charge current, though, as explained in the steps above.

Is the CN3065 an MPPT charger? No. It lowers the charge current when the panel cannot keep up, but it does not track the maximum power point. The CN3791 does.

Can it charge a LiFePO4 cell or two cells in series? No. It terminates at 4.2 V for one Li-ion or LiPo cell.

Which cell should I use? A protected 18650 or a LiPo with a protection board, with a capacity in mAh of at least the charge current in mA.

Setting Up CN3065 with ESP32

Wiring

Component pinESP32 pinNote
SOLAR+ / SOLAR- (JST)Solar panel +/-Open-circuit voltage must be 6 V or less
BAT+ / BAT- (JST)Protected single-cell Li-ion or LiPoUse a cell with a protection board. The module has none
BAT+ / BAT- (same battery connection)MT3608 IN+ / IN-Boosts the 3.0-4.2 V cell to 5 V. Set the MT3608 to about 5.1 V before connecting the board
MT3608 OUT+5V / VIN pinTaken from the MT3608 output, not from the CN3065
MT3608 OUT-GNDCommon ground

Swipe sideways to see every column →

The CN3065 charges the cell and has no regulated output of its own, so a 5 V ESP32 board needs a boost converter such as the MT3608 between the cell and the 5V/VIN pin. The ESP32 suits solar nodes that sleep most of the time, but an MT3608 idles at roughly 100-200 µA, which can use more than the ESP32 does in deep sleep. For deep-sleep nodes, consider a low-quiescent-current 3.3 V regulator that works across the cell's 3.0-4.2 V range instead.

Related Components

Related Guides & Projects