Major Project - Portable Solar Powered Refrigerator With Temperature Control Using Arduino Based PID Controller
Major Project - Portable Solar Powered Refrigerator With Temperature Control Using Arduino Based PID Controller
BACHELOR OF TECHNOLOGY
in
ELECTRICAL ENGINEERING
By
Devipriya Priyadarshini
Regd. No. 1704050004
U Kushal Rao
Regd. No. 1604050018
CERTIFICATE
ACKNOWLEDGEMENT
We express our deepest gratitude to our project guide Dr. Jatin Kumar Pradhan
whose encouragement, guidance and support from the initial to the final level enabled us
to develop an understanding of the subject.
Besides, I would like to thank to Dr. Papia Ray, Head of the Electrical Engineering
Department, Veer Surendra Sai University of Technology, Burla, for providing her
invaluable advice and for providing us with the guidance to complete our project
successfully.
We are deeply indebted to all faculty members of Electrical Engineering
Department, Veer Surendra Sai University of Technology, Burla, for their help in making
the project a successful one.
Finally, we take this opportunity to extend our deep appreciation to family and
friends, for all that they meant to us during the crucial times of the completion of this
project.
Devipriya Priyadarshini
Regd. No. – 1704050004
U Kushal Rao
Regd. No. - 1604050018
iv
DECLARATION
Devipriya Priyadarshini
Regd. No. – 1704050004
U Kushal Rao
Regd. No. - 1604050018
v
ABSTRACT
TABLE OF CONTENTS
Certificate.......................................................................................................................... ii
Declaration ....................................................................................................................... iv
Abstract ............................................................................................................................. v
4.1 Conclusion............................................................................................................... 21
REFERENCE ................................................................................................................ 22
APPENDIX .................................................................................................................... 23
viii
LIST OF FIGURES
Fig. 1 Thermoelectric (TEC) Module or Peltier Module .................................................. 7
Fig. 4 PID Control, MAX6675 thermocouple, Arduino UNO Schematic with Rotary
Encoder ........................................................................................................................... 11
CHAPTER-I
INTRODUCTION
Refrigeration has become an integral part of our daily lives. Whether we are at
home, in a shopping mall, buying groceries, or at a medical facility or blood bank. All of
these make use of refrigeration and cooling in some form or the other. However, the same
cannot be said about remote areas or villages in inaccessible places that may not even
have electricity supplied to them.[1] When it comes to emergency supplies such as
vaccines, important medications, or perishable goods, these items need to be transported
to such areas as early as possible and in optimum storage conditions. However, arranging
for suitable storage equipment may not always be feasible in a small period. In such cases
having a lightweight, portable appliance that can be easily carried and transported by an
individual or two people can help with emergencies.
Solar refrigeration is one of the best solutions to the aforementioned problem. As the
supply of sunlight is a resource that can be harnessed irrespective of location. Solar power
represents an unlimited source of energy and is the key to a clean energy future. Every
day, the sun gives off far more energy than we need to power every electrical material
present on earth. With the ever-increasing demand for power consumption and the
limitations of exhaustible energy resources, solar power seems to offer a highly promising
future resource.
Some of its advantages include:
x Renewable - Solar Energy being a renewable energy source, and widely
accessible irrespective of location.
x COၷ-free – As there are no fossil fuels involved in the process of solar power
generation, it eliminates the risk harmful gas emissions that happens due to
conventional fuels.
x Low operating costs – Since the PV cell does not need fossil fuels to operate,
there are no fuel costs and variable costs.
2
3
All refrigeration systems work by transferring heat from one place to another, thus
cooling the designated area by reversing the natural flow of heat with the application of
energy. However, the process of how the cooling is accomplished differs, based on the
type of refrigeration.[3]
There are four widely used refrigeration systems. All of them are briefly discussed
below: -
This is the most commonly used refrigeration cycle method, which finds
application in air conditioning, commercial and industrial refrigeration. This type of
system transfers heat by mechanically compressing the refrigerant into a low-pressure,
cold liquid and then expanding it into a high-pressure, hot gas. The refrigerant is moved
from the low-pressure side of the closed system to the high-pressure side. It boils on the
low-pressure side and absorbs heat from the warm indoor air. On the high-pressure side
of the system, the heat travels from the vapor refrigerant to the cooler outdoor air, and the
process is repeated.[3]
In the concerned project work, the focus is on transport and temporary storage of
essential emergency supplies such as vaccines, medication, or perishable food items that
usually require a predefined temperature to stay in optimum condition.
5
Chapter-2
Chapter-2 gives a detail discussion of the methodology of the proposed method
implemented in this thesis for temperature control in a solar refrigerator. The proposed
method is based primarily on maintaining a setpoint value using a PID controller. In our
case, the setpoint is the temperature from the feedback of the thermocouple. We need an
6
Arduino so that we can easily code it according to the desired value of our 3 controllers:
proportional, integral, and derivative, that is manually set by using the rotary encoder.
Using these three we can control our temperature in a very good manner.
Chapter-3
In this chapter, temperature regulation was carried out using the proposed
Arduino-based PID temperature-control method. The performance of the proposed
method was evaluated based on the findings of the temperature reading of the model.
Chapter 4
This chapter concludes the entire project work and the thesis. It discusses the
results obtained in the previous chapters. Moreover, the scope for future work and
possible advancements to this model are outlined briefly in this chapter.
7
CHAPTER-II
2.1 Introduction
In our proposed method for temperature control, we use an Arduino UNO to make
a PID controller with the help of a rotary encoder (refer to appendix to view code). Based
on the output temperature reading, the three controllers of PID can be adjusted to increase
or decrease supply power to the Peltier module, and thus bring the temperature level to
the desired setpoint.
The pads within the Peltier Module, in case of electrical, are connected in series,
and in case of thermal, are connected in parallel. Whenever the junction is maintained at
a given temperature the Peltier effect results in the heat addition or removal of heat, which
is reversible and proportional to the current. The Arduino UNO that we used here to make
our own PID controller is inspired by an open-source platform based on easy hardware
and software. These boards are capable of reading inputs just like we do in our project by
coding in a way to form our own PID controller. Using the three control variables, we can
control the temperature as needed.
Thermoelectric cooling is a process that uses the Peltier effect to develop a heat
flux at the junction of the two slides of materials present in between the Peltier Module.
Peltier module, as shown in Fig.1 is a thermoelectric heat pump that transfers heat from
one side of the device to the other by consuming electrical energy depending upon the
direction of the current. The Peltier module has two sides when we supply power as
12V,2A that is with different models of the Peltier module. then the DC current flows
through the device. So there is heat on one side and cold on the other side. Here the
schematic that we have used for the Peltier module is by extracting more and more
amounts of heat so that the colder side can get faster cooling.[5]
Within the Peltier module, it consists of two ceramic substrates sandwiching many
pairs of Bismuth telluride dice. The pads made within the Peltier Module, in case of
electrical these are connected in series, and in case of thermal, these are connected in
parallel. One of the ceramics is hot and another one is cold. Copper-type material is
attached to the inside surface of ceramics to determine p-type and n-type disc (refer to
Fig.2). Both p-type and n-type have different free electron densities at the same
temperature level. Here p-type having a high deficiency of electrons while and type
having an excess of electrons.
9
The current treats the p-type material as a hot junction that is to be cooled and
the other side n-type material as a cold junction that is to be heated. Hence the material
is actually at the same temperature that makes the hot side even hotter and the cold side
even colder. When we interchange the polarity then this process will be reversed so that
the earlier hotter side will react as a colder side and the earlier of the colder side will
react as the hotter side.[6]
Whenever the junction is maintained at a given temperature the Peltier effect results in
the heat addition or removal of heat, which is reversible and proportional to the current
as shown in Fig.3. Thus,
Peltier heat = ɎI
Here ʌ depends on the materials building junction and the temperature. The filter effect
is the key phenomenon determining the EMF generated in a thermocouple used for
temperature measurement. Suppose taking two materials as A and B with a single junction
as a constant temperature T,
10
where, İAB is the EMF generated at the junction. This is the equation through which the
Peltier coefficient for any two materials as a and b can be calculated.[7]
Arduino UNO that we used here to make our own PID controller is inspired by an
open-source platform based on easy hardware and software. These boards are capable of
reading inputs just like we are doing in our project by coding in that way to form our own
PID controller. In our present, the main principle is to maintain the setpoint value. Here
the setpoint value is the temperature from the feedback and it is the thermocouple, so we
need an Arduino so that we can easily code it according to the desired value of our 3
controllers: proportional, integral, and derivative that is manually set by using the rotary
encoder (refer Appendix for code). Using these three we can control our temperature in a
very good manner.[8]
In any PID controller, we need to define our process. In our case, it is the final
temperature that we want to achieve from the arrangement of two fans to the heat sink
and Peltier module. To control the temperature, we need feedback. In our case, the
feedback is made using a k-type thermocouple. Then the k-type thermocouple will
measure the real temperature of the system. This type of control also needs a set point
which in our case is the desired temperature. The system will make the difference between
the desired value and feedback from the output and using the three constants the
proportional the integral and the derivative. So, we can change the output according to
the feedback. If you want to have exactly 3 degrees Celsius. We need the PID
CONTROLLER using Arduino.
If the real temperature is higher than that point the lower power value. If the real
temperature is lower than the checkpoint, we increase the power till it reaches the desired
value. This point will define the proportional control if we just use the proportional
11
control this is called peak control or professional control and it will end up in a
temperature oscillation between certain values and it will be very difficult or never which
table for that we have to add a d control, or we can say that derivative control.
This kind of control will lead to the speed of temperature change so one module
starting derivative will first use the power to maintain the same temperature. Finally, the
integral controller will sum the error on which loop gets bigger and bigger on each loop
or in case of negative error getting lower and lower here this makes the PID controller.
Here temperature setpoint values are set manually.[9]
Fig. 4 PID Control, MAX6675 thermocouple, Arduino UNO Schematic with Rotary
Encoder
12
Fig. 5 Block Diagram of Components Arrangement in proposed system model
Fig. 5 shows the arrangement of components in the proposed model. In our system, we
have used two power sources, one for 220-volt AC supply for which we used CPU SMPS
of 450 watts, and another DC power source, that is, a battery with a developed solar
charger that will charge it with a voltage range of 10 to 15 volts. There is a toggle switch
that we can use to choose the desired power source while plugging in the power supply.
As we may not have one or the other power source available at some point of time, so
using the toggle switch we can select the available source of power supply through battery
or SMPS. The power supply is directly given to Arduino UNO. The Arduino Uno has
four major components -
13
x the rotary encoder that is used to set the values of P, I, D manually to set up
according to our required temperature range,
x a 12-volt LCD connected with Arduino Uno to display temperature values while
setting up using the rotary encoder,
x a thermocouple module MAX6675 with its k type sensor is fixed into the
refrigerator body to get an accurate temperature reading
x an extra circuit to supply power to the Peltier arrangement. This is also connected
with the Arduino UNO so that, if the temperature is not within required range then
Arduino UNO will increase or decrease the voltage level.
Fig. 6 Assembly of the Working model
Earlier in our minor project we developed a solar charger just to charge the battery
with 12 V input because solar panel output is 19 V, 2.1 A and if the battery gets fully
charged, we developed a circuit in such a way that it will trigger the circuit and charging
will stop. So, in our major project we prepared a fully upgraded solar charger with several
protections given (refer to Fig.7 and Fig.8). Table 1 is the list of items that we used in our
new solar charger circuit.
14
Fig. 7 Circuit Diagram of a 12V Solar Battery Charger
15
Fig. 8 Solar Battery Charger on PVC Board
The first part of the circuit is just a simple n channel MOSFET in a forward biased
condition to stop the flow of current from the battery to the solar panel here this part is
the back current protection. During the sunrise whenever the panel reaches the 10 volts
then the 10-volt Zenner diode starts conducting and turns on the MOSFET which
ultimately turns on the relay. This part is equal to the low voltage protection. Now for
over voltage protection whenever the panel voltage reaches 15 volts then the 15-volt
Zener diode reaches its conduction state hence the transistor also reaches the saturation
state so negative voltage flows through it and turns off the MOSFET.[10]
Now to understand the overcharge protection. Let's assume that the battery is not
fully charged. So, most of the current will flow through the battery but when the battery
charging is full, less current flows through it which turns on the second MOSFET which
ultimately turns off the second relay and this cycle will repeat whenever the battery
voltage decreases to a certain this is how actual solar charge controller works. The solar
16
charge controller which is available in the market is of around Rs.700 but the materials
that we used to build the whole circuit cost just about Rs.300.
Fig.9 Intel i3 CPU fan
First tried the intel i3 CPU fan for cooling the refrigerator body. But it achieved
only minimal heat removal (only till 16 °C). Then, we self-assembled a heat sink, but the
attempt was not successful. Finally, we incorporated a set of two heat sinks – a larger one
for the hot side of the Peltier, and a smaller one for the cold side.
For faster heat extraction to achieve quick and effective cooling, we have used
two heat sinks – one for the hot side and another for the cold side of the Peltier module.
Sun board is a very strong, light weight, and easily cut sheet material normally
used for the mounting of vinyl prints and for several painting. It usually has three layers
17
with an inner layer of polystyrene foam and a with a white clay coated paper on the
outside.
Smooth surface and elegant finish, lightweight, waterproof and can be easily cut into
desired shapes with paper cutter. Fig. 10 shows the interior lining of the working model.
Fig. 10 Interior lining of the model
Peltier module is quiet and free of vibrations as they don't contain moving parts.
Location isn't an issue and they can be moved so are suitable for portable units. Can be
small and lightweight. No flammable or ozone-depleting refrigerants are required.
18
CHAPTER-III
Fig. 7 Graph of Temperature (in degree Celsius) vs Time required
Table 2 Variation of Temperature (in degree Celsius) with Time
From our readings shown in Table 2, the lowest temperature reached was 5.9
degrees Celsius within a time interval of 5 mins. So, in our current project, using the
rotary encoder we can manually set the values of P, I and D. Suppose, the values of P, I
and D are set to 7 degrees Celsius, 2 degrees Celsius and 5 degrees Celsius respectively.
Then, the Arduino will control the temperature to an estimate range of 7 degrees
Celsius.
[In view of the ongoing pandemic situation, we have been unable to access our former
project model for further experiments. Hence, the controlled temperature setpoint given
above is an estimated value, based on the working of the code used in Arduino UNO.]
Table 3 below is the list of items used to build the system model along with their
approximate costs at the time of purchase.
CHAPTER-IV
4.1 Conclusion
Within our future work for the project, we would like to minimize the size of two
important components - the battery and the solar panel. The battery type might be replaced
by a more advanced and efficient DC source. Nowadays foldable solar panels have also
been introduced. But the manufacture and sales of these foldable solar panels at a low
cost and their viability in our Indian market needs to be explored.
Using a portable solar refrigerator, we can only store or carry a very limited
number of vaccines, medication or food materials, so the possibility of larger sized
refrigerators utilizing solar energy and effective lightweight cooling mechanisms can be
a possible future endeavour. In pandemic situations such as the one we are facing today;
it can be useful to store vaccines in a huge amount that can be easily transported to rural
areas.
22
REFERENCE
[1] IEA, O. (2012). Measuring progress towards energy for all: power to the
people. World Energy Outlook, 529e548.
[2] Palz, Wolfgang (2010). Power for the World - The Emergence of Electricity from the
Sun. Belgium: Pan Stanford Publishing. p. 6. ISBN 9789814303385.
[3] C. Skanfield, D. Skaves, Fundamentals of HVAC, Air-Conditioning, Heating, and
Refrigeration Institute, 2nd ed. Pearson, 2012, pp. 137-144.
[4] PATH, WHO, "Direct-drive solar vaccine refrigerators-a new choice for vaccine
storage", PATH, WHO, Seattle, 2013.
[5] "Thermoelectric cooling - Wikipedia", En.wikipedia.org, 2021. [Online]. Available:
https://en.wikipedia.org/wiki/Thermoelectric_cooling. [07- Jun- 2021].
[6] P. Industries, "This Is How a Thermoelectric Module Works by Advanced
Thermoelectric (Pollock Industries)", Electracool.com, 2021. [Online]. Available:
https://www.electracool.com/moduleworking.htm. [07- Jun- 2021].
[7] "PELTIER EFFECT", Thermopedia.com, 2021. [Online]. Available:
https://www.thermopedia.com/content/1015/. [07- Jun- 2021].
[8] "Arduino - Wikipedia", En.wikipedia.org, 2021. [Online]. Available:
https://en.wikipedia.org/wiki/Arduino. [07- Jun- 2021].
[9] "MAX6675 Arduino tutorial", Electronoobs.com, 2018. [Online]. Available:
http://electronoobs.com/eng_arduino_tut24.php. [07- Jun- 2021].
[10] "Solar charge controller - EasyEDA", Easyeda.com, 2018. [Online]. Available:
https://easyeda.com/Aatik/solar_charge_controller-
788dc735e2ad4e0897d3790693144692. [04- Jun- 2021].
23
APPENDIX
#include <SPI.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f,20,4);
int PWM_pin = 3;
int clk = 8;
int data = 9;
float set_temperature = 0;
float temperature_read = 0.0;
float PID_error = 0;
float previous_error = 0;
float elapsedTime, Time, timePrev;
float PID_value = 0;
int button_pressed = 0;
int menu_activated=0;
float last_set_temperature = 0;
int clk_State;
int Last_State;
bool dt_State;
int kp = 90; int ki = 30; int kd = 80;
#define MAX6675_CS 10
#define MAX6675_SO 12
#define MAX6675_SCK 13
void setup() {
pinMode(PWM_pin,OUTPUT);
TCCR2B = TCCR2B & B11111000 | 0x03;
Time = millis();
pinMode(9,INPUT);
pinMode(8,INPUT);
lcd.init();
lcd.backlight();
}
void loop() {
if(menu_activated==0)
{
temperature_read = readThermocouple();
PID_error = set_temperature - temperature_read + 3;
PID_p = 0.01*kp * PID_error;
PID_i = 0.01*PID_i + (ki * PID_error);
timePrev = Time;
Time = millis();
elapsedTime = (Time - timePrev) / 1000;
PID_d = 0.01*kd*((PID_error -
previous_error)/elapsedTime);
PID_value = PID_p + PID_i + PID_d;
if(PID_value < 0)
{ PID_value = 0; }
if(PID_value > 255)
{ PID_value = 255; }
analogWrite(PWM_pin,255-PID_value);
previous_error = PID_error;
delay(250);
lcd.setCursor(0,0);
lcd.print("PID TEMP control");
lcd.setCursor(0,1);
lcd.print("S:");
lcd.setCursor(2,1);
lcd.print(set_temperature,1);
lcd.setCursor(9,1);
lcd.print("R:");
lcd.setCursor(11,1);
lcd.print(temperature_read,1);
}
if(menu_activated == 1)
{
analogWrite(PWM_pin,255);
if(set_temperature != last_set_temperature)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Set temperature");
25
lcd.setCursor(0,1);
lcd.print(set_temperature);
}
last_set_temperature = set_temperature;
}
if(menu_activated == 2)
{
if(kp != last_kp)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Set P value ");
lcd.setCursor(0,1);
lcd.print(kp);
}
last_kp = kp;
}
if(menu_activated == 3)
{
if(ki != last_ki)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Set I value ");
lcd.setCursor(0,1);
lcd.print(ki);
}
last_ki = ki;
}
if(menu_activated == 4)
{
if(kd != last_kd)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Set D value ");
lcd.setCursor(0,1);
lcd.print(kd);
}
last_kd = kd;
}
double readThermocouple() {
uint16_t v;
pinMode(MAX6675_CS, OUTPUT);
26
pinMode(MAX6675_SO, INPUT);
pinMode(MAX6675_SCK, OUTPUT);
digitalWrite(MAX6675_CS, LOW);
delay(1);
digitalWrite(MAX6675_CS, HIGH);
if (v & 0x4)
{
return NAN;
}
v >>= 3;
return v*0.25;
}
ISR(PCINT0_vect){
if(menu_activated==1)
{
clk_State = (PINB & B00000001);
dt_State = (PINB & B00000010);
if (clk_State != Last_State){
if (dt_State != clk_State) {
set_temperature = set_temperature+0.5 ;
}
else {
set_temperature = set_temperature-0.5;
}
}
Last_State = clk_State;
}
if(menu_activated==2)
{
clk_State = (PINB & B00000001);
dt_State = (PINB & B00000010);
if (clk_State != Last_State){
if (dt_State != clk_State) {
kp = kp+1 ;
}
else {
kp = kp-1;
}
}
Last_State = clk_State;
}
27
if(menu_activated==3)
{
clk_State = (PINB & B00000001);
dt_State = (PINB & B00000010);
if (clk_State != Last_State){
if (dt_State != clk_State) {
ki = ki+1 ;
}
else {
ki = ki-1;
}
}
Last_State = clk_State;
}
if(menu_activated==4)
{
clk_State = (PINB & B00000001);
dt_State = (PINB & B00000010);
if (clk_State != Last_State){
if (dt_State != clk_State) {
kd = kd+1 ;
}
else {
kd = kd-1;
}
}
Last_State = clk_State;
}
if (PINB & B00001000)
{
button_pressed = 1;
}
else if(button_pressed == 1)
{
if(menu_activated==4)
{
menu_activated = 0;
PID_values_fixed=1;
button_pressed=0;
delay(1000);
}
if(menu_activated==3)
{
menu_activated = menu_activated + 1;
button_pressed=0;
kd = kd + 1;
delay(1000);
28
if(menu_activated==2)
{
menu_activated = menu_activated + 1;
button_pressed=0;
ki = ki + 1;
delay(1000);
}
if(menu_activated==1)
{
menu_activated = menu_activated + 1;
button_pressed=0;
kp = kp + 1;
delay(1000);
}
}
}