[Charger] Solar Charger Module CN3063

This is a library that makes interfacing with the CN3086 or CN3083 very easy (with Arduino or cpp). The CN3086 is a lithium polymer battery charger. Charging such a battery is fairly difficult (see graph), so that’s why chips like this one exist. You can hook up for instance solar cells, that change a battery and at the same time provide current to the circuit you need. This makes using solar cells more than easy. With this library you can request the status of the chip in terms of:
-If it’s charging
-If it’s done charging
-How far the charging is (=battery voltage)

Hooking it up

In the setup in which i have used this:
You can easily define this in the code (download or see example).

Charging profile for lipo batterys the CN3063 uses


Download: CN3063.zip


This piece of code is also included in the .zip file you can download above.

  1. #include <cn3063.h>
  3. void setup()
  4. {
  5.   Serial.begin(9600);
  6.   CN3063.attach_dig(6,7);
  7.   CN3063.attach_ana(7);
  8. }
  10. void loop()
  11. {
  12.   int bat_stat, bat_volt;
  14.   CN3063.getBatStat(&bat_stat);
  15.   //0= No battery
  16.   //1= Charging
  17.   //2= Charge Complete
  18.   //3= Charge Sleeping
  20.   CN3063.getBatVolt(&bat_volt); //in mV
  22.   Serial.print(bat_stat,DEC);
  23.   Serial.print(" ");
  24.   Serial.println(bat_volt,DEC);
  26.   delay(1000); // There will be new values every 100ms
  27. }

Tim Zaman

MSc Biorobotics. Specialization in computer vision and deep learning. Works at NVIDIA.

You may also like...