MPPT DIY
MPPT DIY
MPPT DIY
A solar panel will generate different voltages depending on the different parameters like :
1.The amount of sun light 2.The connected load 3.The temperature of the solar panel.
Throughout the day, as the weather changes, the voltage produced by the solar panel will be
constantly varying. Now, for any given voltage, the solar panel will also produce a current
(Amps). The amount of Amps that are produced for any given voltage is determined by a graph
called an IV curve, which can be found on any solar panel's specification sheet and typically
looks like the figure-1 shown above.
In the above figure-2, the blue line shows a solar panel voltage of 30V corresponding to a
Current of about 6.2A. The green line shows a Voltage of 35V corresponds to a current of 5A.
In the picture shown above as you move along the red curve above you will find one point where
the Voltage multiplied by its corresponding Current is higher than anywhere else on the curve.
This is called the solar panel's Maximum Power Point (MPP).
Ref : I have downloaded the images from web ( www.solarquotes.com.au ) to explain the MPP.
What Is MPPT ?
MPPT stands for Maximum Power Point Tracking. MPPT charge controllers used for extracting
maximum available power from PV module under certain conditions. Look at the image shown
above. We have seen that the maximum power point (MPP) of a solar panel lies at the knee of
the current and voltage curve.
A 12V solar panel is not really a 12V panel at all.Its really a somewhere in between 12V and
21V panel depending on what load is connected to it and how bright the sunlight is.The panel has
an internal resistance which changes dynamically with differing irradiance levels. Solar panels
will only deliver their rated power at one specific voltage and load, and this voltage and load
moves around as the sunlight intensity changes.
For example take a solar panel rated at 100 watts, 18V at 5.55 amps.
The 18 V at 5.5 amps means that the Solar panel wants to see a load of 18/5.5 = 3.24 ohms.
With any other load the panel will deliver less than 100 watts.So if a static load is connected
directly to a panel and its resistance is higher or lower than the panels internal resistance at MPP,
then the power drawn from the panel will be less than the maximum available.
Taking a simple example say we connected the above 100W panel directly to a 12V lead acid
battery, the panel voltage would be dragged down near to the load voltage of the battery as the
batteries resistance is lower than the panels, but the current stays the same at 5.55 amps.This
happens because Solar Panels behave like current sources, so the current is determined by the
available sunlight.
Now the power (P)= V x I = 12x5.55=66.6W. So the Solar panel is now behaving like a 66 watt
panel.
This is the reason for using a MPPT charge controller instead of a standard charge controller like
PWM. The MPPT controller is consists of a DC -DC converter where the duty cycle is varied to
track the Maximum Power Point.
Working Principle :
When the MOSFET is ON, current flows through the inductor (L) , load (R) and the output
capacitor (C ) as shown in the fig-2. In this condition the diode is reverse biased.So no current
flows through it. During the ON state magnetic energy is stored in the inductor and electrical
energy is stored in the output capacitor.
When the MOSFET is off, stored Energy in the Inductor is collapsed and current complete its
path through the diode ( forward biased) as shown in fig-3.When stored energy in the inductor
vanishes, stored energy in the capacitor is supplied to load to maintain the current.
In the above topology the diode used have considerable amount of voltage drop which reduced
the efficiency of the Converter.To improve the efficiency a Power electronics switch is used in
its place.Thus a synchronous buck converter is a modified version of the basic buck converter
circuit topology in which the diode, D, is replaced by a electronics switch like MOSFET( Q2). It
is shown in fig-4.
I would like to give special credit to coder-tronics from which I have taken this explanation part
of buck converter.
Step 4: BUCK CONVERTER DESIGN
In our case the input source is a 50W solar panel and load is a 12V lead acid battery.From the
earlier discussion we have conclude that a buck converter is consist of
1.Inductor
2.Capacitor
3.MOSFETS
Selecting the frequency: The switching frequency is inversely proportional to the size of the
inductor and capacitor and directly proportional to the switching losses in MOSFETs. So higher
the frequency, lower the size of the inductor and capacitor but higher switching losses.So a
mutual trade off between cost of the components and efficiency is needed to select the
appropriate switching frequency.
Calculating the inductor value is most critical in designing a buck converter. First, assume the
converter is in continuous current mode( CCM). CCM implies that the inductor does not fully
discharge during the switch-off time. The following equations assume an ideal switch (zero on-
resistance, infinite off-resistance and zero switching time) and an ideal diode.
Assume
Calculation
L= ( Vin-Vout ) x D x 1/Fsw x 1/ dI
For a good design typical value of ripple current is in between 30 to 40 % of load current.
Winding by hand is very painful for skin as well as you can't make the winding so tight.So I
made a simple tool from popscile stick for winding the toroidal core.This simple tool is very
handy and you can make perfect and tight winding.Before making the inductor you have to know
the core specification and number of turns.
1. Outer diameter(OD)
2.Inner diameter(ID)
3.Height (H)
4.Al value
As I did not know the part number,I used a indirect method to identify it.First I measure the OD
and ID of the unknown core by using my vernier caliper,it was around
OD= 23.9mm (.94'") , ID= 14.2mm(.56") ,H= 7.9mm( .31") and yellow white in color.
I used a toroid core chart (page-8) to identify the unknown core.I have attached this toroid size
chart in the bellow.It contains a lot of information for the inductor design.The PDF version is
attached bellow.
I searched the Physical dimension table from the chart. From the table it was found that the core
is T94
The color of the core is indication for mix number.As my core is is yellow/white in color,it is
confirmed that the mix number is 26
Finding Al value :
From the Al value table for a T94-26 core it is 590 in uH/100 turns.
After selecting the core now time to find out the number of turns required to obtain the desired
inductance.
Number of turn (N) = 100 x sqrt( desired inductance in uH / Al in uH per 100 turns)
You can also use this online calculator for finding the number of turns.Only you have to know
the part number and mix number.
Then I wind a 20 AWG copper wire (24 turns) around the the toroid core.At the both end of the
winding leave some extra wire for connection lead.After this remove the enamel insulation from
the lead. I used my leatherman file for removing the insulation. See the above picture for better
understanding.
Note : Making a good inductor is not so simple.I am still in learning stage.If you are not so
confident I will recommend to buy a ready made inductor.
1.Voltage Rating : Vds of MOSFET should be greater than 20% or more than the rated voltage.
2.Current Rating: Ids of MOSFET should be greater than 20% or more than the rated current.
3.ON Resistance (Rds on) : Select a MOSFET with low ON Resistance (Ron)
4.Conduction Loss : It depends on Rds(ON) and duty cycle.Keep the conduction loss minimum.
5.Switching Loss: Switching loss occurs during the transition phase.It depends on switching
frequency,voltage ,current etc.Try to keep it minimum.
These are few links where you can get more information on selecting the right MOSFET.
In our design the maximum voltage is solar panel open circuit voltage(Voc) which is nearly 21 to
25V and maximum load current is 5A.
I have chosen IRFZ44N MOSFET. The Vds and Ids value have enough margin as well as it has
low Rds(On) value.
A Mosfet driver allows a low current digital output signal from a Microcontroller to drive the
gate of a Mosfet. A 5 volt digital signal can switch a high voltage mosfet using the driver.A
MOSFET has a gate capacitance that you need to charge so that the MOSFET can turn on and
discharge it to switch off,the more current you can provide to the gate the faster you switching
on/off the mosfet, that is why you use a driver.
For this design I am using a IR2104 Half Bridge driver. The IC takes the incoming PWM signal
from the micro controller, and then drives two outputs for a High and a Low Side MOSFET.
How to use it ?
From the data sheet I have taken the image shown above.
Input :
First we have to provide power to the gate driver.It is give on Vcc (pin-1) and its value is in
between 10-20V as per data sheet.
The high frequency PWM signal from Arduino goes to IN (pin-2) . The shut down control signal
from the Arduino is connected on SD ( pin 3).
Output :
The 2 output PWM signals are generated from HI and LO pin. This gives the user the
opportunity to fine tune the dead-band switching of the MOSFETs.
The input power connector to the solar panels is the screw terminal JP1 and JP2 is the output
screw terminal connector to the battery.The third connector JP3 is connection for the load.
The buck converter is made up of the synchronous MOSFET switches Q2 and Q3 and the energy
storage devices inductor L1 and capacitors C1 and C2 The inductor smooths the switching
current and along with C2 it smooths the output voltage.Capacitor C8 and R6 are a snubber
network,used to cut down on the ringing of the inductor voltage generated by the switching
current in the inductor.
The third MOSFET Q1 is added to allow the system to block the battery power from flowing
back into the solar panels at night.In my earlier charge controller,this is done by a diode in the
power path. As all diodes have a voltage drop a MOSFET is much more efficient.Q1 turns on
when Q2 is on from voltage through D1. R1 drains the voltage off the gate of Q1 so it turns off
when Q2 turns off.
The diode D3 (UF4007) is an ultra fast diode that will start conducting current before Q3 turns
on. It is supposed to make the converter more efficient.
The IC IR2104 is a half bridge MOSFET gate driver. It drives the high and the low side
MOSFETs using the PWM signal from the arduino (Pin -D9) .The IR2104 can also be shut down
with the control signal (low on pin -D8) from the Arduino on pin 3. D2 and C7 are part of the
bootstrap circuit that generates the high side gate drive voltage for Q1 and Q2. The software
keeps track of the PWM duty cycle and never allows 100% or always on. It caps the PWM duty
cycle at 99.9% to keep the charge pump working.
There are two voltage divider circuits( R1,R2 and R3,R4) to measure the solar panel and battery
voltages.The out put from the dividers are feeds the voltage signal to Analog pin-0 and Analog
pin-2 .The ceramic capacitors C3 and C4 are used to remove high frequency spikes.
The mosfet Q4 is used to control the load.The driver for this mosfet is consists of a transistor and
resistors R9 ,R10.
The diode D4 and D5 are TVS diodes used for over voltage protection from solar panel and load
side.
The current sensor ACS712 sense the current from the solar panel and feeds to the Arduino
analog pin-1.
The 3 LEDs are connected to the digital pins of the microcontroller and serve as an output
interface to display the charging state.
The back light switch is to control the back light of LCD dislay.
As I have told earlier the heart of the MPPT charge controller is Buck Converter.As per me if
your buck converter circuit work perfectly.You can do the rest thing easily.So first lets test the
Mosfets switching and the driver.
Before soldering ,I request to do it on a bread board.I have blown lot of MOSFETs during my
testing.So be careful during the connection.
Connect the everything as per schematic given above.Now you can omit the TVS diode,current
sensor and voltage divider.
After connecting everything test the resistance between the input rail.It should be several KOhm.
If you get resistance bellow 1K then recheck the circuit connection.
Upload the test sketch to the Arduino.The code in the form of text file is attached bellow.
If everything goes right then proceed to complete the bulk converter circuit.( i.e adding inductor
and capacitor)
Test code:
#include <TimerOne.h>
void setup()
pinMode(13, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
digitalWrite(8, HIGH);
void loop()
/// --------------------------
/// --------------------------
void timerIsr()
// Toggle LED
Add the 33uH inductor and 100uf input and 220uF out put electrolytic capacitor as per
schematic.You can also use 0.1uF ceramic capacitors parallel with input and output capacitors.It
will give better result.But it is not mandatory.
Then make the snubber circuit by using a 0.1uF ceramic capacitor and 200ohm resistor.
Again check the resistance in between the input rail.It should be order of K ohm.
The result is shown above .The out put should be a steady DC.
For example if i give 50% duty cycle to a 12 input supply, the output should be 6V in the scope.
After confirmed that everything working fine,now we can add the blocking mosfet Q1.It is used
to block reverse power from battery to the solar panel during night.
Add the third mosfet Q3 as per schematic.Then place the 470k resistance and diode IN4148.
Do you know ? you have done the most critical part of this project.
Voltage Measurement :
As you may well know, Arduino’s analog inputs can be used to measure DC voltage between 0
and 5V (when using the standard 5V analog reference voltage) and this range can be increased
by using two resistors to create a voltage divider. The voltage divider decreases the voltage being
measured to within the range of the Arduino analog inputs. We can use this to measure the solar
panel and battery voltages.
The analogRead() function reads the voltage and converts it to a number between 0 and 1023
Example code :
// read the input on analog pin 0 ( You can use any pin from A0 to A5)
Serial.println(value);
Calibration :
We’re going to read output value with one of the analog inputs of Arduino and its analogRead()
function. That function outputs a value between 0 (0V in input) and 1023 (5V in input)
that is 0,0049V for each increment (As 5/1024 = 0.0049V)
Note : This leads us to believe that a reading of 1023 corresponds to an input voltage of exactly
5.000 volts.
In practical you may not get 5V always from the arduino pin 5V .So during calibration first
measure the voltage between the 5v and GND pins of arduino by using a multimeter,and use
1ADC = measured voltage/1024 instead of 5/1024
The ACS712 sensor read the current value and convert it into a relevant voltage value, The value
that links the two measurements is sensitivity.You can find it on the datasheet.
1. Sensitivity is 185mV/A.
2. The sensor can measure positive and negative currents (range -5A…5A),
3. Power supply is 5V
Calibration:
// If you are not getting 5V from arduino 5V pin then, value = ( Vmeasured/1024 ) * analog
read value
// Vmeasured is the voltage in between Arduino pin 5V and GND. You can measure it by a
multimeter.
But as per data sheets offset is 2.5V (When current zero you will get 2.5V from the sensor's
output)
A 20X4 char LCD is used for monitoring solar panel, battery and load parameters.For simplicity
a I2C LCD display is chosen.It needs only 4 wires to interface with the arduino.In my earlier
design the LCD was consuming lot of power.The main cause was LCD back light.So I add a
push switch to control the back light.By default the back light will be in off condition.If the user
press the switch then it will on for 15 secs and again goes off.
For testing the LCD download the test code attached bellow.
LED indication :
Red ,Green and Yellow leds are used to indicate the battery voltage level.
Low Voltage -- > Red led
Before soldering you should clear about the Power and Control Signal.Do not mix up between
them.Otherwise you will fry everything.
Power Signal :
1.Solar panel -> Fuse -> Current sensor -> Mosfets Q1,Q2 ,Q3 -> Inductor -> Battery.
Control Signals :
1.Signal from the different Sensors to Arduino
I used red and black thick wires ( 0.5 to 0.75 sq mm) for power and ground connections
respectively.
Tips: Print the PDF format Schematics before soldering.Keep it in front of you during soldering
for reference.
The left one is for solar panel,middle one is for battery and the right one is for load connection.
Then connect the left terminal of the solar screw terminal with one leg of the fuse holder.
Then add the input 100uF capacitor.I left some space in between the fuse holder and Capacitor
for installing the current sensor later.
Then solder the male header pins.Be sure the distance between the two rails fits the arduino
nano.
Leave two rows on each side of the female header and then solder the two male headers.
Then short the corresponding male and female pins.Though I forgot this during my soldering.
The female headers is used to mount the Arduino nano and male headers are used for external
connection with the Arduino.
5V Power Supply :
In my previous version I used a LM7805 linear voltage regulator to step down the battery voltage
to 5V for the power supply.But it produces a lot of heat during its working.So I used a high
efficient buck converter in this design.
First connect the battery on the input terminal of the buck converter and adjust the potentiometer
to get 5V out put.
Cut 4 pcs of male header with 2pins in each.Solder the headers as per the holes given in the
converter.
Place the converter on the above 4 header pin and solder on the top.Be sure the input side is
toward the battery screw terminal.
Add the output capacitor(C2) near to the battery screw terminal.The positive terminal of the
capacitor should be on the left.
Then connect the input of the buck converter to the battery screw terminal and output to the 5V
and GND pin of the Arduino Nano.At this stage you can check it.Place the Arduino nano on the
header pin and connect the 12V battery to the screw terminal.If everything is correct then
Arduino power led should glow.
Finally add two rows of male header pins to the side of Arduino 5V and GND pin for external
connection.
Solder the voltage regulator first, then add two 10uF capacitors. One on the input and other on
the output side.
Add 10uF capacitor and and a 0.1uF capacitor in between the pin-1 and pin-4.
Solder the diode (D2) in between pin -1 and 8.The diode cathode should be connect to the pin-8.
Solder two 200ohm resistors ( R7 and R8) just side to the pin-2 and pin-3.
Solder one 470K resistor (R1) near to the mosfet Q1 and a diode (D1) in between gates of
mosfets Q1 and Q2.The diode cathode connects to the gate of Q1.
After this complete the circuit by soldering wires as per the schematics.
Then solder two ceramic capacitors ( C3 and C4) across the 20k resitors.
Then solder a wire between middle point of the solar panel side voltage divider and arduino pin
A0.
Finally solder a wire between middle point of the battery side voltage divider and arduino pin
A2.
Inductor is the heavier component in the entire circuit.To sit it firmly, apply glue at the base.
One TVS diodes, D4 near the connector JP1 and D5 near the connector JP3.
Solder the male JST connector near to the buck converter and connect two pins with positive
( 5V )and negative
Insert the USB port and switch in to the slots made earlier.Then apply hot glue surround them.
Solder the red wire (+ ve ) of the JST connector to one terminal of the switch.Then solder a small
red wire between another terminal of switch and USB Vcc terminal.Finally solder the black wire
(-ve ) of the JST connector to the USB GND.
The solder it side by side near the load side fuse holder.
Even the serial lines should not exceed this voltage.I am planning to use a 3.3 V regulator
( AMS1117 ) to power this module. A voltage divider circuit is used to drop the arduino Tx
( 5V ) to ESP8266 3.3 V ( RX).
The first thing you want to do with ESP8266 is to establish communication.You can see this
example project for setting up the ESP8266.Then connect it to your WiFi router.
Hey now you are ready to upload your data to the web.
You can see the following projects to get some idea to use ESP8266 for data uploading to web.
http://www.instructables.com/id/ESP8266-Wifi-Tempe...
http://www.element14.com/community/groups/internet...
The WiFi module( ESP8266 ) automatically uploads live power generation, voltage,Current data
to the Web( https://thingspeak.com/ ).Then the web application graph and tabulate data in
live.You can download the feeds from the website in the form of a Xcel sheet.Then explore these
data for further analysis.I attached a sample of feeds downloaded from thingspeak.
The test code is attached bellow.Hey if you are really excited to see how the tiny WiFi module
upload data to the web.Just upload the test code attached bellow.You can test it without any
sensor hook to the arduino.Though you will get arbitrary values.It is just for fun :)
Note : You can use this test code for other multi sensor system like: weather station .Just you
have to calibrate your sensors accordingly.
Take a small size rectangular prototype board and drill holes at both end for mounting on the
enclosure.
Then solder the 330 ohm resistors (R11,R12 and R13) and 4pin male headers.
Reset Switch :
Solder two jumper wires directly to the two pin of the push switch.
Finally cover the joints with heat shrink tube and apply hot air.
Mark the LCD,USB and Switch sizes .Then cut out the rectangular portion by using a dremel.
Finally finish the edges by a hobby knife.
Then mark the mounting holes position for LCD,LED panel,Switches and External screw
terminal by a pencil.
Note : The holes size for LED is 5mm ,switches are 7mm and all other are 3mm.
Then screw the wires in all the terminals.Use different color to distinguish between positive and
negative terminal.
The voltage to the solar panel is increased initially, if the output power increase, the voltage is
continually increased until the output power starts decreasing. Once the output power starts
decreasing, the voltage to the solar panel decreased until maximum power is reached. This
process is continued until the MPPT is attained. This result is an oscillation of the output power
around the MPP.
https://github.com/deba168/MPPT_Master
For the time being we are planning to see the following changes in existing version charge
controller.
1.Increase panel voltage rating to allow for panels with 60 cells (i.e up to 40 V, so-called "grid
connect" panels);
4.Improve design robustness to ensure external conditions do not cause any failures;
5. Design that allows multiple controllers to feed into a power distribution switchboard;
6. Optimal battery management for several different battery types, such as Lead Acid (several
variants), NiFe, LiFePO;
7. Ability to control more than one load output – either to allow for greater capacity, or timing
control of when the output is on or off.
8.Real time clock with date to enable time stamping of statistics and timer control of loads.
10.Greater data collection to get illumination statistics, battery performance statistics, load
statistics.
11.Higher battery voltage (to 24 or 48 V) and associated higher solar panel voltages;
In addition there are some "internal" matters that are worthy of investigation:
All the ongoing activities are given in Arduino-MPPT-V4 folder ( .rar file).
The other problem was that MOSFET Q1 ( in V-3.0) conduct even when there is no solar input.
To solve the above problems and enhance the power handling capability we are modifying both
the hardware and software.This is named as Version-3.1 Charge Controller.
Don't worry we are making a solution for those who have made the V-3.0 prototype.After little
modification we will able to use the new software.
1. 5 Amp version :
T94-26 toroid, 48 turns of AWG20 wire to give 135 uH (it takes almost 1.5m of wire)
C1 will be 3 * 220 uF low ESR capacitors in parallel, C2 will be a single 220 uF low ESR
capacitor
2. 8 Amp version :
T106-26 toroid wound with 23 turns of a compound wire made from 3 strands of AWG20 wire
twisted together to give 47 uH (this takes about 3.1 m of wire).
C1 will be 5 * 220 uF low ESR capacitors in parallel,C2 will be a single 220 uF low ESR
capacitor
Two ACS712, one on the panel side as per version 3.0 and one in series with the battery.
3 10 Amp version :
T130-26 toroid wound with 23 turns of a compound wire made from 4 strands of AWG18 wire
twisted together to give 41 uH (this takes about 4.5 m of wire).
C1 will be 6 * 220 uF low ESR capacitors in parallel,C2 will be 2 * 220 uF low ESR capacitors
in parallel.
Three ACS712, one on the panel side as per version 3.0, one in series with the battery and one in
series with the load.
The drive circuitry (common to all 3 versions) will use 3 separate IR2104 driver chips, one for
each of Q1, Q2 and Q3. We drive the Q1 and Q2 drivers from pin D9 and HO1 and HO2, and
drive Q3 from pin D10 and LO3.
In driver chips 1 and 2, pins IN and SD are driven in parallel by Arduino output pin D9. In the
case of driver 1 (for Q1) there is a low pass RC filter in series, with a time constant of about 1
ms. Driver 2 is driven directly (as in the current circuit, but probably with a slightly higher series
resistor to allow more current for the Q1 driver and its RC filter).
The purpose of using separate drivers for Q2 and Q3 is to enable us to switch Q3 OFF to operate
in Asynchronous mode at low current levels when the controller will be in DCM (Discontinuous
Current Mode). There may be a better way to do this but in the short time we have available this
is a simple option and easy and reliable to implement.
All 3 versions should have LCD displays, WiFi, LED indicators (maybe with a more fancy
coding scheme to separately indicate DCM and CCM).
All 3 versions should be able to cope with either 18 V or 30 V panels, and use algorithms that
stop them burning out if the panel can produce more current than the rating allows. This can all
be done auto-detect.
All the components exposed to panel voltage need to be rated for at least 40 V (in particular C1
and our buck converter to generate 12V for the drivers and to power the control electronics.
Step 42: Conclusion
I have tried my best to make this instructable. Till now I am learning more on MPPT. So if I
have done any mistakes please forgive me and raise a comments.I will rectify it as soon as
possible.
I love getting feedback on my projects! The earlier version charge controllers has received a ton
of feedback, and many users have posted pictures of their build.
If you follow this Instructable and make your own controller, please share pictures and videos.
At last,I would like to give very special thanks to timnolan. As I have learned and used several
things from his design.