Sie sind auf Seite 1von 5

3/11/2019 Arduino Solar Battery Charge Controller

Technology Remaking the World

Arduino Battery Charge Controller


by Lewis Loflin
Tweet
Like Share 80 people like this. Sign Up to see what your friends like.
Solar Panel Battery Charge Controller Switching Circuit

This is a simplified version of my Solar Panel Battery Charge Controller Using Arduino. One
can easily add the ideas from that project to this one.

Looking for an energy storage


system? Or do you run an
energy storage system…
Ad YIY Electric

Visit Site

Above is a generic Arduino Nano, but the code will work on any Arduino style microcontroller. The
5V regulator is build into the unit I used and if not use a separate 5V supply.

The battery voltage is measured from the TP1. The 10V zener diode drops 10V leaving a voltage
value of 0v-5V at TP1. Normally the battery/charge voltages range from 12V-14V. The Arduino
ADC returns a 10-bit value from 0-1023 based on an input voltage of 0V-5V. A value of Vin should
return an ADC number of about 600 based on a 12.7 volt input. The idea is if the battery voltage
drops below 12.6V turn on the charge current from the solar panel, turn off the current then wait,
then measure again.

http://www.bristolwatch.com/solar_charger.htm 1/5
3/11/2019 Arduino Solar Battery Charge Controller

A HIGH from DP2 switches on Q1/Q2. Q1 is a PNP bipolar transistor. In addition by adjusting the
value of 1K resistor on Q1's base we can introduce current limiting in addition to acting as a power
switch. See Introduction to Constant Current Circuits. Note in the video I was charging a 12-
volt lead-acid sealed gel-cell type battery.

This is for small applications and if trying to charge a 1000-watt battery bank buy a commercial
unit. Add a heat sink to Q1 if needed - other PNPs will work if they have sufficient collector current.
See the following on various types of switching transistor circuits:

Constant Current Circuits with the LM334


Basic Transistor Driver Circuits for Micro-Controllers
Tutorial Using TIP120 and TIP125 Power Darlington Transistors
Driving 2N3055-MJ2955 Power Transistors with Darlington Transistors
Understanding Bipolar Transistor Switches
N-Channel Power MOSFET Switching Tutorial
P-Channel Power MOSFET Switch Tutorial

The above uses a transistor switching circuit to turn on the zener diode circuit to do a voltage
measurement. This prevents the small, but steady discharge of the battery. You will have to add
that to the following code.

/*
Solar cell battery charger/regulator
*/

#define Vin 0
#define CE 2 // charge enable
#define chon 4000 // charge on time
#define choff 4000 // charge off time
#define CP 600 // charge point variable

int val;
http://www.bristolwatch.com/solar_charger.htm 2/5
3/11/2019 Arduino Solar Battery Charge Controller

void setup() {
pinMode(CE, OUTPUT);
digitalWrite(CE, LOW);
Serial.begin(9600);
}

void loop() {

val = analogRead(Vin);
while (val > CP) {
val = analogRead(Vin);
Serial.print("Charge off val = ");
Serial.println(val);
Serial.print("Vbat = ");
Serial.println(val * .0048 + 10.0);
delay(2000);
}
digitalWrite(CE, HIGH);
delay(chon);
digitalWrite(CE, LOW);
delay(choff);
}

The above program will produce this out on the Arduino serial monitor.

View all of my You Tube Videos


Also visit and subscribe to My YouTube Channel

Solar Battery Charger YouTube Videos


http://www.bristolwatch.com/solar_charger.htm 3/5
3/11/2019 Arduino Solar Battery Charge Controller

View all of my You Tube Videos


Solar Panel Battery Charge Controller Operation
Solar Panel Battery Charge Controller Circuitry
Solar Panel Battery Charge Controller Programming
More circuitry

I used this circuit to protect my solar panel charging system. The solar panel can produce a
maximum current of 500mA. A really drained lead-acid battery can look like a dead short so this
safely limits the current to protect the panel from possible damage.

The formula is Iout = 1.25V / RE. For 500mA RE = 2.5 Ohms.

» Webmaster

» Bristol, Southwest Virginia Revealed

» Science & Technology

» Hobby Electronics

» US Constitution

» Religion & History

» E-Mail

Arduino Projects Revisited Revised

http://www.bristolwatch.com/solar_charger.htm 4/5
3/11/2019 Arduino Solar Battery Charge Controller

Schematic for Following Projects


Programming ADS1115 4-Channel I2C ADC with Arduino
Arduino uses ADS1115 with TMP37 to Measure Temperature
Connect Arduino to I2C Liquid Crystal Display
Arduino Reads Temperature Sensor Displays Temperature on LCD Display
Arduino with MCP4725 12-bit Digital-to-Analog Converter Demo
Videos
Arduino with ADS1115 4-Channel 16-bit Analog-to-Digital Converter
Arduino with MCP4725 12-Bit DAC

Videos:
My YouTube Videos on Electronics
Introduction to the Arduino Microcontroller
Part 1: Programming Arduino Output
Part 2: Programming Arduino Input
Part 3: Arduino Analog to Digital Conversion
Part 4: Using Arduino Pulse-Width-Modulation
Repost Arduino AC Power Control

Comparator Theory Circuits Tutorial


Constant Current Circuits with the LM334
LM334 CCS Circuits with Thermistors, Photocells
LM317 Constant Current Source Circuits
TA8050P H-Bridge Motor Control
All NPN Transistor H-Bridge Motor Control
Basic Triacs and SCRs

© Copyright 2018 Lewis Loflin E-Mail

http://www.bristolwatch.com/solar_charger.htm 5/5

Das könnte Ihnen auch gefallen