• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / SMPS and Converters / Single LM317 based MPPT Simulator Circuit

DIY Circuits | Learn Basics | Arduino Coding




Single LM317 based MPPT Simulator Circuit

Last Updated on July 5, 2025 by Swagatam 121 Comments

To make this simple MPPT circuit we first modify a standard LM317 power supply circuit into a buck converter then configure it with a solar panel for implementing an MPPT function.

Modifying a LM317 Power Supply into an MPPT Solar Optimizer

In our previous article I have explained how a standard LM317 power supply could be transformed into an inductor based efficient variable buck converter power supply circuit.

In this article we analyze how the same circuit design could be enhanced into an effective MPPT circuit by a adding an LDR/LED optocoupler and an opamp voltage follower circuit stages.

The complete circuit diagram of the proposed MPPT circuit using LM317 buck converter can be witnessed in the following image:

Single LM317 based MPPT Circuit

 

The figure illustrates the discussed MPPT circuit, the LM317 and its associated components form a basic buck converter circuit whose output can be varied by simply varying a resistor across C2.

In our previous power supply design we saw a pot being positioned in parallel with C2 for enabling the variable output voltage feature, however since the present design is supposed to perform an automatic MPPT, this pot could be seen replaced with an LDR/LED opto coupler.

How the Circuits Works

The LED LDR opto coupler is a simple homemade device wherein a red LED and LDR are sealed face to face inside a tiny light proof enclosure.

The LDR leads here can be seen connected in parallel with C2,while the LED is integrated with the output of an opamp voltage follower circuit stage.

The input of the opamp can be seen hooked up with the solar panel through a 10k preset.

The idea here is to make sure that as the solar panel voltage increases, the opto LED intensity also increases, which in turn causes the resistance of the LDR to drop.

The dropping resistance causes the buck PWM is narrow its pulses thereby preventing the output voltage to rise, but nevertheless ensuring a proportionate rise in current for the connected load.

In one of my earlier post we understood that in any buck converter design the output from the converter depends on the PWM and the input voltage.

That implies if the solar voltage tends to increase, the buck output could get affected and begin increasing proportionately. This could in turn cause overloading of the panel and degrade the efficiency of the panel.

The present  LM317 MPPT design takes care of this situation through the LED/LDR device and the LM317 variable resistor feature, and combines the two features in conjunction with an opamp voltage follower to develop an effective self adjusting PWM based MPPT circuit.

The adjustment of the opamp 10k preset appears to be quite simple.

How to Adjust the LM317 MPPT Preset

At optimal sunlight, the 10k preset is adjusted such that the output from the buck converter produces a voltage on par with the load voltage specification.

For example suppose the load is a 12v battery, in that case the 10K preset is adjusted to produce around 14.4V.

Once this is done, from here on the output could be assumed to self adjust in response to the sun shine...meaning now as the sun shine increases the LM317 buck converter self adjusts and narrows the PWM at the base of Q1 inhibiting any rise in voltage, but in the process the inductor L1 and C4 makes sure that the excess sunshine is transformed into a proportionate amount of extra current for the battery to enable a faster charging.

Conversely if the sun shine deteriorates, the PWM tends to widen, causing the voltage for the battery to self adjust automatically maintaining the 14,4V level...... albeit with a proportionate amount of reduction in the current.

The self optimizing functionality is carried out throughout the day ensuring the most effective outcome from the panel for the connected load.

WARNING: THE ABOVE EXPLAINED SIMPLE MPPT CIRCUIT USING LM317 IS BASED ON THE AUTHOR'S ASSUMPTION AND SIMULATION, VIEWERS ARE ADVISED TO ASSESS THE CONCEPT THOROUGHLY BEFORE ATTEMPTING IT PRACTICALLY.

You'll also like:

  • 1How to Design a Flyback Converter – Comprehensive Tutorial
  • mpptIVgraphUnderstanding MPPT Solar Charger
  • smps2 Compact 12V 2 Amp SMPS Circuit for LED Driver
  • Make this 220V to 12V SMPS Using UC2842 IC

Filed Under: SMPS and Converters, Solar Controller Circuits Tagged With: Based, LM317, MPPT, Simulator, Single

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « LM317 Variable Switch Mode Power Supply (SMPS)
Next Post: How to make a Remote Controlled Game Scoreboard Circuit »

Reader Interactions

Comments

Keyul says:
October 28, 2019 at 10:27 pm

Hi,
I am looking to find out if the transistor 2N3792 can be switched out for a MOSFET and if it is possible to convert the circuit to a buck-boost or boost circuit as I need to charge a 36V battery

Reply
favour says:
May 16, 2019 at 3:48 am

Hello sir, please how can I prevent high voltage going to the battery if the Q1 becomes faulty, because I noticed if the Q1 short circuit, the input voltage is same as output voltage.

2. the ideal way if to connect battery first before the panel, how can I prevent the solar controller from start charging if connected otherwise.

thanks sir

Reply
Favour says:
June 29, 2019 at 2:14 pm

Moving forward, I discovered the inductor has no impact in the circuit because I tested it with and without the inductor, there was no difference in the output current. Any suggestion on this

Reply
Swagatam says:
June 29, 2019 at 3:10 pm

You can refer to the datasheet and check the calculations:

http://www.ti.com/lit/ds/symlink/tl494.pdf

Reply
Favour says:
June 28, 2019 at 12:41 pm

Please, is there anyway to optimise the this circuit to avoid losses because for tl494 pwm circuit components are scarce in my region . Thanks

Reply
Swagatam says:
June 28, 2019 at 1:18 pm

You can search online for “12V buck converter circuit” and use it for your application.

Reply
Favour says:
June 5, 2019 at 1:29 pm

Hello sir, please how can I add indicators to the circuit- charging and battery full

Reply
Swagatam says:
June 5, 2019 at 4:55 pm

you will need an op amp ciruit for that

Reply
Swagatam says:
May 16, 2019 at 9:02 am

favour, you can add a fuse with the collector of Q1 to prevent an accidental short circuit.

sorry I could not understand your second point.

Reply
favour says:
May 16, 2019 at 11:49 am

thanks sir, I meant how to ensure the solar controller is not damaged by high voltage input if the controller is connected to panel first before the battery,

any method to prevent such wrong accidental connection due to high solar input.

Reply
Swagatam says:
May 16, 2019 at 12:47 pm

Favour, you can use a shunt regulator at the output of the solar panel, as shown in the following article:

https://www.homemade-circuits.com/solar-water-heater-with-battery-charger/

see the left side op amp circuit, this will never allow the solar panel voltage to rise above the predetermined levels.

Reply
Favour says:
May 19, 2019 at 5:07 pm

Thanks sir, I want to ask if the circuit in the left in the link below, is connected to the solar output will not affect the mppt voltage input, I think it suppose to be connected to the mppt circuit output.

2.can the left circuit be used for float charging controller.

https://www.homemade-circuits.com/solar-water-heater-with-battery-charger/

Reply
Favour says:
May 24, 2019 at 6:05 pm

Thanks sir, please give me a good current limiter circuit.

Reply
Swagatam says:
May 25, 2019 at 8:42 am

You can limit the current through any of these circuits:

https://www.homemade-circuits.com/universal-high-watt-led-current-limiter/

Reply
Swagatam says:
May 19, 2019 at 6:19 pm

Hi Favour, It has to be connected to the solar output so that the excess power can be shunted to ground, so the diagram is correct.

For float charge controller you will have to limit the current accordingly using a current limiter stage.

Reply
Sageer says:
April 26, 2019 at 4:39 am

Very interesting, helping, impressive website. I,m very happy sir. Please keep it up.

Reply
Swagatam says:
April 26, 2019 at 7:50 am

You are welcome Sageer!

Reply
Krishneel Sharma says:
April 20, 2019 at 7:05 pm

Hi
I am looking for a Proteus Project File on Micro controller MPPT circuit.

Reply
Swagatam says:
April 20, 2019 at 9:25 pm

Sorry, I do not have it with me at this moment!!

Reply
Ashish says:
April 18, 2019 at 8:19 pm

Good evening sir. According to the circuit diagram, i got to know that the circuit can provide an output voltage of 1.8-32 V. Can i get to know the specifications of the solar panel to be used for the proper working of the circuit. I mean to say that what is the range of input voltage and current this circuit can handle.

Please do reply sir.

Reply
Swagatam says:
April 19, 2019 at 8:38 am

Hi Ashish, The range of the solar panel can be between 8V and 35V, current will depend on the rating of Q1.

Reply
Tolu says:
June 16, 2018 at 9:16 pm

Good day sir, please what’s the diff between the above circuit and 555based buck converter circuit for mppt, thanks

Reply
Swagatam says:
June 17, 2018 at 10:15 am

Tolu, both are based on same principle and might work identically.

Reply
thakib says:
May 14, 2018 at 5:11 am

Hi sir,
I’m using your lm317 mppt design for an academic research and need an assistance on components selection with mathematical backups.

Reply
Swagatam says:
May 14, 2018 at 6:51 am

Hi thakib, you can refer to the datasheet of the IC LM317C you may find the technical details there, beyond this I do not have any further data.

Reply
Sreeraj says:
March 31, 2018 at 1:39 pm

dear sir,
what are the values of resistances R1, R2, R3 and R5?

Reply
Swagatam says:
March 31, 2018 at 5:25 pm

they are all in Ohms!

Reply
Lubos Leitman says:
February 21, 2018 at 12:07 am

Hello, you can post the editing of the circuit for the PV panel with the following data: Pmp 200Wp, Vmp 78.3V, Imp 2.55A, Voc 99.7V

Reply
michael mascardo says:
October 26, 2017 at 8:16 pm

good day sir.Im having a problem with my thesis on the solar charger circuit because i tried so charger circuits but the power drop is pretty big.My solar panel’s current output is 1.1amps and when it goes to the charger circuit..the output becomes 100milliamps..Can you give me a 24volts solar charger circuit sir with less power loss.

Reply
Swagatam says:
October 26, 2017 at 8:34 pm

Hi Michael, which charger circuit did you use?

and please provide the voltage specs of your solar panel also

Reply
michael mascardo says:
October 26, 2017 at 9:45 pm

i’ve used your automatic charger regulator using lm338 with comaparator lm 741 and voltage regulator 78L12..for all the resistors in your design,i choose their power at 1watt..At that time its not the sunny but i’ve series a 2 pcs 12volts 20watts solar panel to add their voltages.the resulting output voltage on the solar panel was 15 volts but when i tap in on the charger that i made..The resulting output of the charger that i’ve measured was 3.43 volts and then when i measure the current with my multimeter.It was 17.56milliamps only.Can you give me a advice if what should i do?may battery is 12volts7ah and my thesis proposal was 24volts input in the buckboost converter that will give an output of 0 to 48 volts dc..Please help me on this sir..Thanks a lot

Reply
Swagatam says:
October 27, 2017 at 7:47 am

you mean to say your LM338 IC regulator give 3.43V when a 15V is applied at the input? that’s not possible unless you have done some mistake in the LM338 circuit. How did you adjust the LM338 pot? even a 7812 will give you a clean 12V with a 15V input.

also without sunlight the panel current will be quite minimal, so make sure to check the panel current first before connecting to the LM38 circuit.

first confirm the LM338 output, after that you can go ahead with the controller cut off setting…do the procedures step-wise.

Reply
michael mascardo says:
October 26, 2017 at 9:54 pm

my plan is to series a 2 pcs 12 volts battery so that it will result a 24 volts dc output sir.So that’s why i’d like to ask a help from you if you have a 24 volts solar charger circuit with less power loss.I think the comparator and regulator consume so much power that’s why a big power loss resulted on my solar charger.Sorry for my bad grammar because its already midnight here and i’m so sleepy right now.

Reply
Swagatam says:
October 27, 2017 at 7:58 am

Nope!, that’s not correct, the LM338 will consume some power but it will still provide a good output, if you are getting 3V from 15V input you have definitely done something seriously wrong in your circuit.

alternatively you can try the following one

https://www.homemade-circuits.com/lm317-variable-switch-mode-power-supply/

but I doubt, if you could not make a simple LM338 circuit then the above can be even more difficult for you….

Reply
greeshma rajan says:
October 12, 2017 at 9:26 am

sir how may i reduce 12v battery to 5v 2A

Reply
Swagatam says:
October 12, 2017 at 2:24 pm

you can use two 7805 ICs in parallel, just make sure to mount both on a common single heatsink.

Reply
ŔŐβĨŃ ŔĂĨĎĔŔ says:
August 17, 2017 at 2:30 pm

▶Sir, i need your help very badly. Cause you help others. Can i ask my question?

Reply
tushar lashkari says:
March 23, 2017 at 12:22 pm

can this circuit be dirctly connected with inverter of cd4047 (12-230v)???

Reply
Swagatam says:
March 23, 2017 at 2:41 pm

No, it's only for charging a low AH battery throughout the day.

Reply
Jayesh Barad says:
February 13, 2017 at 4:59 am

what is the replacement of BJT 2N3792

Reply
Swagatam says:
February 14, 2017 at 8:36 am

TIP32 or BD140

Reply
Glory says:
June 30, 2018 at 8:20 pm

Can I use tip147 transistor

Reply
Swagatam says:
June 30, 2018 at 8:39 pm

yes you can use it for Q1

Reply
Glory says:
July 3, 2018 at 2:21 am

Thanks, can I use tip122 instead, I don’t have have tip 147 for now

Reply
Glory says:
August 1, 2018 at 7:09 pm

Good day sir, how can I improve the mppt efficiency, what are the factors I should work on, the losses are great.

Reply
Swagatam says:
August 2, 2018 at 12:09 pm

Glory, the above circuit is a basic design it does not have any room for further improvements, …except the initial adjustments, and the component selections

Reply
Glory says:
July 10, 2018 at 2:48 am

Good day sir, thanks for your update, what is the function of the voltage follower and how does it work in this circuit.

Reply
Swagatam says:
July 10, 2018 at 12:37 pm

Thanks Glory, the voltage follower opamp acts as a buffer between the panel and the LDR, and helps to provide an equivalent level of supply to the LED in response to the panels varying voltage and ensures a safe operation of the LED

Reply
Glory says:
July 6, 2018 at 9:26 pm

Thanks sir, but the solar Vin is 38.6v, please any way around it.

Reply
Swagatam says:
July 7, 2018 at 6:48 am

OK no problem, I just forgot that the IC LM317HV is rated to handle upto 60V, just make sure Q1 is also selected appropriately

Reply
Glory says:
July 5, 2018 at 11:02 pm

Please sir give me the values of the components I need to change for 24v battery load with 300w/24v panel, because I tried some changes, increasing the Q, L and R2 but the resistors are getting burnt. Thanks sir.

Reply
Swagatam says:
July 6, 2018 at 10:57 am

Glory, make sure the voltage does not exceed 25V, in this condition you can reduce the 22 ohm to 10 ohm, increase LED resistor to 1K, and reduce R2 value to 0.1 ohms. Rest can be as is.

However I am not sure about L1, you may have to experiment with it by initially trying 1000uH inductance value

Reply
Glory says:
July 3, 2018 at 7:39 pm

Thanks so much for your educative site and well organised system. This is the comparison result BTW my bought pwm charger and the built mppt.

Presently the weather is cloudy @Vin-19.12V
Pwm- Iin- 2.79Amps, Iout-2.52Amps
Mppt-Iin-2.08Amps, Iout-2.89Amps

Please sir, I want to ask,
1. why is the Iin 2.08amps for the mppt lesser than that of the bought pwm
2. What can I do to solve this.

Thanks for the good work sir, God will bless you more and more abundantly.

Reply
Swagatam says:
July 4, 2018 at 8:46 am

Hi Glory,

where did you measure the input voltage, is it across the solar panel? But anyhow it is the output that becomes important, and since you are getting higher amps with the MPPT that looks much efficient. The drop at the input voltage could be due to the loading and switching of the inductor of the MPPT buck converter.

Reply
Swagatam says:
July 3, 2018 at 6:39 am

sorry, TIP122 is an NPN so it won’t work for Q1

Reply
Glory says:
July 1, 2018 at 9:33 pm

Thanks so much. it’s working great, but the tip147 is getting too hot at high current gain.please how can I combine it in parallel. Thanks once again

Reply
Glory says:
August 15, 2018 at 10:21 am

To optimise the frequency how do I change the capacitor, with c2 of 0.01uf I got frequency of 155hz. What should be the range of frequency to get optimum result.thanks.

Reply
Swagatam says:
August 15, 2018 at 4:48 pm

C2 is not responsible for the frequency change, it is R6/C3 which determine the frequency range, you can read more on this here:

https://www.homemade-circuits.com/lm317-variable-switch-mode-power-supply/

Reply
Glory says:
August 2, 2018 at 8:16 pm

Thanks sir for your response, I think I got a wrong result earlier, where I said I had current gain from the mppt design, I am getting the following result presently.

At 2.02pm weather partly cloudy, I measured the Solar voltage without any connection, I got 18.53v

Pwm-1.74A the controller I bought
Mppt -1.46A. I Set the output voltage at 14.4v

Please why could this be, what can I do. Thanks

Reply
Swagatam says:
August 3, 2018 at 8:30 am

Hi Glory, which MPPT are you referring to, is it the above one?
The above design is totally dependent on the optimization of the coil parameters and the frequency, its performance can be improved by experimenting and optimizing these parameters to the most effective levels.

Reply
Swagatam says:
July 2, 2018 at 8:09 am

Glad it’s working Glory, TIP147 can handle upto 10 amps, but transistors can begin heating even when only 20% of the rated current is applied across them, so a large heatsnk becomes essential for these devices.
If you want to put them in parallel you can simply join their respective terminals in parallel, but make sure to mount all of them over a common heatsink.

https://www.homemade-circuits.com/transistor-facts/

Reply
Olutayo Aboyade says:
October 20, 2016 at 5:30 am

How can I use it for 200w ,250w,300w 24v or 12

Reply
Swagatam says:
October 21, 2016 at 3:37 am

by proportionally increasing the ratings of Q1, R2 and L1

Reply
Glory says:
June 30, 2018 at 12:03 pm

Hello Swag, you said for higher panel rating 250w just change Q, L , R2 but the maximum output current for lm317 is 1.5A. Please how is this compatible with high panel wattage

Reply
Swagatam says:
June 30, 2018 at 1:05 pm

Hello Glory, the IC LM317 is used only for implementing the buck converter circuit, the output current is controlled by the PNP, therefore the PNP becomes solely responsible for the output current delivery.

Reply
bashir abdulkadir says:
October 18, 2016 at 1:29 pm

sir how may i reduce 12v battery to 9v

Reply
Swagatam says:
October 19, 2016 at 2:38 am

you can use 4 series diodes with its positive line.

Reply
Prince Godson says:
October 17, 2016 at 8:29 am

Pls is this. Circuit tested n can I use it for my 40watts solr pannel and what's the maximum amps of battery it can charge

Reply
Swagatam says:
October 17, 2016 at 1:36 pm

you can use it with a 40 watt panel. the circuit can be upgraded to charge any battery simply by modifying the L1 and Q1 accordingly

Reply
Grayback Journey says:
October 17, 2016 at 7:06 am

amazing,, im thinkin` same ckt before the last time youve shown the LM317 as BuckConv, very impressive.. thanks author & Sir/Engr Swag(Hitman). The cheapest way to have MPPT alternative, how cool!

Reply
Swagatam says:
October 17, 2016 at 7:44 am

you are most welcome grayback, I am glad you liked it!!

Reply
Back to Newest

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (93)
  • Audio and Amplifier Projects (133)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (85)
  • Datasheets and Components (109)
  • Electronics Theory (149)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (95)
  • Lamps and Lights (159)
  • Meters and Testers (71)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (64)
  • Sensors and Detectors (106)
  • SMPS and Converters (34)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (49)
  • Voltage Control and Protection (42)
  • Water Controller (36)
  • Wireless Circuits (30)





Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap



People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin



Recent Comments

  • Swagatam on 9 Simple Solar Battery Charger Circuits
  • Gagana on 9 Simple Solar Battery Charger Circuits
  • Swagatam on Arduino 2-Step Programmable Timer Circuit
  • Swagatam on Simple Buck-Boost Converter Circuits Explained
  • Swagatam on IC IR2111 H-Bridge MOSFET, IGBT Driver IC: Full Datasheet, Circuit Diagram

© 2026 · Swagatam Innovations