Batch 17 ME
Batch 17 ME
A PROJECT REPORT
Submitted by
Of
BACHELOR OF ENGINEERING
In
CHENNAI 600069
1|Page
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
2|Page
ACKNOWLEDGEMENT
First of all, we bow our heads to the God Almighty for his everlasting grace in all
our endeavors.
It is a pleasure to thank the people who have made this project possible and have
given their encouragement, assistance and support throughout the whole process of the
completion of my project at Chennai Institute of Technology.
Our sincere thanks to Dr. A.RAMESH M.E. , Ph.D Principal, Chennai Institute
of Technology, for his valuable suggestions, moral support and encouragement towards
completing this project work.
3|Page
ABSTRACT
4|Page
Table of content
Appendix A 43
Appendix B 44
5|Page
CHAPTER 1
INTRODUCTION
1.1 GENERAL
Extracting useable electricity from the sun was made possible by
the discovery of the photoelectric mechanism via a semiconductor device which
converts photon energy into electrical energy. Solar energy generation offers the
advantages of: clean, non-polluting energy generation, production of energy close
to the consumer the very less maintenance requirement, and of having a very long
lifetime. Due to these advantages, today, the photovoltaic is one of the fastest
growing markets in the world. However, PV power is still considered to be
expensive, and the cost reduction of PV systems is subject to extensive research.
From the point of view of power electronics, this goal can be approached by
maximizing the energy output of a given PV array. The inverter should ensure the
highest possible conversion efficiency, while the requirement for the MPPT control
is to operate the PV array at the optimum working point (MPP) in all
environmental conditions. A considerable amount of PV capacity today is installed
in temperate climate zones. Although modern PV inverters’ MPPT efficiency is
very high in stable conditions, further research is needed to achieve similar
performance levels in variable conditions. The primary objective of this project is
to build efficient solar charger that will recharge the battery properly with
minimum loss with overcoming the voltage variation in solar panel. This charge
controller will protect the battery from overcharge and deep discharge. It will
maximize the solar generation by MPPT method. The proposed system is to
present a novel cost effective and efficient arduino based MPPT system for solar
photovoltaic system to ensure the maximum power point operation at all changing
Environmental condition.
6|Page
algorithm in terms of extraction of the maximum power point(MPP) form PV
panel.
8|Page
CHAPTER 2
PHOTOVOLTAIC SYSTEM
The generation of electric current happens inside the depletion zone of the p-n
junction. The area around the p-n junction is called the depletion zone where the
electrons from the “n-type” silicon, have diffused into the holes of the “p-type”
material. Whenever a photon of light hits the surface and is absorbed by one of
these atoms in the “n-type” silicon it will dislodge an electron, thus creating a free
electron and a hole. The free electron and hole produced have sufficient energy to
jump out of the depletion zone. If a wire is connected from the cathode (n-type
silicon) to the anode (p-type silicon) electrons will flow (current) through the wire.
The electron is attracted to the positive charge of the “p-type” material and travels
through the external load creating a flow of electric current. The hole which is
9|Page
created by the freed electron is attracted to the negative charge of “n-type” material
and drifts to the back electrical contact. As the electron enters the “p-type” silicon
from the back electrical contact it combines with the hole reestablishing the
electrical neutrality. By connecting large numbers of these cells into modules, the
cost of photovoltaic electricity gets reduced to certain amount per kilowatt-hour.
The simplest solar cells provide small amounts of power for watches and
calculators. There are more complex systems which can provide electricity to
houses and electric grids.
The PV devices can be made using different types of semiconductor materials and
can be arranged in various structures. There are mainly three types of materials
used for solar cells which are silicon, polycrystalline thin films, and single
crystalline thin film.
12 | P a g e
From the Fig: 2.5 it can be seen that the MPP depends on certain
conditions such as the irradiance for instance which is given by the symbol ‘G’. At
different values of G from the graph it can be seen how the values of MPP has
slightly shifted. It is hence the work of charge controller using certain algorithm to
calculate the MPP at every instance providing the maximum power hence making
the system more efficient. In these applications, the load can demand more power
than the PV system can deliver. There are many different approaches to
maximizing the power from a PV system, this range from using simple voltage
relationships to more complexes multiple sample based analysis.
13 | P a g e
2.6 Constant Voltage Method:
The constant voltage method is quite a simple method but an
inefficient method. This method simply uses single voltage to represent the system.
In some cases this value is set by an external resistor connected to a current source
pin of the control IC. For the various different irradiance variations, the method
will collect about 80% of the available maximum power. The actual performance
will be determined by the average level of irradiance. Since the maximum power
point of a solar PVF module does not always lie between 70-80 percent of Voc,
this is why the tracking efficiency is low in this case.
The VOC is the open circuit voltage of the PV Panel. The k value is
typically between to 0.7 to 0.8 as it is always less than unity (commonly used as
0.76). It is necessary to update VOC occasionally to compensate for any
temperature change. Sampling the VOC value can also help correct for temperature
changes and to some degree changes irradiance. Monitoring the input current can
indicate when the VOC should be re-
14 | P a g e
measured. The k value is a function of the logarithmic function of the irradiance,
increasing in value as the irradiance increases.
15 | P a g e
No input is required for this method
16 | P a g e
output power starts declining. Once the output power starts decreasing, the voltage
to the cell is decreased until the point when the maximum power is reached. This
process is continued until the MPPT is attained. This results in an oscillation of the
output power around the MPP. The PV module’s output power curve is a function
of the voltage (P-V curve), at the constant irradiance and the constant module
temperature, it is also assumed that the PV module is operating at a point which is
away from the maximum power point. Now if the operating voltage of the PV
module is perturbed by a minute amount the resulting power P is then observed. If
it is seen that the P is positive, then in that case it is supposed that it has moved the
operating point closer to the MPP. Hence further voltage perturbations in the same
direction will continue moving the operating point toward the MPP. If the P is
negative, in that case the operating point will be moving away from the MPP and
the path of perturbation should be inverted to move back toward the MPP.
So if the MPP lies on right side, dl/dV < -I/V and then the Photo Voltaic voltage
must be reduced to reach the MPP. In order to find the MPP IC method can be
used, it has been known to improve the PV efficiency, reduce power loss and also
the system cost. When IC method is implemented in a microcontroller it is seen to
produce a much more stable performance compared to P&O method. The
18 | P a g e
procedure starts with measuring the present values of PV module voltage and
current. Then, it computes the incremental changes, dI (change in current) and dV
(change in voltage), which uses the present and previous values of the voltage and
current. With the help of the relationships in the equations mentioned above the
main check is then done. If the condition satisfies the inequality equation shown
above, it is assumed that the operating point is at the left side of the MPP thus must
be moved to the right by increasing the module voltage. Similarly, if the condition
satisfies the inequality equation it is assumed that the operating point is at the right
side of the MPP, thus must be moved to the left by decreasing the module voltage
Benefits:
It is able to successfully detect any changes in the irradiation and shift its
MPP value by adjusting the duty cycle.
It has a good tracking efficiency
This method reduces oscillation around the MPP point
It is able to reduce power loss and system cost as well
Drawbacks:
The computational time is increased due to slowing down of the sampling
Frequency resulting from the higher complexity of the algorithm compared
to the P&O method.
19 | P a g e
CHAPTER-3
BUCK CONVERTER
3.1 INTRODUCTION:
DC- DC converter or switch is a voltage converter which converts
voltage level. Among other converters, Buck converter is a ubiquitously used for
converting a high voltage to a low voltage efficiently. We used buck converter so
that we can vary input voltage as our output battery is fixed in this case. A buck
converter circuit is shown below:
20 | P a g e
On the other hand switch on period when switch off that means the
circuit is open and because of forward biased condition the diode is closed. At that
time charge or current through inductor decreases that means inductor started to
discharge through the diode and RC combination till off period.
21 | P a g e
D = Duty ratio
d(iL) = Change in inductance current
Fs = Switching frequency
The value of capacitor is determined by:
C = (1-D) / 8L(dV0/V0)Fs
Where,
C = Capacitance
D = Duty ratio
(dV0/V0) = Output voltage ripple
Fs = Switching frequency
Value of components:
22 | P a g e
CHAPTER 4
HARDWARE SECTION
4.1 Panel specifications:
The PV module we used is based on polycrystalline silicon diode.
Usually, this type of PV module is used in home usage, projectbased work where
the cost should be in a reasonable range. The specifications provided with our PV
module is given below.
Power (max): 15W
Cell type & efficiency: polycrystalline
Dimensions:285 mm *350 mm *22 mm
Tolerance: 0 ~ ±3 %
Voltage at maximum point (V mp):18 V
Current at maximum point (I mp) :1.25 A
Open circuit voltage (Voc): 19V
Short circuit current (I sc): 0.84A
Module application: class A
Test condition: 1000W/m2, AM 1.5, 25°C
The Arduino board exposes most of the microcontroller's I/O pins for
use by other circuits. The Diecimila, Duemilanove, and current Uno provide 14
digital I/O pins, six of which can produce pulse-width modulated signals, and six
analog inputs. These pins are on the top of the board, via female 0.10-inch (2.5
mm) headers. Several plug-in application shields are also commercially available.
ARDUINO UNO
Figure 15:Arduino
The Arduino Uno is a microcontroller board based on the
ATmega328. It has 14 digital input/output pins (of which 6 can be used as
PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB
connection, a power jack, an ICSP header, and a reset button. It contains
everything needed to support
24 | P a g e
to the voltage provided from the board. In future, shields will be compatible both
with the board that use the AVR, which operate with 5V and with the Arduino Due
that operate with 3.3V. The second one is a not connected pin, which is reserved
for future purposes.
"Uno" means one in Italian and is named to mark the upcoming
release of Arduino 1.0. The Uno and version 1.0 will be the reference versions of
Arduino, moving forward. The Uno is the latest in a series of USB Arduino boards,
and the reference model for the Arduino platform.
SUMMARY:
Schematic & Reference Design:
25 | P a g e
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart)
or battery. The adapter can be connected by plugging a 2.1mm center-positive plug
into the board's power jack. Leads from a battery can be inserted in the Gnd and
Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five volts
and the board may be unstable. If using more than 12V, the voltage regulator may
overheat and damage the board. The recommended range is 7 to 12 volts.
MEMORY:
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It
also has 2 KB of SRAM and 1 KB of EEPROM.
Input and Output:
Each of the 14 digital pins on the Uno can be used as an input or
output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate
at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an
internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition,
some pins have specialized functions:
Serial: 0 (RX) and 1 (TX): Used to receive (RX) and transmit (TX)
TTL serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.
26 | P a g e
External Interrupts: 2 and 3: These pins can be configured to
trigger an interrupt on a low value, a rising or falling edge, or a change in value.
See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11: Provide 8-bit PWM output with the
analogWrite() function.
LED: 13: There is a built-in LED connected to digital pin 13. When the
pin is HIGH value, the LED is on, when the pin is LOW, it's off. The Uno has 6
analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though
is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized
functionality:
Communication:
The Arduino Uno has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega328 provides
UART TTL (5V) serial communication, which is available on digital pins 0 (RX)
and 1 (TX). An ATmega16U2 on the board channels this serial communication
over USB and appears as a virtual com port to software on the computer. The
'16U2 firmware uses the standard USB COM drivers, and no external driver is
needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from
27 | P a g e
the Arduino board. The RX and TX LEDs on the board will flash when data is
being transmitted via the USB-to-serial chip and USB connection to the computer
(but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of
the Uno's digital pins. The ATmega328 also supports I2C (TWI) and SPI
communication. The Arduino software includes a Wire library to simplify use of
the I2C bus. For SPI communication, use the SPI library.
PROGRAMMING:
The Arduino Uno can be programmed with the Arduino software
.Select "Arduino Uno from the Tools > Board menu (according to the
microcontroller on your board). The ATmega328 on the Arduino Uno comes
preburned with a boot loader that allows you to upload new code to it without the
use of an external hardware programmer. It communicates using the original
STK500 protocol (reference, C header files).
You can also bypass the boot loader and program the microcontroller
through the ICSP (In-Circuit Serial Programming) header. The ATmega16U2 (or
8U2 in the rev1 and rev2 boards) firmware source code is available. The
ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then resetting the 8U2.
Physical Characteristics:
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the
former dimension. Four screw holes allow the board to be attached to a surface
or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not
an even multiple of the 100mil spacing of the other pins.
28 | P a g e
4.3 CURRENT SENSING:
To sense the current generated by the PV module in different
conditions we used a hall-effect current sensor that is manufactured commercially
for sensing AC, DC current to use in industrial or research or communication
systems. Most importantly, it is the most preferable microchip assembled Ic to be
used with microcontrollers as Arduino. (MicroSystems, 2016)
29 | P a g e
fig: 4.3 calibration procedure
For establishing the currents sensing equation we tested the current sensor and
gathered calibration data. We set up the sensor with our 50w PV module. The
connections were made as the pin outs configuration described above. With the help
of the Arduino we ran the program and we varied the supplied current of the PV
module by shading it partially or fully and collected data for 10 instances. Than we
put the data in MATLAB and did regression analysis. Henceforth, we used polyfit
function of MATLAB to get the most fitted output and to establish our equation.
The equation we got is Y = 1.5625*(X)-3.7375
30 | P a g e
CHAPTER 5
Design and implementation:
Schematics of the complete circuit with connectors to Arduino and Solar input
31 | P a g e
I-V AND P-V CHARACTERISTICS CURVE:
32 | P a g e
DATA COLLECTED:
33 | P a g e
CHAPTER 6
Conclusion:
6.1 SUMMARY:
In the final analysis, this thesis presents an efficient photo
voltaic system with the capability of tracking the maximum power point
using incremental conductance method. Each components of this system
such as the solar panel, charge controller, DC-DC converter has all been
discussed about. The coding in terms of embedded language in Arduino
and MATLAB simulations of the I-V characteristics for load and
irradiations variation has been presented. Since the purpose of this thesis
was to design a more efficient MPPT solar charge controller using an
Arduino, so we have explained the maximum power point tracking and
the procedure we have followed to achieve that point. The use of an
Arduino and its advantages has been provided in this thesis along with
the converter used for our design of the solar charge controller. We have
later done the hardware implementation and we collected data to
differentiate the efficient method.
34 | P a g e
References:
1.GUIZA Dhaouadi, OUNNAS Djamel, SOUFI Youcef, CHENIKHE
Salah “Implementation of Incremental Conductance Based MPPT
Algorithm for Photovoltaic System”.
35 | P a g e
7. Kotak, V.C. and Tyagi, P. (2013) “DC To DC Converter in
Maximum Power Point Tracker’, International Journal of
Advanced Research in Electrical, Electronics and Instrumentation
Engineering, 2(12)”.
36 | P a g e
APPENDIX A
Code implemented:
#include <PWM.h>
#define panelMeter A0 // Analog input pin for PV voltmeter
#define batteryMeter A1 // Analog input pin for battery voltmeter
#define driver 3// PWM output pin to mosfet driver (needs to be 3 or 11 with safe timer)
#define shutDown 5 // connected to shutdown pin of mosfet driver (needs to be a PWM pin)
#define fan 6 // digital pin controlling the fan (needs to be a PWM pin)
#define load 4 // digital pin controlling the load MOSFET (use 4 because
PWM is not needed)
#define Vbulk 130 // Bulk voltage set-point (deci Volts)
#define lowBatt 110 // Low battery voltage set-point (deci Volts)
#define Vmax 150 // Maximum voltage the batteries should hit before
throwing an error (deci Volts)
#define check 15000 // 15 seconds in milliseconds
#define Vfloat 136 // Float voltage set-point (deci Volts)
long panelVolts = 0; // Solar panel Voltage (deci Volts)
long batteryVolts = 120; // Battery Voltage (deci Volts)
long Voc = 0; // Panel open-circuit voltage (deci Volts)
long Vcvm = 0; // Estimted voltage for MPP with CVM (deci Volts)
int pulseWidth = 100; // Digital value of pwm (should never be 0 or 255)
int lastpulseWidth = 100; // remember the value of pulseWidth for random resets
int pwm = 0; // Percentage of PWM
int b = 1; // do once
int stepAmount = 1; // Scaling factor of pwm for large differences in voltage
int inByte = 0; // incoming serial byte
int panelADC = 0; // for sending through serial
int batteryADC = 0; // for sending through serial
int state = 0; // for sending through serial
int LEDstate = LOW; // to record the state of the LED
//int errorCount = 0; // record the # of times an error has occurred
int32_t frequency = 40000; // Frequency (in HZ)
unsigned long time = 0; // Timer variable for timed charging cycles
unsigned long time2 = 0; // Second timer variable for blink cycles
String enable = "starting"; // string of text to show enable pin of MOSFET driver
String SOC = "Initializing"; // string of text to show the charger state
String Load = "Off"; // string of text to show the load state
enum charger_mode {no_battery, sleep, bulk, Float, error} charger_state; // enumerated
variable that holds state for charger state machine
void setup() {
Serial.begin(115200) // faster communication means faster tracking and less voltage
overshoot / undershoot
37 | P a g e
pinMode(13, OUTPUT); // set the LED pin as an output
pinMode(load, OUTPUT)// set the load pin as an output
pinMode(shutDown, OUTPUT);// set the shutDown pin as an output
pinMode(fan, OUTPUT);// set the fan pin as an output
disable_charger();// make sure the MOSFET driver is off
InitTimersSafe();// This is part of the PWM library. It allows you to set almost any PWM
frequency you want
charger_state = sleep; // start with charger state as sleep
bool success = SetPinFrequencySafe(driver, frequency);// if setting the frequency to the
desired pin was successful
if(success){
digitalWrite(13, HIGH);// turn on the LED
Serial.println("Timer frequency set success!");//and print it to the serialport
}
else{ // if not,
digitalWrite(13, LOW); // keep the LED off
Serial.println("Timer frequency set failed!");// and print it to the serialport
}
update_Vcvm();
//establishContact(); // send a byte to establish contact until receiver responds
(use with sendtogui)
}
void loop() { // Main loop
read_data(); // read the analog inputs
mode_select(); // use that info to decide what charging state we should be in
set_charger(); // run the selected charger sequence
run_load(); // turn the load on or off, depending on the battery voltage
run_fan(); // turn the fan on or off, depending on the charging cycle
//Use only one of these 2:
//sendtogui(); // for use with processing sketch
print_data(); // print data to the serial port so that humans know what you're doing
}
void read_data() { // function for reading analog inputs
panelVolts = 0;
for(int i=0;i<100;i++){
panelVolts += analogRead(panelMeter); // read the panel voltage 100 times and add the
values together
}
batteryVolts = 0;
for(int i=0;i<100;i++){
batteryVolts += analogRead(batteryMeter); // read the battery voltage 100 times
and add the values together
}
38 | P a g e
panelVolts = panelVolts/100; // Divide by 100 to get the average value
batteryVolts = batteryVolts/100;// Divide by 100 to get the average value
//panelADC = panelVolts; // for sending through serial (use with sendtogui)
//batteryADC = batteryVolts; // for sending through serial (use with sendtogui)
//panelADC = panelADC/4;// for sending through serial (use with sendtogui)
//batteryADC = batteryADC/4; // for sending through serial (use with sendtogui)
panelVolts = (panelVolts*488)/1197;// multiply the averaged ADC value by the scaling
factor to get a number in deci volts
batteryVolts = (batteryVolts*488)/2441;// multiply the averaged ADC value by the
scaling factor to get a number in deci volts
}
void mode_select(){
if (batteryVolts < 100) charger_state = no_battery ; // If battery voltage is below
10, there is no battery connected or dead / wrong battery
else if (batteryVolts > Vmax) charger_state = error;
// If battery voltage is over 15, there's a problem
else if ((batteryVolts > 100) && (batteryVolts < Vmax) && (panelVolts > Vmax)){
// If battery voltage is in the normal range and there is light on the panel
if (batteryVolts >= (Vfloat-1)) charger_state = Float;
// If battery voltage is above 13.5, go into float charging
else charger_state = bulk;
// If battery voltage is less than 13.5, go into bulk charging
}
else if (panelVolts < Vmax){
// If there's no light on the panel, go to sleep
charger_state = sleep;
}
}
void set_charger(){ // function for selecting the charging state
39 | P a g e
pulseWidth = 100;
break;
case bulk: // the charger is in the bulk state
SOC = "Bulk";
CVM(); // begin the MPPT algorithm
run_charger(); // enable the MOSFET driver
digitalWrite(13, HIGH); // turn the LED on to indicate bulk
state = 2;
break;
case Float: // the charger is in the float state, it uses PWM instead of MPPT
SOC = "Float";
pulseWidth = 245;// set the pulseWidth to max (MPP doesn't matter when the battery is
full)
if (batteryVolts < Vfloat) run_charger(); // If battery voltage is below 13.6
enable the MOSFET driver
else disable_charger(); // If above, disable the MOSFET driver
digitalWrite(13, LOW); // Turn the LED off to indicate float
state = 3;
break;
case error: // if there's something wrong
disable_charger();// turn off the MOSFET driver
error_blink(); // blink LED to indicate an error
SOC = "Error";
state = 4;
//errorCount++;
break; // this state needs a reset to escape from
default: // if none of the other cases are satisfied,
disable_charger(); // turn off the MOSFET driver
error_blink(); // blink LED to indicate an error
SOC = "Off";
break;
}
}
void run_charger(){
pulseWidth = constrain (pulseWidth, 75, 245); // prevent overflow of pulse width
and not fully on or off for the charge pump
pwm = map(pulseWidth, 0, 255, 0, 100); // use pulseWidth to get a % value and
store it in pwm
pwmWrite(driver, pulseWidth); // send the new pulseWidth to the MOSFET driver
digitalWrite(shutDown, HIGH); // enable the MOSFET driver (enabling should always
be done after sending pulseWidth)
enable = "On";
}
40 | P a g e
void disable_charger(){
digitalWrite(shutDown, LOW); // disable the MOSFET driver
(disabling should always be done before sending pulseWidth)
enable = "Off";
}
void CVM(){ // Constant Voltage Method MPPT without a high voltage limit (doesn't need
an ammeter)
while(b > 0){ // do this once
time = millis(); // read millis and store in variable
b--;
}
if((millis() - time) >= check){ // if it's been more than the check time:
update_Vcvm();
}
//if (Vcvm < batteryVolts) Vcvm = (batteryVolts + 10); // to fix a stutter on initial
startup
stepAmount = (Vcvm - panelVolts)/10; // take bigger steps when the voltage is far
from the target
if (stepAmount < 1) stepAmount = 1; // the minimum step has to be one
if (panelVolts > Vcvm){ // if the calculated MPP voltage is lower than the panel
voltage,
if (pulseWidth < 245){ // this is to keep pulseWidth from overflowing
pulseWidth = pulseWidth + stepAmount; // put more load on the panel
}
else pulseWidth = 245; // this is to keep pulseWidth from overflowing
}
else if(panelVolts < Vcvm){ // or if the panel voltage is less than the calculated
MPP voltage,
if (pulseWidth > 75){ // this is to keep pulseWidth from overflowing
pulseWidth = pulseWidth - stepAmount; // remove some of the load from the panel
}
else pulseWidth = 75; // this is to keep pulseWidth from overflowing
}
}
void update_Vcvm(){
disable_charger(); // disable the MOSFET driver
delay(10); // wait for the voltage to level out
Voc = 0;
for(int i=0;i<100;i++){
Voc += analogRead(panelMeter); // read the panel voltage 100 times and
add the values together
}
Voc = Voc/100;
41 | P a g e
Voc = (Voc*488)/1197; // multiply it by the scaling factor to produce
a number in deci Volts
Vcvm = (Voc*76)/100; // Vcvm is 76% of Voc
b = 1; // reset the timer
}
void run_fan(){
switch(charger_state){
case bulk:
digitalWrite(fan, HIGH);
break;
default:
digitalWrite(fan, LOW);
break;
}
}
void run_load(){
if (batteryVolts > lowBatt){ // If the battery voltage is above 11V
digitalWrite(load, LOW); // Turn on the load MOSFET (LOW)
Load = "On"; // Write it in a string so that we can see it on the serial port
}
else{ // If the battery voltage is below 11V
digitalWrite(load, HIGH); // Turn off the load MOSFET (HIGH)
Load = "Off"; // Write it in a string so that we can
see it on the serial port
}
}
void error_blink(){ // function for blinking the LED when there is an error
if((millis() - time2) >= 200){ // fast 1/5 second blink without delay
LEDstate = !LEDstate;
digitalWrite(13, LEDstate);
time2 = millis();
}
}
void sleep_blink(){ // function for blinking the LED when
sleeping
if((millis() - time2) >= 2000){ // slow 2 second blink without delay
LEDstate = !LEDstate;
digitalWrite(13, LEDstate);
time2 = millis();
}
}
void establishContact() {
while (Serial.available() <= 0) {
42 | P a g e
Serial.print('A'); // send a capital A
delay(300);
}
}
void sendtogui() {
if (Serial.available() > 0) {
inByte = Serial.read();
Serial.write(panelADC);
Serial.write(batteryADC);
Serial.write(pwm);
Serial.write(state);
}
}
void print_data() { // Print all the information to the serial port
Serial.print("Voc:");
Serial.print(Voc);
Serial.print("\t");
Serial.print("Vpanel:");
Serial.print(panelVolts);
Serial.print("\t");
Serial.print("Vcvm:");
Serial.print(Vcvm);
Serial.print("\t");
Serial.print("Vbatt:");
Serial.print(batteryVolts);
Serial.print("\t");
Serial.print("PWM:");
Serial.print(pwm);
Serial.print("%");
Serial.print("\t");
Serial.print("pulseWidth:");
Serial.print(pulseWidth);
Serial.print("\t");
Serial.print("Enabled:");
Serial.print(enable);
Serial.print("\t");
Serial.print("Charger State:");
Serial.print(SOC);
Serial.print("\t");
Serial.print("Load State:");
Serial.println(Load);
43 | P a g e
APPENDIX-B
44 | P a g e
45 | P a g e
FEATURES
·Drain Current –ID=49A@ TC=25℃
·Drain Source Voltage-
: VDSS= 55V(Min)
·Static Drain-Source On-Resistance
: RDS(on) = 0.032Ω(Max)
·Fast Switching
DESCRIPTION
·Designed for low voltage, high speed switching
applications in power supplies, converters and power
motor controls, these devices are particularly well
suited for bridge circuits where diode speed and
commutating safe operating areas are critical and
offer additional safety margin against unexpected
voltage transients.
46 | P a g e
THERMAL CHARACTERISTICS
SYMBOL PARAMETER MAX UNIT
Thermal Resistance,
Rth j-c 1.5 ℃/W
Junction to Case
Thermal Resistance,
Rth j-a 62 ℃/W
Junction to Ambient
isc Website:www.iscsemi.cn
INCHANGE Semiconductor isc Product Specification
ELECTRICAL CHARACTERISTICS
TC=25℃ unless otherwise specified
Drain-Source Breakdown
V(BR)DSS VGS= 0; ID= 0.25mA 55 V
Voltage
Drain-Source On-
RDS(on) VGS= 10V; ID= 25A 0.032 Ω
Resistance
Gate-Body Leakage
IGSS VGS= ±20V;VDS= 0 ±100 nA
Current
VDS= 55V; VGS= 0
Zero Gate Voltage Drain 25
IDSS VDS= 55V; VGS= 0; Tj= μA
Current 250
150℃
47 | P a g e