DIY 1kW Arduino MPPT Solar Charge Controller (WiFi ESP32)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to part one of my four part diy open source mppt tutorial today we are going to build a one kilowatt smart mppt solar charge controller compatible with 80 volt 30 amp solar setups and all battery chemistries up to 50 volts it is equipped with a wi-fi phone app telemetry feature that lets you track and log your solar data and comes with an intuitive programmable lcd interface and for those geeks out there here is the quick spec sheet of the project in this part one video i'll be showing you the assembly process of my open source reference design and help you get yours going on the other hand part 2 is the design process tutorial which includes my diary of its 4 months of testing and continuous operation you would see a lot of tidbits of part 2 3 and 4 on this video as well the project runs in a dual core esp32 and is completely arduino compatible i made an open source firmware for it and it will receive continuous support in github it is packed with protection protocols algorithms and developer friendly features welcome to the 2021 tech builder reboot this episode is brought to you by pcbway my trusted quality pcb manufacturer for project making my workspace has been completely off the grid for six months now and this project has been charging my setup for four months and counting but before i came up with the safe tested and working build i made six prototype revisions before i ever arrived with my final version called project fugu the links for the schematics documentations board designs and codes can be found from the video descriptions below the main board is compact and is filled with a lot of surface mount components i can't make a homemade pcb for this one so i got mine professionally done by pcb way you get 10 high quality copies of your board for the price of five dollars shipping and production time is fast and i got mine in just a few days and the results were amazing if you are interested i'm providing a quick purchase link below for my board so you don't have to manually input the gerber files to the website let's talk about the design that i have arrived with from part two of the design process video the project works with solar panels with an absolute voc of 80 volts and a durated imax of 30 amps the key to this project's tested high energy conversion efficiency rating is the absence of diodes at the main mppt's buck the project uses synchronous bug converter topology it is much more efficient than the common asynchronous buck converges that most of you are familiar with instead we're using half-bridge n-channel mosfets with extremely low on resistance as for lesser conduction losses most online tutorials would fail to get synchronous buck converters working due to its complex operation but with the robust code i got mine to work flawlessly through a bunch of protocols and algorithms an ir2104 driver was used to drive the n-channel bridge mosfets to ensure both are fully saturated the mosfet driver is fed with a 39 kilohertz 11 bit resolution twm signal programmed to the esp-32 the pull-down resistors prevent the mppt's buck from getting destroyed when the esp32 pins float when programming through a usb port during operation the solution for the infamous backflow current issue that leaks from the high side mosfet's body diode was solved using the proper implementation of a reverse and channel mosfet a b1212 isolated dc to dc converter provides a separate ground potential for the source and gate pins of the reverse high side and channel mosfet the dc isolator is then switched using a logic level and channel mosfet at its input we have two xl7005 buck regulators for supplying the regulated 3.3 volt and 12 volt supply lines a linear regulator is connected at the end of the 12 volt buck for the 5 volt supply and yes d8 and d4 lets the project get power from either the solar panels or the batteries at the input we have a voltage divider for voltage sensing and the 3d amp acs 712 hall effect current sensor for current sensing i changed the typical value for c2 to limit the bandwidth for noise reduction and since it is running at 5 volts i had to make a voltage divider at its output for it to work with my external adc which is using a lower set voltage reference of 2.058 volts you will notice that i've also added an rc filter to further reduce the noise at the output we also have a voltage divider but with no current sensor since we're using the input current sensor to derive the output current through coded math in part 2 i will show you the dual current sensor version prototype and tell you why it was a bit impractical for my favorite part i used an external i squared c adc for better sensor measurement precision accuracy and stability you can use ads-1115 for 16-bit resolution and ads-1015 for 12-bit resolution they're both compatible and i have tried them both 16-bit was way overkill go for the 12-bit version as it is faster cheaper and offers more than enough resolution for this project's needs the brain for this project is a blazing fast esp32 and in case you didn't know the esp32 is an arduino compatible dual core mcu with wi-fi bluetooth and a ton of killer features and specs for less than three dollars since we're using a standalone w room esp32 mcu module i had to internally add a ch340c usb to u-wart interface for programming the arduino esp-32 the ntc temperature sensor is connected to the esp32 adc pin since it doesn't need much precision now let's get to the materials this project involves a lot of service mount components if you live in the philippines i get most of my surface mount components from egismo manila total cost for the build is around 30 depending on where you get your parts from in the file package i made an excel sheet for the parts list with some alternative links you need this toroidal core and a gauge 16 solid wire because we're going to make our own inductor later go ahead and grab your board a pair of tweezers a soldering iron a hot air gun and perhaps a disordering pump if you have trouble finding surface mount chips a good alternative would be extracting them from modules you can use your hot air gun or soldering iron to heat up the pads and remove the chip from the board and that is one cute ads-1115adc gosh vssop packages are so tiny and you can do the same thing for the acs-712 current sensor there are still some parts that you can get from the board such as the resistors and capacitors resistors are labeled but capacitors are not so before you can use and recycle them you need to measure the capacitance of each using your multimeter some parts like this ams regulator with an sot-223 package can easily be soldered by hand and yes even the tiny vsso p10 package can be soldered by hand too but one thing that can make your work easier is something called a solder paste it is technically a mixture of flux with some really tiny granules of lead and with a hot air reflow gun applying it to the pads aligning your chip to the pads and heating it up it is the most satisfying thing that you will ever see in your life as for soldering the esp32 well i find it much more convenient to solder it by hand than use some solder paste the zero 805 package resistors and capacitors can also be soldered by hand but well i am a lazy guy and i usually use my pid oven to get work done really fast but for the sake of demonstrating the beginner's way of doing surface mount soldering or reflow here it is oh yeah one thing to take note of if you're using the ch340 variant of the hubert chip there is no need to solder a crystal but if you're using the ch340g you have to solder a 12 megahertz crystal resonator on this pad i'm using the standard female mini usb port be sure to snip off the nibble guides before mounting it to the board it can also be soldered by hand but it gets tricky so just use some solder paste and your hot air gun now that's perfect same goes to the mosfet driver section while i over did this with some solder paste and to the tiny surface mount inductors as well it can be soldered by hand too but well i want the easy way out and that looks good solder paste is also good for those buck regulators with some thermal pads right underneath yupee we have all the surface mount components on the board let's move on to the through holes you can now proceed to mount and solder the mosfets on the board then grab your heat sink align it to your mosfets and use a sharpie to mark the holes drill some m3 holes and you will need some plastic bushings and some isolation pads to isolate the tabs of the mosfets from the heatsink you can actually just isolate the rightmost mosfet because the center and left mosfet drain fins are actually tied together in the first place as for the ntc thermistor temperature sensor i got a screwable one so i had to screw it on the heatsink and solder the leads to the board then proceed with the tiny electrolytic capacitors then the male headers and the dc to dc 12 volt isolator then the mini automotive fuses i didn't want wires to be soldered directly to the board so i went with a 50 amp screw terminal now let's build the toroidal inductor in part 2 i'll be explaining my excel calculator but for now visit coil32 and follow my lead luckily i found a data sheet to the random toroidal core that i bought for half a dollar this way don't have to guess much i'm using a gauge 16 solid wire and i need a 64 micro henry inductance for my design then input your course dimensions to the calculator set chamfer to zero and get the magnetic permeability from the data sheet good to see that it matches the black core color code which is around 60. press calculate and now i know i need around 30 turns and around 1.1 meter of gauge 16 solid wire get your tape measure and cut the length well slightly longer than the one that your calculator gave you it's better to have some excess since you can cut it later if you're using the same core that i have wind it around 30 turns until you complete the inductor magnet wires are animal coated so be sure to sand them off or use a metal file before you get to solder them and now you have a powerful inductor it is a good practice to verify the inductance and the inductor current so that's what we're doing i'm going to use my agilent lcr meter and attach my kelvin probes to my inductor and just like that we're really close to 64 micro henries if you don't have access to lab equipment a 7 lcr meter is always great to have close enough just don't expect the measurements to be as precise as lab grade lcr meters inductor saturation current is a bit tricky to get so i made my own inductor saturation current oscilloscope test rig it is a mini project that i posted on my personal facebook account which i plan to make a video tutorial on this soon by adjusting the pulse duration in microseconds i get to evaluate the inductor's current curve oh boy the inductor has a soft saturation makes it a bit harder to find but i guess it's around at 1.8 divs using ohm's law and the shunt resistor inside it seems you made a 36 amp inductor please correct me if i'm wrong because it seems too good to be true now that's done we can finally mount the inductor and the low esr capacitors to the board and that's the last thing you need to solder to the main board months of development and it just really gives me some tears of joy to see this i'm also providing some 3d printed file enclosures for you to choose from we got one for the lcdn buttons and the one without the one without lcd is really compact and slim but i don't want to set the settings through the phone app but i want to set it through the lcd screen okay for the cooling fan originally i designed the board for 3-pin 12-volt cooling fans like this server fan but it was thick and expensive so i went with a slimmer and cheaper volt 2 pin cooling fan usually used in 3d printers but for it to work with my mppt i had to make this impromptu breakout board using a logic level and channel mosfet and now i can use it with a 2 pin cooling fan mount the fan to the enclosure then screw it in place after that you can mount and screw the mppt board to the enclosure and plug in the cooling fan breakout board now let's proceed to the cover i'm using a 16 by 2 arduino compatible character lcd the one that has an i2c backpack driver you know the drill you have to adjust that contrast knob later as for the button breakout board it also acts as an i2c expander i forgot to order one so i had to make a homebrew pcb for it nonetheless it's still available on my pcb way link i also soldered some female headers for it to connect with my main mppt board screwed the lcd in place and installed the 3d printed button caps by the way i added some tape to give it some cushion between the buttons then screw the button breakout board to the enclosure's cover and it's all coming together then connect the button breakout board's wire to the mppt's interface port put the cover to the enclosure and now you have your mppt project cooling fan at the side vent on top for passive cooling and an extra vent for the active cooling oh yeah ports up front be sure to screw the cover in place and i added some gauge 12 wires with some xt60 connectors at the end and be sure to tighten them now let's get ready to program the lcd sometimes does not light up not unless it is powered externally if you get a standby power of 3 watts it's probably because of a bad batch of xl chips anyway connect it to your computer download the arduino program and be sure to put it in one folder named after the main file otherwise it won't open properly from the arduino ide it has thousands of lines of codes which i subdivided to different tabs to make it organized and less messy the part 3 video will give an in-depth explanation and the entire firmware including the math algorithms program flow protection protocols and a lot of developer functions just be sure to download and install all these libraries in order for this program to work and since i was in a rush to get a phone app working i based it out on the blink platform download blink the legacy version which is available in both ios and android install and open the app and you can quickly log in using facebook to get a copy of my app layout open the qr code scanner and scan this and that's pretty much it now you have a working phone app for the telemetry oh wait link will email you a special authentication token so you would have to paste that on the arduino code as well as your wi-fi ssid and password go to the tools menu and be sure that the esp32 dev module is installed through the board's manager just copy my other configurations and select the com port where your mppt is connected and finally click on the upload button once it is successful you would see a done uploading message and now you can disconnect the usb cable let's talk about the lcd interface version 1.0 of the firmware has four readout display layouts you can cycle through them until you reach the settings menu since this is our first time using it be sure to factory reset the unit in the first setting page you have two supply algorithms to choose from click on the select button to set it use the mppt with cccv if you plan to use this on solar panels or wind turbines as your input source and ccv only if you plan to use a psu or a linear power supply as your input source i'm using solar panel so it needs the mppt algorithm okay and for the really important part never ever use psu mode if you're going to use this for charging batteries be sure to use charger mode otherwise it will blow up psu mode lets the unit act as a programmable buck converter like a very powerful bench power supply charging mode includes the battery connect and disconnect protection function now let's set the charging voltage i'm using 8 cells of lithium ion phosphate that gives me a maximum charging voltage of 27.5 volts according to my prismatic data sheet as for the minimum battery voltage this is needed for the state of charge computation and my battery pack has around 22 volts if i could recall as for the charging current i do believe that my batteries can only handle 30 amps so i'm going with 30 amps you have the option to disable the cooling fan and change the fan temperature as well as the shutdown temperature wi-fi can also be disabled to save power but at 0.3 watts i wouldn't mind turning it on all day disabling auto load locks the mppt to the default arduino coded settings you also have a backlight timer that turns off the backlight once the button has not been pressed for a specific duration of time and you can use this to save extra power if you mind and you have cycled through the factory reset the last page shows the firmware version and date so how's the line regulation without load setting it at 27 volts exactly i was surprised with what i got i was only off with one millivolt and that's without a battery connected it's perfect in the strip down early version of the prototype i did an efficiency curve test using my adjustable nichrome water bath load controller and 4dmms to get the input voltages and currents to compute for the efficiency curve and i got a peak efficiency of 98.6 which i have doubts on because it sounds too good to be true and thus a part 4 for the tutorial though it is possible because the temperature delta was really low let's see on part 4. though i was unable to get the end of the curve because my dmms were limited to 10 amperes only okay now let's time to connect this to my solar panels this was filmed seven months ago and we didn't have the manpower to install this on the roof so i wired my solar panels in series and went against my heart by installing it at ground level then wired it to my workspace with a gauge 14 solid wire so much power losses back then i didn't have the fireproof box for the 8 cells of lithium-ion phosphate with a bms but anyway i connected the mppt in parallel to my sine wave inverter and batteries and they were all connected through my homebrew xd60 extension bay last summer my afternoon average was 500 watts to show you what the mppt tracks i'm connecting this to my pc for us to view the data through the serial com and this is just the essential data it's really fast at maximum power point tracking and it's not even using my experimental acceleration code just yet and notice how stable the values are you get booleans for various status and fault detections you'll find the input power pwm pwm floor limit input voltage output voltage input current output current water is harvested thermal temp automatic sensor calibration parameters state of charge loop time and more the loop time for the code without averaging can reach lower than 9 milliseconds per loop cycle and with 2 4 sample averaging which i recommend is still fast at 24 milliseconds per loop cycle i hope you like this project and hope it helps to those who try to get synchronous buck and ppt's working stay tuned for part 2 3 and 4 because there's more to come before i end the video many thanks to open green energy for providing a well written instructable guide for building mppts i really recommend his guides and appreciate his full honesty on the issues he has encountered on his builds i couldn't be more grateful to all my friends professors and colleagues who helped in getting this open source design possible stay safe and see you guys soon thanks for watching [Music]
Info
Channel: TechBuilder
Views: 369,653
Rating: undefined out of 5
Keywords:
Id: ShXNJM6uHLM
Channel Id: undefined
Length: 18min 10sec (1090 seconds)
Published: Mon Aug 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.