Sagheer Abbas Shah (041-18-0016)
Abdul Basit (041-18-0014)





















Introduction to Project
Infrarred radiation from sun is varibale throughout the day. In morning time the intensity of sunlight is lower as compared to the sunlight in the mid-day and the evening afternoon intensity of sunlight is also lower than the mid-day intensity of the sunlight. due to this phenomenon, the energy we receive from the sun varries all the day. Also clouds can suddenly effect the energy being received by our solar panels. To give an optimized solution to this problem, we use a technique to efficiently charge our batteries through solar panels. Maximum Power Point Tracking Technique is utilzed in our project to provide appropriate voltage to the battery. As in Pakistan, the environment is hot, so we decided to design an MPPT solar charge controller based on Buck Converter. It will take input from Solar Panel and then will operate upon the input volatge and current and will give an appropriate output required by the battery.

Design requirements
We want to design a solar charger that can be carrie dor placed anywhere. it should look attractive as well as should not be of very large volume. We have resources of 3D-Printing in FabLab and also the facility of Laser-cut Acrylic sheet. utilizng these two resources we wanted to design a product that can be carried anywhere with great portability and lesser size.
Sample image of final design
For our product, initially, we thought of a simpler design keeping in mind our Display of the input and out entities as well as sockets for input, output and supply voltages.

Mechanical Drawing
The mechanical design depends on the PCB dimensions as well as the devices related to it. we choose appropriate dimension to save as much of the filament of 3D printer as possible.

Project Execution Plan
The components involved in the circuit were not easilt available in pakistan, we had to order it from china to develop a PCB because all the coponents were in SMD packages.
we had following project execution plan depending upon the above fact.

2- Understanding the working principle of components involved
3- deveolping a PCB
4- Fabrication of PCB
5- First soldering the componets required by the microcontroller to burn the bootloader and test the microcontroller's working
6- After succesfully testing the microcontroller, soldering the rest of the components
7- Energizing the circuit and troubleshooting all the errors
8- After getting desireable results, Designing the case for the PCB
9- Preparing the product for the final go
Deligation of Task

Higher Level System Diagram
Following diagram shows how the Project works on a macro level:

Description of Principle of Operations
Maximum power point tracking solar charge controller works on the basis of Buck/Boost converter. The circuit we chose only has the buck converter as in pakistan, most of the time wether is very hot which gives extra power. The charger takes input from panel which is lesser than 20 volts. Which is sensed through a voltage divider circuit developed on the input and gives it to an analogue pin of microcontroller. also a current sense amplifier is attached using a shunt resistor on the main input section. There is also a voltage divider circuit on the output section where the battery is connected. A current sense amplifier is used on the output section as well. These all values are fed to the microcontroller. Depending upon these values, microcontroller decides about the PWM signal fed to the Half-Bridge Mosfet Driver IC. this IC takes input as a PWM signal and switches the MOSFETs with a very high speed. The Buck converter acts according to the decission made by microcontroller depending upon the input and output currents and voltages.
Bill of materials

Brief Description of Major Components
The low-power Microchip 8-bit AVR RISC-based microcontroller featuring 32KB self-programming flash program memory, 2.5KB SRAM, 1KB EEPROM, USB 2.0 full-speed/low speed device, 12-channel 10-bit A/D-converter, and JTAG interface for on-chip-debug. The device achieves up to 16 MIPS throughput at 16 MHz. 2.7 - 5.5 Volt operation.
We have used this microcontroller because of its lower consemption and usb support. its features helped us to replace arduino with this microcintroller in project.

2. USB mini:
The small USB socket found on digital cameras, external hard drives, USB hubs and other equipment. Mini USB is much smaller than USB Type A and B but twice as thick as Micro USB. We have used this componant as we could burn our code easily on the microcontroller.

3. INA213 (Current sense amplifier):
The INA21x are voltage-output, current-shunt monitors (also called current-sense amplifiers) that are commonly used for overcurrent protection,
precision-current measurement for system optimization, or in closed-loop feedback circuits. This series of devices can sense drops across shunts
at common-mode voltages from 0.3 V to 26 V, independent of the supply voltage. Six fixed gains are available: 50 V/V, 75 V/V, 100 V/V, 200 V/V,
500 V/V, or 1000 V/V.
The low offset of the zero-drift architecture enables current sensing with maximum drops across the shunt as low as 10-mV full-scale.
These devices operate from a single 2.7-V to 26-V power supply, drawing a maximum of 100 uA of supply current. All versions are specified over the extended
operating temperature range (40°C to +125°C), and offered in SC70 and UQFN packages.
We have used this componant as to sense the input and output voltage/current to track the working of the MPPT.

4. IR2104 (Half-bridge):
The discrete Half-bridge driver based on IR2104 gate driver IC and low impedance high current N channel IRFP4368 MOSFETS , The IR2104 is a high voltage, high speed power MOSFET driver with independent high and low side referenced output channels. We have used this componant to derive the mosfets.

5. Schottky Diode :
The Schottky Diode is a type of semiconductor diode which have the advantage that their forward voltage drop is substantially less than that of the conventional silicon pn-junction diode. Schottky diodes have many useful applications from rectification, signal conditioning and switching, through to TTL and CMOS logic gates due mainly to their low power and fast switching speeds.

6. IPB136n08n3 (PWR-MOSFET):
These are ideal for high frequency switching. Optimized technology for DC/DC converters. Excellent gate charge x R product N-channel, normal level. 100% avalanche tested. Pb-free plating; RoHs compliant.

7. Shunt Resistors:
Shunt resistors are used with current sense amplifier to sense the current.

8. Voltage Regulator LM7805:
We are using this voltage regulator because the input voltage is 12 voltages and our microcintroller and some other componants run on 5V so its is regulating the voltages. It is easily available for use.

9. Zener Diode:
We are using zener diode if our input voltage increases from the circuit limitations, it will directly ground the voltages.

Connectivity to components (Protocol)
As we have used Atmega32U4 microcontroller, which has the support to connect a USB, so we are using Universal serial bus for the connectivity of our board with PC to burn the code into it.
Electrical Schematic
The schematic diagram is taken from the Eagle file we have developed for our final PCB:

Brief Description of Schematic

In above figure we have given numbering to the different portion of the schematic, it is explained below:
1- Microcontroller and its required components:
The microcontroller is the key component of this whole circuit as it is making decissions on the basis of values it is receiving.
the components attached with microcontroller in "1" are chosen according to the Arduino Leonardo which uses the same Microcontroller.
An ICSP header is also connected to burn the boadloader on to the microcontroller. The connection of a USB MINI are also made with the
microcontroller.
2- Input Voltage Divider Circuit:
This circuit divides the input voltage to such a level in which microcontroller can sense it because if we attach the microcontroller directly, it cannot
bear the voltage and will burnout intantly. So we have to reduce the voltage to such a level which can be given to microcontroller. We used a 39kiloohm resistor and a 10 kilo ohm resistor
to make the ratio appropriate. Also two zener voltages are connected in parallel for we want input voltage not more than a certain value.
3- Input Current Sense Amplifier:
INA213, a current sense amplifier is connected here to sense the input current. The shunt resistor helps this IC to sense the current and then this IC gives output to the Microcontroller which then displays
it on the LCD.
4- Half Bridge Driver IC and Buck Converter:
The IR2104, a half bridge MOSFET driver takes input of PWM signal from the microcontroller and then performs the switching of the MOSFETs. Hence controlling the output current and voltage.
5- Output Current Sense Amplifier:
It works on the same principle as the input current sense amplifier.
6- Output Voltage Regulator:
Volatge regulator is developed here for the same reason, the only difference is the voltage for division. Here the voltage is 12V. So, we connected a 22 kilo-ohm resistor in series with a 10 kilo-ohm resistor.
7- LCD connectors:
these connectors are attached for the display which will be mounted on the casing.
8- Power Headers and Voltage Regulator:
The three headers for 12 volts Supply(on which the board will operate), Panel(to take input from solar panel) and Output(for the output voltage taken from the circuitry ).
The voltage regulator is connected because we are using 12V supply on which the IC IR2104 operates but all other ICs need 5V to operate so we are using this LM7805 for this purpose.
PCB Layout
We used Eagle software to develop the PCB for our project and we created the layouts in .png formats as the Milling Machine available in Fablab needs picture format for its processing. Following is the final PCB layout:

Challenges While Routing
whille routing the PCB it consumed a lot of out time because the circuit we were following used a separate board for microcontroller but our aim was to embed both the circuit on a single layer, making it more compact. This came with lots of hurdles while routing, we used few zero ohm resitor to overcome routing issues and at the end developed a lot more compact circuit after tens of attempts.
Bill of Material on taped on a Paper
Following is the Picture of the components taken from the FabLab

Picture of Clean Printed Circuit Board
For fabrication of our PCB, we used SRM-20(Rolland's mills) machine. It needs a monochrome picture for its processing. the monochrome picture we took from Eagle software were then uploaded to the "Fab-Modules.org" and then we generated the ".rml" files needed for SRM-20 to process the milling.


Picture of Populated Circuited Board
After fully soldering teh components, our board looked like this:

Procedure adopted to burn Bootloader
To burn the boot loader on to the microcontroller, we used ICSP header and arduino IDE.
we burnt the bootloader of Arduino leonardo onto the ATmega32U4. For this we followed the following steps:
1- connetcing th board with PC through ICSP header and a USB mini cable for further burning the test code.
2- selecting the board through "Tools" menu.
3- in tools, further going to submenu "Select Board".
4- selecting "Arduino Leonardo".
5- again going to "tools" menu and then selecting the submenu "Port" and then select the port on which ICSP is connected.
6- again going to another submenu "Programmer" and selecting "AVRISP mkll" .
7- last step is to select the last most option of "burn the bootloader".
8- wait for few minutes till it shows the message on status bar as "Done burning Bootloader.".

Picture of successfully operating circuit
Following is the picture when we succesfully got the output:

Picture of fully assembled System


Demonstration of operational circuit
The FlowChart of our software design

Main Functions of the code
1- buck_setup() Function:
This function is designed to set up the timer to generate PWM signal. It initializes the timer with the desired duty cycle to set the circuit up.
2- buck_enable() Function:
This method is written so to enable the clock source and then turns on the Half bridge driver through PWM signal.
3- buck_disable() Function:
This functtion turns off the clock source and sets the duty cycle of PWM signal to zero.
4- buck_duty(unit8_t duty) Function:
This function checks the duty cycle of the and stes it to the appropriate value for the operation of the Buck converter. it Arranges the duty cycle
to an optimum level.
5- write_display() Function:
This function is utlized to write on the LCD. it tfakes values from several values and displays them along with some text on the LCD.
6- read_values() Function:
This function takes the values from the volatge divider circuits and current sense amplifiers and sets them correctly after callibration.
7- buck_update() Function:
This method is the key function in the code which calls some of the above functions and updates the duty cucle accordingly.
Challenges faced while coding
The major problem we faced during the coding for this project was configuring the timer for generatng PWM signal. We tried to configure different available timers using different PWM pins on the board. First we configured timer1 using PWM pin 9, but this timer was a 16 bit timer which brought a lot of problems because our major calculations were based on the 8 bit timer. so after struggling a lot we obtained a maximum volatge of 7.44V at the output. Furthermore we connected our Half bridge driver with PWM pin 11 and using timer0 we obtained the exact output.
CAD Design of Enclosure
For Casing of our prodcut, we used both laser Cut and 3D-printing. We wanted to consume lesser filament for 3D-printing thats why we thought of making the top of the casing clear to make it a bit unique. So, we made the top using laser cut. We designed a locking mechanism of Slide and press. We slide one side of the top and press the other towards the bottom.
CAD Design with Dimensions
Followings are the CAD design pictures with dimensions:


Procedure followed to fabricate design 3D-Printing Printing / Laser cutting
We used both processes i.e. 3D-printing as well as Laser cut. out main circuit containing part was made using 3D-printer but the top of the case was made using Acrylic sheet with laser cut.

Picture of the final design


Business model
Every product which needs to be in the market requires a good business plan. for our product, we considered few major point regarding its cost and its users. As our project is user friendly in terms of its size, the size increases the durability. One can carry it anywhere to be used. Furthermore, solar charges(MPPT based) are very expensive products, we used such components which are commonly available and are cheap. With these two major advantages, we hope to cover a good number of users of our products when released in the market.
References
1. https://soldernerd.com/2016/01/21/arduino-mppt-solar-charger-shield/2- http://www.leonics.com/support/article2_14j/articles2_14j_en.php
3- http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf
4. https://forum.arduino.cc/index.php?topic=125252.0
5. https://www.element14.com/community/welcome
6.https://hackaday.io/project/4613/components
7.https://pdfs.semanticscholar.org/4a51/47c800c66d2fa280f9b0bcdd484abf37abf4.pdf
8. https://www.homemade-circuits.com/mppt-circuit-using-pic16f88-with-3/
Credits Acknowledged
The project we have implemented was first designed by a hobiest "Lucas Fuslar", whose project have been chosen for Hackaday finals. He have done a lot of experiments over this project We were following his lead majorly in this project. Our FabLab Assitants also were a source of great help when we had difficulty relating hardware. Our lab instructor Sir Aizaz Ali helped us dealeing with the code as well as routing of the PCB. Sir Nadir was a great source of help when we needed help in milling the PCB. Sir Azmat assited us while were designing the enclosure for our project. Without all of these, our succes in this project was difficult.
The table outlining the cost of project

Zip file containing source code
Zip file containing cad files
Zip file containing sch and brd files
Conclusion
This project was full of learning. We had a lot of practical interaction with our theoratical knowledge. This project proved a golden oppurtunity as we implemented most of our theoratical knowledge. Creating an inductor, milling a PCB, designing an enclosure.etc. all of these experiences proved fruitful in increasing our skills and capabilty to do experiments and troubleshooting. In future, we have decided to continue such kind of practice for further learning and skill development.
Copyrights:2019,Sagheer and Basit,All Rights Reserved | Terms and conditions | Privacy policy