low cost solar panel solution (MPPT + sun tracker)

portable flexible panel + MPPT controller + solar tracker system
less than 55 USD ????

Similar projects worth following
To get the most from your cheap 100W solar panel you may need to add significant extra cost for a MPPT controller and even a solar tracker.

This project is here to propose a VERY VERY cheap solution :
- a mostly 3D printed frame to hold your flexible panel
- a fully working 20A MPPT controller (hacked hardware) + ESP32 firmware + Android App
- a lead acid and lipo smart charger (1s, 2s, 3s or 4s)
- a voltage controlled power supply (3V - 16V)
- a fully automatic sun tracker (hardware and software) to get the max power from your panel

All this with an incredible price ? Less than 55$ ? (panel not included !)

Well ... seems impossible... let's have a look !

The true story

I started this project after buying this 100W flexible solar panel during BlackFriday last october.

These panels are quite cheap and are very light (less than 2kg). They are thus well positionned to design a portable system.

Here in Europe it was the beginning of the winter season and I very soon discovered that a solar panel rated at 100W never produces such a power in winter times...

So I started to imagine a system to harvest the most possible power from this solar panel while preserving two main objectives that I fixed to myself :

  • keep it as cheap as possible (as it was for me a hobby and a way to discover real problems with PV panels before thinking to equip my house with a Pro installation)
  • keep it portable, ready to go, easy to operate and light (I wanted to be able to carry this panel in the fields to recharge my Parrot Disco flying wing batteries or to use it in a camper van !)

Finally, to be honest, this project wasn't intended to participate to the Hackaday's contest.... But when I received the reminder mail (two days before the deadline) and read the objectives of this contest... I frankly believed that with no effort I was completly inline with the Planet-Friendly Power themes :

"Build a hardware solution that lowers the cost of clean energy, through energy harvesting and/or storage efficiency improvements.

In the following sections I will cover the design of 

  • the frame for the PV panel
  • the solar tracker system
  • the MPPT controller

And you will soon see how my design lowers the costs while improving efficiency of energy harvesting with solar panels !

Everything wil be open source either hardware or software, so you will be able to build your own whenever you want !

Currently I do have a working prototype, but even if a lot has already been done, there is still a lot of job to clean the code and to improve the operations. Stay tuned !

The frame

Adding a frame to a flexible panel was an absolute necessity !

Furthermore this frame should be "scalable" to be reused for the solar tracker system

I wanted the frame to be light and cheap, so I forgot using metal and jumped to a "full plastic" solution.

Considering the low cost approach I decided to build it around cheap 20mm PVC pipes used for electrical installation. You can purchase them at less than 1$ for 2m. You will need two of them to build the full frame

To assemble the frame I designed 3d printed corners and hinges. 

They are already available for download on thingiverse on my account : tilting frame for PV panel

Simply insert the PVC pipes into the corners and screw all this to the PV panel using 6mm screws and washers !

Something that I would like to mention is that 3D printing is not "free" as the filament costs "a lot" !

In order to lower the price of the project and to keep the "reuse, recycle, revamp" spirit of the challenge round#2, I decided to use PET filament that I produced from plastic bottles.

So I can proudly consider that the 3D printed parts of this project are totally free (avoiding to take into account the electrical bill... considered as negligible)

This was just to tease a little, as I will for sure publish my "pulltruding machine" to the next contest 

As you will see, printing with plastic bottle PET has also the advantage of strength and also it resists to very high temperature (printed at 265°C). This is important as the back of a solar panel can easily overheat at more than 60°C. So if you use PLA for parts in contact with the panel it may start to melt...

The solar tracker

Principle of operation 

A solar tracker will help to follow the sun during the day and to point the panel strictly perpendicular to the sun rays.

So a "good" solar tracker must not only follow the vertical motion (elevation angle) but also follow the East/West motion of the sun during the day (azimuth angle). The structure should have...

Read more »


Android application to monitor and control the MPPT Controller

package-archive - 1.49 MB - 06/18/2022 at 06:55


RAR Archive - 20.73 kB - 04/29/2022 at 18:10


RAR Archive - 911.29 kB - 04/28/2022 at 17:52


  • 2 × 20mm diam electrical PVC pipe (2m long) cost 0.9$ per 2m. used for the frame
  • 6 × 6 mm bolts 30mm long reused from scrap... used for the frame
  • 3 × 608Z ball bearing used for solar tracker. 0.5$ each
  • 2 × easystepper driver used for solar tracker electronics. 4.7$ each
  • 1 × DC DC 360 step down converter used for solar tracker electronincs. 0.5$

View all 11 components

  • MPPT Solar Panel Controller : Android App

    JP Gleyzes06/18/2022 at 06:54 0 comments

    The Android App is simply used to monitor and control the ESP32 firmware.

    This App is written in Basic4Android. This language is very close to .Net language and offer a really powerful way to write Android (or IOS) application in no time.

     The full project is available on my github page into this .zip file

    But before opening this file you should install the B4X environment on your computer. Don't be afraid this is easy to do and all you have to do is to follow precisely these instructions : B4A installation

    Then unzip the project and you should see something like this :

    Doule click on the .b4a file and the project will open into the IDE

    Before compiling the code don't forget to add these library (download them and tick the box)

    You will need to get familiar with basic usage of B4a. This help page will be precious!

    Finally you will be able to compile the code and install the .apk on your phone.

    And if you don't have time to compile the source code then here is the Android .apk file

  • MPPT controller : ESP32 firmware

    JP Gleyzes06/16/2022 at 08:59 0 comments

    The ESP32 firmware for the charge controller can be found on my Github Account here : ESP32 firmware

    From this repo, put all the fles into a directory named "JP_eSolarPanel_ESP32"

    Then open the JP_eSolarPanel_ESP32.ino file. It should launch arduino IDE and open four tabs

    Enter your Wifi credentials, instal the required libraries and compile !

    As you will see the code is rather straightforward. The only tricky parts are :

    • bluetooth communication with the Android App
    • Over The Air firmware update (I used the standard example !)

    The 01_readSensors tab contains the code for... reading the sensors !

    I do use the ESP32 ADC to measure most of the analog values we need. This ADC is far from being perfect and suffer from quite important non linearities. If order to compensate these problem I perform a multilinear correction of raw values that has been calibrated for my own ESP32 and whose values are precise on the cut off voltages of 5, 9,3 and 16.8 V thresholds.

    Have a look at the Excel sheet into tthe github repo for more details : ADC calibration sheet

    Nthing special into this tab excepted that I do not read Iout from the BUck Converter. Instaed I compute it with an assumption that the total power is kept between input and output with the buck converter's efficiency ratio

    Win = Iin * Vin;
      Wmin += Win;
      Wout = Win * efficiency;  //power is almost preserved but efficiency is not 100%

    The 02_performMPPT tab holds all the MPPT algorithm described previously.

    Nothing to add excepted that I  have implemented a fast convergence process which is quite efficient!

    This is mainly based on "how far" we are from the VinMPPT voltage. If far then the step used to correct the Buck converter voltage is higher.

     if (Vin > 19.5) step = 150;                   //start fast then decrease
      else if (abs(Vin - VinMPPT) > 2) step = 100;
      else if (abs(Vin - VinMPPT) > 1) step = 20;
      else if (abs(Vin - VinMPPT) > .3) step = 8;
      else step = 1;
      if (deltaWin > 15) step = 1;              //if power is oscillating too fast (20%), slow down
     if ((outputMode != MPPT)&&  (abs(VoutMax - Vout) < 3.0))  step = 1;

    I must admit that this part of the code was tuned quite empirically... but it works really well on my panel !

    Finally in order to cope with shadows or cloud I force the reset of this process every minutes :

    if ((millis() - MPPTchanged) > 60000)           //force a refresh every minute
        dutyCycle -= 10;                             //decrease; //avoid staying into local minimum
        WinMPPT = 0;
        MPPTchanged = millis();
        Serial.println("local min ");
        TelnetStream.println("local min ");

    The 03_charging tabd handles all the logic of cherge for the various modes

    For exemple the Solar charge mode is quite simple and implement a classical constant current / constant voltage logic.

     case SOLAR_CHARGER:                                     //charger mode MPPT & CC-CV CHARGING ALGORITHM
          if (Iout > IoutMax) dutyCycle += step;                         //Current Is Above → decrease current
          else if (Vout > VoutMax) dutyCycle += step;                    //Voltage Is Above → decrease voltage
          else performMPPT();                                            //tab #02
          if ((Vout > VoutMax) && (Iout < IoutMax * 4. / 100.))
            VoutMax = VbatteryFloat[myBattery];                          //switch to float charging mode

    I still have to polish this code for the end of charge when going to float mode for lead Acid of to cut off the charge for lipo.

    Currently this is implemented by the same piece of code simply with different cut off thresholds (tab0) :

    enum typeBat {ACID_12V, LIPO_1s, LIPO_2s, LIPO_3s, LIPO_4s};
    int  myBattery = LIPO_3s ;
    float VoutMax = 0.;                                    // Maximum voltage output of charger (including .3V ideal diode drop out
    float IoutMax = 0.;                                    // Maximum current output of charger
    float VbatteryMax[]       = {15., 4.5, 8.7, 12.9, 17.1};    //   USER PARAMETER - Maximum Battery Charging Voltage (includes .3V diode drop out)
    float VbatteryFloat[]     = {14.4, 3.3, 6.3,  9.3, 12.3};   //   USER PARAMETER - Minimum Battery Charging Voltage (includes .3V diode drop out)
    float Icharge[]           = {5.0,  1.0, 2.0,  3.0, 4.0};    //   USER PARAMETER - Maximum Charging Current

  • Solar Tracker source code

    JP Gleyzes05/13/2022 at 09:22 0 comments

    I have just published the source code of the solar tracker.

    You can find it on my github page here : ESP32 Solar Tracker

    This code implements exactly the current status of the tracker as shown into the video

    Features implemented are :

    • try to connect to internet
    • get the UTC time over NTP server
    • compute the sun position using the excellent solar calulator library (licensed under the MIT License)
    • compute the stepper motors motion
    • read the power voltage
    • perform the motion if the power level is enough to drive the motors
    • apply a sleeping strategy (sleep 10 minutes during day or sleep the whole night)
    • reset to the next morning position if needed
    • sleep and wake up next time

  • Calibrating the Solar Tracker

    JP Gleyzes05/01/2022 at 13:41 0 comments

    What is the panel Azimuth what is the panel Elevation, these are the two questions the ESP32 firmware is asking... before moving to new sun angles.

    We do need a way to tell the firmware these answers. Classically any  CNC machine or any 3D printer asks the same questions and implements a so call "homing strategy" using bed probes or home switches. You just move the axis one by one until you reach the home switch.

    On my SolarTracker board I have thus added "home switches" headers in order to connect "switches" or any other sensor to perform homing.

    Similarly the Azimuth gear has a "boss"  that could hit a switch to tell the firmware that it is at the homing position for Azimuth.

    But the fact is that currently I haven't yet implemented these features... And it is not a matter of difficulty, but rather a matter of simplicity of operations !

    Homing the system could be rather long as you would have to rotate Azimuth for example to the south and elevation to the max angle (70°). This could take several minutes...

    I wanted something simpler and much more rapid.

    For the Azimuth when you start the system it is so simple to point the panel directly to the sun.... And as my lazySusan design allows a full 360° free rotation, there is no need to fix a home point !

    For the elevation angle you can also disengage the lead screw, you can rotate it manually in order to get the right elevation angle.

    As this is working sooo well, I will even add a few more features in the software :

    • modify the MPPT Androdi App to add sun angles computation and display for the current time and latitude longitude 
    • allow a touch pad during boot time (after manual reset) to tell the firmware that you are calibrated and can start motion from this position

    By the way, there are a lot of  "sensors Applications"  on the GooglePlay that you can use to precisely know the panel elevation and azimuth angle. Example "sensor box" for Android

    Sitting your phone directly on the panel you can have the exact values for Azimuth and Elevation (complement to 90°)

  • MPPT Controller hardware

    JP Gleyzes04/29/2022 at 16:46 0 comments

    This cheap device follows this schematics (not sure that it is perfect but enough to understand the mod !)

    You can control manually the output voltage with the multiturn potentiomer "V Adj". This is producing an offset voltage to the reference 1.21V. This offset is then taken into account by the LM25116 to correct the output Voltage (pin VOUT).

    Another (more tricky to understand) voltage offset is issued on top of D3 and added to the Vadj one. This voltage is tuned by the CurAdj potentiometer which is acting on the feedback pin of an Op Amp, the positive pin being directly at the voltage of the shunt resistor Rs (thus proportionnal to current). So this Cur Adj offset is used to limit the current of the buck converter. Interestingly current control and voltage control share the same input on the LM25116 chip. Meaning that the LM25116 is only a voltage controlled device !

    The hack consists in :

    • removing the current Adj control (you can do it by desoldering D3)
    • removing the V Adj potentiometer
    • adding a PWM voltage (seen as a variable DC voltage by the LM25116) in place of D3 and acting as a MCU controlled offset voltage. (So PWM + a 6.2k resistor + a diode)

    No need to create a PCB for this... Soldering directly on the back of the Buck convertor is enough (quick and dirty ) !

    Similarly you need to measure the PV input voltage and the Buck Output voltage.

    These signals will feed the ADC of ESP32.... so we need a voltage divider to bring all this down to max 3.3V...

    This simple schematics is also directly soldered on the back of the PCB... (quick and very dirty)

    Now the only missing signal is the Solar panel Current. 

    I did try to reuse the Current sense OpAmp of the buck converter but I got more noise than proper signal...

    Finally I have invested a few more $ into a AS712 current sensor module. I selected the 20A version which is plenty enough for a solar panel with a 7A max output !

    Once again no solder for this module but rather strong copper wires as all the juice is going through it....

    This module needs 5V to be powered. Will be shared with the ESP32 5V input

    Its output is a voltage between 0 and 5V but with a 0A output at midrange (2.5V). This means , as we only measure DC current, that (if properly wired) the output will only swing from 0 to 2.5V (0 for the max current of 20A). Just to say that there is no need for a voltage divider to accomodate 3.3V...

    You will also need a small 360 DC/DC converter to step down the PV input voltage to 5V to power the ESP32 (the small 5V regulator from the Buck converter being to weak to power the ESP32)

    And  of course you will add another ESP32 lolin32 lite breadboard.

    The overall schematics is quite simple : (one day I will do a PCB for this !)

    And finally to protect the output battery from reverse flow into the solar panel when no sun, you MUST add a strong Schottky diode on the positive Vout pin. If you have a few $ to spend (I had) then a good choice would be to replace this diode by an ideal diode. It is the red module on the output of the Buck converter picture

    The final integration is depicted on this photo. 

  • Solar Tracker electronics​

    JP Gleyzes04/28/2022 at 19:03 0 comments

    The electronics part of the solar tracker is quite simple as we reuse existing components which are mostly only integrated all together on a custom PCB.

    Here is the schematics : 

    The heart of the system is the Lolin32 ESP32 breadboard.

    It is driving two steppers motors via two easydrivers boards. These drivers accept classical Step and Dir signals.

    They can be switched into "sleep" mode preventing to draw too much current when the motion is finished. Note that in Sleep mode, the motors will loose their torque and may rotate freely.

    Thanks to the "wormgear" design of the mechanical parts, the axis will not move if a force is applied on the panel even when the motors are off.

    The board is powered either directly from the solar panel or via an external battery (which will be charged by the MPPT controller).

    Nevertheless it may occur that the voltage at the input of the motors is not enough to perform a strong motion. This is the reason why this voltage is measured via the voltage divider R1/R2 and the ADC input of the ESP32 (VP pin).

    Note as well that the lolin32 is equiped with a lipo charging circuit. This is why I have added a single cell 18650 li-ion to the board. This will allow to power only the MCU if the 16V signal is weak or not present. Doing this allows to preserve the software side of the system and thus to recover from cloudy situations !

    This schematics has been translated into a single sided PCB

    The PCB itself was etched with my "toner transfer" method explained on my web site.

  • Solar Tracker mechanics​

    JP Gleyzes04/28/2022 at 16:57 0 comments

    Azimuth axis 

    On this CAD picture only the bottom plate is shown.

    Between top and bottom plate is inserted a lazy Susan turntable bearing.

    Be sure to choose a 6 inch model . The main gear must be able to enter the hole of the lazy Susan.

    It must also be perfectly centrered with the Lazy Susan center. Be careful.

    Here is a view of this axis finished :

    The coupler must be fited with a 5 mm screw (visible on the top picture) and a 2mm one on the other side

    Align everything and screw the bearings holders in place. Lock any motion of the wormgear with 5mm nuts.

    Do the same for the elevation axis :

    All the 3D printed "hinges" must rotate freely on their respective axis. FIle the parts to achieve this !

    Here is a detailled view of the "screw holder"

    This is the part which achieves the translation of the linear actuator of the Elevation axis. As it is fixed to the PVC pipe which is also fixed to the top hinge of the frame, when the lead screw rotates then this part can only go up or down, pushing or pulling the top of the frame !

    As visible on the picture (black dirty color), you should add a few drops of oil on the leadscrew to ease rotation.

  • frame finished

    JP Gleyzes04/28/2022 at 11:08 0 comments

    frame description is now finished ! 

    It was an easy section !

View all 8 project logs

Enjoy this project?



Frank wrote 05/14/2022 at 04:15 point

This is a great mechanical design! I couldn't see in the pictures where the elevation homing switch is located. Is it on the elevation motor holder, and gets triggered  when the panel reach  its lowest horizontal (bottom) position? Thanks for sharing. My best wishes for the competition! Cheers, Frank

  Are you sure? yes | no

JP Gleyzes wrote 05/14/2022 at 07:16 point

Thank you Frank !

BTW you are right the elevation home switch is not yet implemented. See the reason here :

However the code is already made and tested on another heliostat project !

I would probably put the switch (or inductive probe) on the "nut" pushing the top of the panel. And yes it would trigger on the lowest panel position !

I can see that you have also made interesting projects I will follow you as well !

  Are you sure? yes | no

br1tt00 wrote 04/29/2022 at 03:19 point

thats one wai to save money

  Are you sure? yes | no

Jim wrote 04/29/2022 at 02:47 point

Great job !  People don't realise just how much power is lost due to their panels NOT looking directly at the Sun. You've nailed it. Cheers. 

  Are you sure? yes | no

JP Gleyzes wrote 04/29/2022 at 06:22 point

Thank you for your interest.

Yes you are right, and MPPT controller is also one way to increase power !

I will post my controller very soon, stay tuned.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates