The proposed charge controller consists of four parts:
• Voltage scaling stage: It is used to scale the voltage measured form the battery or PV cell to the level that can be measured by the microcontroller (from 18V to 5V).The voltage scaling stage can be implemented by using a voltage divider circuit as shown in the figure
below(R1=130kΩ,R2=50kΩ).