loading

[ Play Video ]

Welcome to my solar charge controller tutorials series.I have posted two version of my PWM charge controller.If you are new to this please refer my earlier tutorial for understanding the basics of charge controller.

This is project is entered to " 2015 Hackaday Prize ".If you want to support me and see the project in a new level,please follow and give skulls to my project @ hackaday.io.This will be very helpful for me.

1. Version-1

2. Version-2

This instructable will cover a project build for a Arduino based Solar MPPT charge controller.It has features like: LCD display,Led Indication,Wi Fi data logging and provision for charging different USB devices.It is equipped with various protections to protect the circuitry from abnormal condition.

The microcontroller used is in this controller is Arduino Nano. This design is suitable for a 50W solar panel to charge a commonly used 12V lead acid battery. You can also use other Arduino board like Pro Mini,Micro and UNO.

Now a days the most advance solar charge controller available in the market is Maximum Power Point Tracking (MPPT).The MPPT controller is more sophisticated and more expensive.It has several advantages over the earlier charge controller.It is 30 to 40 % more efficient at low temperature.But making a MPPT charge controller is little bit complex in compare to PWM charge controller.It require some basic knowledge of power electronics.

I put a lot of effort to make it simple, so that any one can understand it easily.If you are aware about the basics of MPPT charge controller then skip the first few steps.

The Maximum Power Point Tracker (MPPT) circuit is based around a synchronous buck converter circuit..It steps the higher solar panel voltage down to the charging voltage of the battery. The Arduino tries to maximize the watts input from the solar panel by controlling the duty cycle to keep the solar panel operating at its Maximum Power Point.


Specification of version-3 charge controller :

1.Based on MPPT algorithm

2. LED indication for the state of charge

3. 20x4 character LCD display for displaying voltages,current,power etc

4. Overvoltage / Lightning protection

5. Reverse power flow protection

6. Short Circuit and Over load protection

7. Wi Fi data logging

8.USB port for Charging Smart Phone /Gadgets

Electrical specifications :

1.Rated Voltage= 12V

2.Maximum current = 5A

3.Maximum load current =10A

4. In put Voltage = Solar panel with Open circuit voltage from 12 to 25V

5.Solar panel power = 50W

This project is consists of 40 steps.So for simplicity I divided the entire project in to small sections.Click on the link which you want to see.

1. Basics on MPPT charge controller

2. Buck circuit working and design calculation

3. Testing the Buck Circuit

4. Voltage and Current Measurements

5.LCD display and LED indication

6.Making the Charging Board

7.Making the Enclosure

8. Making the USB Charging Circuit

9. Wi Fi Data Logging

10. MPPT algorithm and flow chart


Updates as on 16th June 2015

Version-4 Design Ideas and Planning

After my version-3 Charge Controller became popular on web,I received mails and comments with request for making a higher rating Controller. So we are designing our Version-4 Charge Controller which is more advanced, greater capacity and useful more potential applications.When the project complete, it should be useful for off grid electricity users, control of autonomous street lights and signs, and many other applications that need medium power levels and efficient reliable operation

For all the ongoing activites click here


Problem in V-3 :
During my prototyping, I have faced a critical issue.The issue was that when I connect the battery to the controller,the connection between the battery and the switching ( buck converter ) become very hot and then MOSFET Q3 burn out.It was due to shorting of MOSFET-Q3. So Current flows from Battery -MOSFET Q3- GND which is unexpected.

To solve this problem I have asked to viewers. After taking suggestions from all, Keith suggestions really works for me.So I have modified few things.

Rectifications / Changes :

As per Keith suggestions

Modification in MOSFET Driver Circuit :

1. With the existing circuit, if the panel voltage is zero then the IR2104 has no VCC input. This may make its behaviour unpredictable.As per data sheet, the driver VCC should be in between 10 and 20 Volts for "proper operation".

2. It means the driver will always be working, and so there is a positive control over the switching MOSFETs at all times.

3. The voltage from the solar panels has been specified as up to 25 volts, which is a bit more than needed to connect a standard 36 cell solar panel. The voltage doubler circuit that generates the Vb voltage for the driver will turn that into 50 volts, which in turn will put 25 volts onto the Source-Gate interface of both Q1 and Q2. The maximum rating of this interface is 20 volts, so either of these FETs may become unreliable with a high solar panel voltage of more than 20 volts.

4. Using the battery for Vcc of the driver means that Q1 and Q2 both only have Source-Gate voltages equal to the battery, which is comfortably within the 10 - 20 Volt range of these MOSFETs.

Changes : Powering the MOSFET driver IR2104 from battery terminal ( 12V ) instead of solar panel ( earlier ).

If anyone making this controller, make this changes and test it. If you have any test results / suggestions, comments it below.

Step 1: PARTS AND TOOLS REQUIRED:

1. Arduino Nano (Amazon / eBay )

2.Current Sensor ( ACS712-5A / Amazon )

3.Buck Converter ( LM2596 / Amazon )

4.Wifi Module ( ESP8266 / Amazon )

5. LCD display ( 20x4 I2C / Amazon )

6 .MOSFETs ( 4x IRFZ44N / Amazon )

7. MOSFET driver ( IR2104 / Amazon )

8. 3.3V Linear regulator ( AMS 1117 / Amazon )

9. Transistor ( 2N2222 )

10.Diodes ( 2x IN4148 , 1 x UF4007 )

11.TVS diode ( 2x P6KE36CA / Amazon )

12.Resistors ( Amazon / 3 x 200R ,3 x330R,1 x 1K, 2 x 10K, 2 x 20K, 2x 100k, 1x 470K )

13.Capacitors ( Amazon / 4 x 0.1 uF, 3 x 10uF ,1 x100 uF ,1x 220uF)

14.Inductor ( 1x 33uH -5A / Amazon )

15. LEDs ( Amazon / 1 x Red ,1 x Yellow ,1 x Green )

16.Prototype Board ( Amazon )

17.Wires and Jumper wires ( Female -Female )

18.Header Pins (Amazon / Male Straight ,female , Right angle )

19. DIP Socket ( 8 pin )

19.Screw Terminals ( 3 x2 pin ,1 x 6pin / Amazon )

20.Fuses ( 2 x 5A)

21. Fuse Holders (Amazon / 2 nos)

22. Push Switch (Amazon / 2 nos)

23.Rocker /Toggle Switch ( 1 no)

24.Female USB port ( 1no)

25. JST connector ( 2pin male -female )

26.Heat Sinks ( Amazon )

27.Enclosure

28.Plastic Base

29. Spacers ( Amazon )

29. Screws/Nuts/Bolts

TOOLS REQUIRED :

1.Soldering Iron ( Amazon )

2. Glue Gun ( Amazon )

3. Dremel ( Amazon )

4. Cordless Drill ( Amazon )

5.Hobby Knife ( Amazon )

6.Wire Cutter ( Amazon )

7.Wire Stripper ( Amazon )

8.Screw Driver ( Amazon )

9. Ruller and pencil

<p>Made it in breadboard then PCB </p>
<p>I made some alterations though ;</p><p>1.the no IR2104 in my Kenya IR2110 did not work so i used opto coupler PC 817</p><p>2.Did not use arduino nano ,i used arduino uno to program and made it stand alone and burnt the code into the ATMEGA328P_PU</p><p>3.Instead of many LEDs i used a RGB led</p><p>4.Use some features of version4 not yet released .Used DS18B20 temp sensor ;replaced using the serial monitor to input charging set points and temperature compensation with a keypad to make it more practical in stand alone</p>
<p>superb idea........ lot of thanks for u i started my work....</p>
<p>Really? Can You please upload some Images?</p>
<p>Good day </p><p>I have build the circuit as shown on the schematic, but when i add the battery to the circuit it keep on burning the MOSFET connected to pin 5 of the mosfet driver help please.</p><p>Thank you. </p>
<p>Not one of this circuits on this projects works.</p><p>You can put all your work in basket.</p><p>You should read all posts before you begin.</p><p>Regards,</p><p>Maverick</p>
<p>Very good work! i&acute;ll try to build it. Im very iterested on a 10 or 20A version.</p><p>Best Regard from Germany</p><p>Franz</p><p>Franz</p>
<p>Dont do it, You will save Your money and nerves<br>.</p><p>It doesnt work.</p><p>Regards,</p><p>Maverick</p>
Great job ..very soon i will upload my ckt of charge controller.<br>
<p>Wher to by a Kit to you ARDUINO SOLAR CHARGE CONTROLLER???<br>Wit the Printed PCB and all parts??<br>&Oslash;nsker at buy 2 stk PCB-layput<br><br>Best Regard<br>Monie Jacobsen<br></p>
<p>Wher to by a Kit<br><br>Wit the Printed PCB and all parts??</p>
<p>I could not figure out how to use IR2104 so I used a pic 16f684 for PWM generation and IR2110. Circuit works perfectly. Thanks.</p>
<p>Looks nice, i don't want to discourage you but it will work until you will hook the battery after that you will wounder why Q3 aka the lower mosfet burns out and the upper one aka Q2 is so hot that you will burn your finger if you touch it. </p>
I wish to use use this with another buck circuit to drive an inverter. I am not using battery in my system. But still for the safety precautions I will put a diode before Q2 diode. <br>
<p>I don't understand Your Idea with a second buck converter... !?</p>
<p>I am designing a Solar Inverter without battery. I will have a separate battery for driver circuit and I would charge it with a dedicated battery charger and not by using Solar panels. Now the question is if I really need MPPT? Technically, I dont. Even without MPPT my circuit would work perfectly if I take a supply from Solar panels and Buck Boost it to a constant voltage that would appear at the input of the inverter which would convert it to ac power. <br>I am designing MPPT(buck) before the main buck converter just to get the maximum power that is available at the input side of MPPT (buck) to the main buck. So this MPPT buck's job is just to give whatever maximum power it can give from Panels to the main Buck. If I dont have MPPT, the power at the input of the buck will not be the maximum power all the time. <br>This, of course is a test product. I would like to check how much difference of power do I get from two methods.<br>If you have any other suggestion, you are most welcome.</p>
<p>Solar Inverter without a battery will work but not for long, i tried your idea last summer and it has problems. Any consumer that uses a motor will need a short amp spike to start, that spike can be 3x the rated working amperage so if you have a motor rated at 1Amp it will need for 0.5s a 3amp supply to start and after that it will fall back to the normal 1Amp. This instant starting current may be lower or bigger depending the starting torque needed by the motor to speed up. Without battery you are limited to the panels output even if your panel can handle the power requirement of the motor you can't give that x3 instant power to start it up and not last any small shadow on the panel will force the inverter in protection. If you don't need to store the energy and you want to use it directly when the panels are generating you don't need a big battery a 15-20Ah is fine but you will need one if you don't want to kill the inverter and damage the consumers. </p>
<p>Thanks for your detailed description but I am planning to build the system for 3kW so, I will have enough current to supply at motor starting. And the main reason to remove the battery is cost problems. Is there any other solution that you can suggest without using a battery?</p><p>And forgive me but I did not understand your explanation about IR2110. I consider it as a MOSFET driver, so its job is to drive the MOSFETs, how does it matter what load is there at the output of the MOSFET? And charge pump's job is to give gate pulse to high side MOSFET with respect to the source voltage. So even if we have 300 volts at VS terminal ( High side source and low side drain), charge pumop would work perfectly to give 12-15 volts of pulse above that. Please let me know if you think I am wrong. <br>Thanks.</p>
<p>I don't know any alternative to the battery, well if you have 3kW solar panels i think you afford a 40-50Ah car battery it;s not that expensive, well it will work without battery but you need to make sure that the panels will always have sufficient output current, like an example if a small cloud will pas in front of the sun cause 3-4min shadow your inverter will first enter in protection because it will not have enough output for the load and it will force the load to stop. </p><p> with IR2110 it's simple, voltage means potential difference 12V means a 12V difference between positive lead and Gnd/negative lead. The charge pump of IR2110 is just a simple capacitor and a blocking diode no boost converter or etc... now if you solar panel output is lets say 48V and the battery voltage is 45V what is the potential difference the capacitor can charge up ? 48-45 = 3V so your boost capacitor can charge up only to 3V not even near the required 8-10V. That is the reason of resistive load where on the OFF period on Source side you have 0V so potential charge voltage is input-0V si if you input is 48V then you have 48V-0V = 48V on the capacitor.</p>
<p>The charge pump of IR2110 does not care about the vs voltage. CHarge pump's job is to consider vs voltage as a reference and create a voltage at HO referenced to that (VS) voltage. So even if the battery is 48V and solar panels are 100 V , it will not have 52 volts across it. It will have only VCC voltage across the capacitor which you give to the 3rd pin. I dont see any reason why a MOSFET driver should change its working depending on the load. IR2110 will not be a problem.<br></p>
<p>If you say so then i will not argue with you. I tested it myself, i asked 3 experienced electrotechnician's opinion, two of them are designing chargers and SMPS-t for years so i doubt they didn't know what are they talking about when they told me what i told you about that charge pump. Your free to go and try it yourself. IR2110 charge pump is not a boost converter with switching involved, it's just a simple capacitor with a reverse biased blocking diode allowing it to charge up when the mosfet is OFF and blocking it's discharge back to the solar panel side and forcing it's charge to go trough the IR and from there to the mosfet gate. </p>
<p>The charge pump of IR2110 does not care about the vs voltage. CHarge pump's job is to consider vs voltage as a reference and create a voltage at HO referenced to that (VS) voltage. So even if the battery is 48V and solar panels are 100 V , it will not have 52 volts across it. It will have only VCC voltage across the capacitor which you give to the 3rd pin. I dont see any reason why a MOSFET driver should change its working depending on the load. IR2110 will not be a problem.<br></p>
<p>About how much power are we talking now?</p><p>As BansiS1 told this allready I would use a Battery to pick up spikes.</p><p>I would also use less &quot;converting steps&quot; ... and MPPT + Solar Tracker.</p>
<p>The power will be about 3 kW just enough for one home. </p>
<p>You can add as many diodes as you want it will not change anything, just read the DS of IR21xx and you will see that it needs a resistive load, what is a resistive load ? well anything that has 0V when Q2 is OFF. A battery is not a resistive load because when the mosfet is OFF if you measure the voltage between Gnd and Q2 source pin you will have 12V aka battery voltage and not the required 0V by IR21xx then the charge pump will fail -&gt; Vgs will be very small something like 3-4V tops -&gt; Mosfet will open only 30-40% -&gt; mosfet = high value resistor and will burn out. Q3 burns out because sync buck converter needs a very strict timing and with a &quot;home made&quot; software + harder you will not achieve that timing and on Q3 you will short out the battery for very short periods of time. That diode you speak about would be needed after Q3 and inductor , right before battery + lead but then the efficiency will be even smaller than an async buck which i did. </p>
Can you help me with this project ? Ill pay you
Hey. Everyone does any of these versions work accuratley
<p>NO</p>
So.. nothing on this project works not even BANDS1 changes?
<p>Well, nothing on this project works.</p><p>Except killing MOSFET's ;)</p><p>It's practically dead.</p><p>No comments.</p><p>No support.</p><p>I would say, the version which made Bandis1 is completelly different.</p><p>He didn't posted his (!) full shematics and no software at all.</p><p>I made some modifications on the version from BandiS1 and it works.</p><p>I'm still working on some modification's.</p><p>I don't have got final PCB and no final software.</p><p>You can read my communication with BandiS1 here.</p>
<p>Yes the version works perfectly.</p>
Version 3.0 or 3.1?
<p>Hi everyone, i ask wouldn't be better if instead of N channel mosfet we use a P mosfet like this <a href="https://www.fairchildsemi.com/datasheets/FQ/FQP47P06.pdf" rel="nofollow"> https://www.fairchildsemi.com/datasheets/FQ/FQP47...</a> ?</p><p>So in that way we don't need to make voltage doubler. </p><p>Regards.</p>
<p>It will work if you are planning for small solar panel ( 5-8 Amps ) if you are going up to 10Amp or more the P channel has bigger Rds on your particular Mosfet you linked has 26Mohm, an N channel has 15Mohm or less. So on high power a P channel Mosfet fill generate more heat so you will need a big heatsink or forced cooling with a heatsink + fan.</p>
<p>Hello,</p><p>Why do You connect pin5 of the TLC to Vcc?</p><p>There is allways electricity. At least 12V.</p><p>I don't understand the purpose of connecting pin5 to PLUS Rail.</p><p>Regards,</p><p>Maverick</p>
<p>The reason is simple, on the OFF period the mosfet gate need to be pulled to Source pin voltage = positive rail of the battery so pin 5 need to be connected to the positive rail. Anyway there is no such thing that Vcc need to connected to 0V aka ground, the powering voltage in datasheets is the voltage difference between Vcc and Vdd si in the TLP's case Vdd is +22V from 555 ,Vcc +12V from battery that means that is powered at 22-12 = 12V. </p>
<p>I understand. Vcc is the relative Ground.</p><p>So, if I'm charging the battery to 14V (Cycle use) I'll need</p><p>at least 22V, better 24V on Vdd to get the 10V on the IX Chip,</p><p>which is rated to max 20V.</p><p>If something goes wrong on Vcc, I'll get 24V on Vdd which is on the limit.</p><p>EDIT: What about a little MOSFET on Vcc to turn on Vdd</p><p>that we stay on less than 20V for every case?</p><p>If there is no Battery connected, there is no Vdd voltage.</p><p>But without connected battery the charger will not work.</p><p>Regards,</p><p>Maverick</p>
<p>With a 14V battery voltage you need to get 34V output from the 555 / boost converter, to get 20V on IX's supply ( 34-14 = 20V) less probably that you will get such high voltages, it's nearly impossible just if you boost converter malfunction and rises the voltage above selected one. Anyway you can use a simple clamp zener to protect the IC, as you can see i have one to on the 555 input ( a resistor + 15V zener ). Well none of voltage regulators are designed to work without battery, almost all of &quot;high end&quot; chargers have a warning sign saying that you should never disconnect the battery's before you disconnect the Solar Panels.</p>
<p>Hello,</p><p>You mean zener between Pin 5 and Pin 8 (Cat to Pin 8) ?</p><p>And limit the Current to Pin8 to 40mA ?</p><p>PS I killed one IX Driver allready.</p><p>I lost connection to Pin5 and got 30V on Pin8.</p><p>Regards,</p><p>Maverick</p>
<p>Well i can't understand how you git 30V on Pin5 ( GND ) maybe on pin8 (Vcc). What you can do add a 100ohm series resistor between the boost converter output and pin8 (Vcc) and a clamp diode from pin8(Vcc) to pin5(Gnd), it look's like this http://www.electrical4u.com/wp-content/uploads/2013/05/zener-diode-voltage-regulator.png , the output voltge will be equal to the zenner diode voltage so you would need to use a +15V one maybe.</p>
<p>I have lost the 12V potential from the Battery on Pin5</p><p>and the difference goes from 15V to over 25V (probably 29V-30V)</p><p>Beside of this it working great, but I'm still busy with the software.</p><p>I'll probably change the &micro;C from 328P to 328PB.</p>
<p>In the mean time im running in to huge problems here.</p><p>As I understand Voltage Doubler gives me DC Voltage.</p><p>It destroys my 50% Square Wave.</p><p>Currently I have got 25/50/100kHz 50% DutyCicle 12V Square Wave from 555 (to Pin 8) and 50kHz PWM from Arduino which I can send to the IXYS Driver.</p><p>Pin 6 of the ISYS Chip driving the MOSFET's gate.</p><p>Which Signal should be there?</p><p>In similar circuit like yours I got 300mA from the solar panel going nowhere.</p><p>I measured this with real MM. The Battery on another side loosing 50mA too.</p><p>Any Ideas?</p><p>Regards,</p><p>Maverick</p>
<p>555's square wave is not going as square wave to the TLP, if you follow the schematic you will see that 555's output is square waving a capacitor that capacitor when is fully charger to 12V it discharges to the second capacitor on the output, so the second capacitor will hold smooth 24V dc, if the capacitor is large ( is use 22uH) it will hold enough dc voltage to charge couple of times the mosfets gate which is in the range of nF's, then the 55 completes the next cycle and charges the capacitor again. Anyway the 555's frequency should be at least equal of arduino's one or higher.</p><p>Arduino's PWM is linked to the Pin2 which activates the internal logic circuit which on HIGH signal will pull the mosfet gate to pin8 and on LOW signal will pull the gate to pin 5, on short it opens / closes the mosfet.</p><p>There is no such thing that &quot;is going nowhere&quot; it is going somewhere most possible in heat, some components or the mosftet doesn't got the minimum 8V gate voltage and opened only partially acting like a high value resistor generating 300mA worth of heat. Then also take in conisderation the circuit consumption, LCD back-light, arduino, 555, for all of this you use linear regulators ( LM78xx) those generate a lot of heat to = again power losses in heat) etc... my circuit eat's around 100mA not taking in consideration the looses in the mosfet / blocking diode on the solar input,etc... </p>
<p>OK, I found something.</p><p>The gate Voltage with 12V was to low-as you told this before.</p><p>I tried to switch the gate directly from the solar panel and now it's charging.</p><p>I'll try to feed the MOSFET driver with a regulated boost converter.</p><p>What do You say about this?</p><p>Later I can increase the driver frequency up to 110 or 230kHz.</p><p>Regards,</p><p>Maverick</p>
<p>Well connecting directly to solar input is not something good because you don't have 8V difference, if you hold the solar panel at 17.5V then you barely get a 4V and that Mosfet is acting like a big value resistor... same problem in the original schematic with the charge pump getting only 3-4V Vgs and as you can see mosfets got burned one after other. For testing it's ok. but make sure you have a decent heat-sink on that mosfet.</p><p>I don't tried with boost converter but it should work. </p>
<p>You are right i only need 11 amps by now. <br>But when add more panels i was thinking just put 1 or 2 more mosfet in <br>parallel to compensate losses. Please tell me what you think, and if you <br>already probe that and has some downside that i don't see.</p><p>Other <br>thing is that i like the idea that would be possible use 24v system or <br>maybe more. The 555 is simple and so very practical but is only for 12v.</p><p>The other possibility could be use the 555 and a little ferrite transformer to isolate the mosfet gate.</p><p>Thanks.</p><p>Regards. </p>
<p>Well i never used P-channel on the charger so i can't tell you if the generated heat is okey with just a heat-sink or needs a fan to. With 555 you can get maximum 30V output but it can be replaced with a 12V transformer you can find any old charger that outputs 12V that will work with any solar panel voltage), the only problem is that the charger is no longer stand alone and it will need a 220V power supply for the transformer.</p>
<p>If You adjust the Voltage You can use the 555 on a 24V sistem.</p>
Battery and load correctipns are not displayed correctly on d lcd hardware part is checkd its correct is showing 30 bit its not nd load though not connected it shows on
<p>Hello, I'm trying to make this device by now, but I have some problems in understanding the code.</p><p>My problem is in the 'bat_float' status charging, why we should run the 'set_pwm_duty' void after we run the 'TURN_OFF_MOSFET' ? Because I think it willn't give system any impact because the MOSFET Driver is in 'Disabled&quot; condition. Hope you guys can help me. Thanks !</p>

About This Instructable

548,189views

1,274favorites

License:

Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe &quot;&quot;IF YOU TRY YOU MIGHT ... More »
More by deba168:DIY 5500mW Laser Engraver / Cutter RECYCLED BOTTLE RAT TRAP DIY 3D Hologram Pyramid 
Add instructable to: