You are on page 1of 6

Presented at the DLSU Research Congress 2017

De La Salle University, Manila, Ph ilippines


June 20-22, 2017
Design and Development of a Fuzzy Logic Based - Digital Regulated DC
Power Supply with an Automatic Reverse Polarity
Using Arduino Microcontroller

Ma. Ram ona A. Alcantara1, Guia Daniella L. Lanting 1, Ralph Laurence G. Visaya2*
1Undergraduate Student, College of Engineering and Computer Studies
2Graduate Student, College of Engineering and Computer Studies
Lyceum of the Philippines University- Laguna
*Corrresponding Author: sayaviarvie@gmail.com

Abstract: In this world’s growing technology, people used gadgets everyday like
cellphones, laptops and different kinds of recent technologies. Most of them need
power supplies. P ower supplies play a greater role in the present day, in school, in
industry, in households in everyday lives. This research study presents t he
improvisation of normal power supply used today. This Fuzzy L ogic m icrocontroller
based digital regulated dc power supply with automatic reversing of polarity is
ranging from 0-24 Volts with a maximum current output current of 1 Ampere. The
proponents also make a fuzzy logic algorithim for the fuzzy logic tuning and test and
experim ent the functionality of the sensors needed. The proponents also make use of
the Matlab Fuzzy L ogic Toolbox for the Fuzzy L ogic simulation and Arduino IDE for
the programming platform of the Arduino. The Sugeno style of fuzzy inference
system was used in the system. Triangular m embership functions were used in the
control system. Two Fuzzy inputs are constructed nam ely: the error, and change in
error. The proponents also constructed F AM matrix for the rules in the fuzzy logic.
The output of the fuzzy logic is normalized in the Dev C++ for fine tuning and getting
the accurate and precise outputs. The relay module serves as the switch for the
autom atic reversing of the polarity of the circuit. It also uses the current sensor for
sensing the deflection of the current when a circuit is connected in wrong polarity.
The proponents used the experimentations to validate the functionality and
applicability of the designed and developed and it was verified experim entally that
the results obtained by the proponents were acceptable.

Key Words: Fuzzy L ogic; Matlab; Sugeno; Arduino; polarity;

1. INTRODUCTION supply with auto polarity corrector that is


sufficiently adaptable to meet the researchers’
This section of research intends to clarify and objectives and expectations, with minor
explain the workings of the research study. It programming changes and no corresponding
includes the statement of the problem, the hardware change. Hardware issues are discussed,
objectives and the scope and limitations. This part with an objective of innovating a simple power
required to measure the feasibility of the research supply that has programmable output voltage and
current. It is capable of recognizing faults and
1.1 Background of the Study takes corrective actions to prevent any permanent
damage to the entire system. The system conversed
Nowadays, vast majority of electronic devices here is capable of operating independently by its
are powered by DC power source, so it requires a own without any intervention from the user. The
reliable, consistent and modified power supply. system discovers application at remote sites to
Generally, the requirements are not excessively automatically manage primary (AC) and secondary
differed, but still they oblige every time a new (battery) power sources to provide smooth
hardware designing. The idea presented here is to uninterrupted power output even during
construct a digitally controlled regulated power conversion between AC and DC power sources. The
Presented at the DLSU Research Congress 2017
De La Salle University, Manila, Ph ilippines
June 20-22, 2017
vast majority of this equipment requires DC to eliminate the restrictions of the existing systems.
voltage as well as voltage that are well filtered and This is an improved power supply made up of AC to
controlled. Since power supplies are broadly used DC converter as main component with an output
as electronic equipment, those devices now contain ranges from 0 to 17 volts and can charge batteries.
an overall section of the electronic market. The It has the ability to recognize faults and take
trend and demand these days are to build up corrective actions to prevent any permanent
systems that are dependable and intelligent. It has damage to the system. Being an automatic polarity
to be consistent enough not to damage what is correcting power supply, it also works disregarding
hooked up to. the polarity of the circuit being hooked up and the
polarity of the connected battery. At the center of
1.2 Statement of the Problem the whole system is the microcontroller.
Microcontroller is embedded inside the device so
Nowadays, electrical power supply is one of the that it can control the features and actions of the
most important elements in human being needs. device. It is small and low cost. The components are
Most of human activities depend on the demand of chosen to minimize size and to be as inexpensive as
electrical power supply. Electronic lab experiments possible. Necessary amplification is provided. To
frequently need a power supply to perform such enable it to read the analog signals, an Analog to
activity. And in this high technology world, it is Digital converter is used. It has a digital display
normal for people to possess gadgets which powered showing the actual measurement values of the
by its battery. In using a DC power supply, many output voltage of the power supply. The hardware
students got confused whether the experiment design is flexible and can be easily scaled to the
needs a positive or a negative supply. Because of requirements .
this confusion, this may results in damaging what
is attached to it. Based on this problem, this project 2.2 Arduino IDE
is the answer wherein it has the ability to correct
its polarity without interchanging the probes once
This project is a software controlled
it is hooked up to the equipment, same thing with
microcontroller based system, which makes it
the battery charging. Since this project aims to
intelligent, independent of operator supervision
develop a power supply consisting of a DC supply
and chargi ng a battery, it is the solution. and can adapt to a restricted set of changed
requirements without any hardware change. The
software for this project was developed using a
1.3 Objectives of the Study simple high level language in C++. It also used
ARDUINO IDE sketchbook for PC to system
The main objective of the study is to construct
interface. The software controls the input display
a fuzzy logic based digital DC power supply with of the device and manipulates its polarity
automatic reversing of the polarity which prevents
depending on the parameters of the equipment
damage of the components when connected in
engaged through it. The Arduino IDE is an open-
reverse polarity. Specifically, the proponents are source Arduino Software it provides an easy way
wanted to create a program that will incorporate
to write a code and upload it to the board, it runs
the fuzzy logic into the microcontroller and to
on Windows, Mac OS X, and Linux. The
create a program that will reve rse the polarity of
environment is written based on Processing, Java,
the power supply. Assemble a digital DC power and other open-source software’s. The software can
supply where the user can input the voltage
be used with any Arduino board.
through buttons. The proponents also test and
evaluate the functionality of the different electronic
modules compatible with Arduino like relay 2.3 Fuzzy Logic Controller
module, voltage sensor, and current sensor.
The first step in designing Fuzzy Logic System
is to describe fuzzy sets, the information in terms of
2. METHODOLOGY fuzzy linguistic terms or can be regarded as values
equal to 0 or 1 and values within them. The fuzzy
2.1 Project Description membership function is used to assign values with
respect to fuzzy sets and its degrees of membership.
The “Digital DC Power Supply with Auto- Moreover, the most commonly used technique
Polarity Corrector” is a device which supplies DC requiring four parameters to be specified with
voltage and can charge batteries. This is a respect to its x and y coordinates is called
microcontroller based power supply which is Trapezoidal Membership Function. Also, the
developed concerning to make an intelligent device Triangular Membership Function can be used in
and flexible enough to meet different requirements
Presented at the DLSU Research Congress 2017
De La Salle University, Manila, Ph ilippines
June 20-22, 2017
the system which requires three parameter indication to relay. The output of the relay
specifications. will be the starting point of Automatic reversing
polarity circuit dependent on the signal from
2.4 System Flowchart current sensor. The output will be displayed in the
LCD. And a LED will indicate if the power supply
is acting normally or reversing.

3. DESIGN CONSIDERATION

3.1 Hardware Connection

Fig. 1. System Flowchart of the System

In the figure 1 above, the user inputs the


desired voltage through buttons. After that the
output will be displayed to the LCD. If there is
deflection in the current sensor, this will
automatically start polarity reverse, after that Fig. 3. Hardware Connection
report the result of the data and display the
output. If there is no deflection, report the data to In figure 3, it shows the electronic connection
the arduino then send the data to be displayed in of the system. The proponents used the ATMEGA
the LCD display. 2560 Arduino microcontroller as the main
controller of the system. Buttons serve as the main
input for the voltage of the power supply. The
2.5 Hardware Block Diagram
current sensor and the voltage sensor will send
signal to the arduino and the LCD will display the
readings from the voltage and current. When the
current sensor senses any deflection in the current
when connected to a wrong polarity. It will send
signal to relay that will trigger as the switch of
polarity.

3.2 Fuzzy Logic Simulations

In this part, the proponents used the MATLAB


Fuzzy Logic Toolbox in the simulation of the Fuzzy
Fig. 2. Hardware Block Diagram System of the software part of the system. The
proponents used the Sugeno Style Fuzzy
Interference system and the novelty of this study is
In the figure 2, the source comes from the
the fine tuning of the crisp output of the system.
power supply which is the main source of the Rules are constructed with 16 weights in the
system. The output the supply will be connected to
system. Sugeno was used because of simplicity and
a voltage sensor and the current that will give output of this method is linear unlike to the output
signal to microcontroller. That signal will be of Mamdani. The fuzzy logic is applied to the
fuzzified and the output of the fuzzy logic will be current sensor to provide smooth readings of the
fed to the microcontroller. The Arduino will send current.
Presented at the DLSU Research Congress 2017
De La Salle University, Manila, Ph ilippines
June 20-22, 2017
a. It is compatible to Arduino (ATMEGA
2560) an advantage over other current
sensors.
b. It does not require any external supply.
c. It can detect high/ current that help to
achieve the objective which the auto
reversing polarity.
d. The sensor circuitry is sealed and not
complicated.

Fig 4. Fuzzy Logic Input with Membership Function

Fig 6. The Current Sensor (ACS712)

B. Voltage Sensor

The voltage sensor is composed of two


resistors in a voltage divider configuration. The
proponents used this to display the input voltage in
the LCD display via buttons. The Arduino analog
input is limited to a 5 V DC input. It is
fundamentally a voltage divider using a 100K and
a 10K Ohm resistor.

Fig. 5. Fuzzy Logic Outpu t

Given i n the fi gures above 4 and 5, it


show t he input and t he output of the fuzz y logic
simulations . The proponents us ed the t riangular
membershi p functions with pa rameters in t he
input error and cha nge in error “NB”, “NS”, Fig. 7. Voltage Sensor
“Z”,”PB” . Tria ngula r members hip function used
because it is the best for begi nners a nd easy to
understa nd. S ugeno style fuzz y logi c int erference
3.4 System Application
has been used also as the interference system in
the a utomati c polarit y suppl y. Almost all analog power converters are least
efficient even in light loads. Also, there are times
that people apply the power supply to an
3.3 System Sensors
electronic load with wrong polarity that leads to
the device failure or malfunction. The researchers
A. Current Sensor used the microcontroller for improving the analog
power supply to digital and including an
The proponents used the sensor ACS712 that additional feature of auto- polarity corrector. The
provides economical and precise results for DC system has an automatic response particularly in
current sensing in electrical and electronic systems. case of wrong terminal connections. It will
Typical applications include motor control, load automatically switch the polarity once the
detection and management, switched- mode power microcontroller detects current deflection. The
supplies, and over current fault protection. The system also has the fuzzy logic which gives more
proponents made use of the ACS 712 sensor because precise and accurate time response of the
of the following: reversing of the polarity. The fuzzy logic applied to
the current sensor which gives smooth reading of
Presented at the DLSU Research Congress 2017
De La Salle University, Manila, Ph ilippines
June 20-22, 2017
the current and when there is deflection of Table 2. Time Response of the Different Test
current. Thus, this will give the signal to the relay Samples
in changing the polarity with the shortest time
possible though the deflection of the current. One
application of this research is this can be used in
different electronic loads especially in complex
circuits and it is one of the recommendations of
the one of the research literatures. Also, it can be
used in schools, industries, in homes or in any
places where power supplies are needed to be
used.

4. EXPERIMENTS AND ANALYSIS


OF RESULTS

This part is to show the analysis and interpretation of


data for series of experiments. The proponents record the
voltages displayed on the LCD and input voltages
measured by a digital tester with its percentage error.

Table 1. Values for the Percent Error of the Voltages


In the table 2, the proponents used
stopwatch in a smartphone to measure the time
when the circuit is connected in a normal polarity
and the time when the circuit is connected in a
reverse polarity. As cited in the table, the time of
test sample 1 in normal condition is 12ms and the
other sample is 20ms. In the revese condition, the
time is ranging from 0.80ms to 0.93ms.

Fig 8. Graphical Representation of Time Response of


Water level Circuit

It shows in the table 1 the values


measured and displayed voltages with the
computed percentage error. It is shown that from
the results obtained in the figure, it can be
observed that the percentage error has low value so
which means that the voltage output of the power
supply is reliable and accurate and stable which
provides clear view of accurate voltage output Fig 9. Graphical Representation of Time Response of FM
Radio
Presented at the DLSU Research Congress 2017
De La Salle University, Manila, Ph ilippines
June 20-22, 2017
In the figures 8 and 9, it shows the graph 6. ACKNOWLEDGEMENT
of the time response of each test samples. It is
shown in the figure that the maximum time is
0.94ms and the minimum time is 0.82ms. Thus, First and foremost, the researchers would like
this made clearly that the time will reduce the to thank the Name of the Lord Jesus Christ for the
circuitry to break because of the sensitivity when understanding, wisdom and knowledge that he
connected to a wrong polarity. gave. The proponents also would like to thank
Engr. Ralph Laurence V isaya as our adviser and
Table 3. Calculation of the Correlation Coefficient mentor for his support and for his perpetual help in
times of needs and troubles. This research is not
feasible without the cooperation of everyone.

7. FUTURE RECOMMENDATIONS
The researchers want to recommend for
the future researchers to use a different
microcontroller board like Raspberry Pi. Also, make
use of the keypad for the input voltage so that the
user can pick numbers to input voltage output. If
ever possible adjust the maximum voltage to higher
voltages.

8. REFERENCE

Jamolod, Emerson, V isaya, Ralph Laurence G. and


et al. (October 2015). Development of a Digital
Regulated DC Power Supply with an Auto-
In the table shown, it shows the Polarity Corrector Using Arduino
calculation of the correlation coefficient of the time Microcontroller.
response of the reverse polarity of the two samples.
In the result, there is a “Perfect Correlation” Mustafa R Abuzeid, Ramadan AElmoude, Nasr E
between the time responses of the two batteries. In Shtawa. (April 12-14, 2007.) A novel Strategy
correlation coefficient -1 and 1 are values that are
for Synchronizing of Two DC Motors: Al-azhar
in perfect correlation and in the results in the table, Engi neering Ninth International Conference.
the value reaches 0.99.
Jitender Kaushal. (June 2012). Comparative
5. CONCLUSION Performance Study of ACO & ABC Optimization
based PID Controller Tuning for Speed Control
Based on the data gathered and the of DC Motor Drives.
experiments, the result was favorable. Analyzing
the tables 1 on the experiment, it is evident that Bin Adzmi K .A. (4 November, 2008).Motor Speed
the displayed voltage of the power supply using Controller Using Fuzzy Logic Method for PCB
button as input is almost equal to the measured Drilling Operation,.
voltage because as seen it has low percentage error,
which satisfies the accuracy of the output voltage. S.Z. He. S. Tan, F.L.Xu. (1993). ''Fuzzy self-tuning
Besides, it is also suitable to be used because of its of PID controllers‟‟, fuzzy set and Systems.
short time response. The Fuzzy Based Power
supply responds in a very least possible time. Thus,
the time response is strong and almost near to the
normal time response of the system when the
connection is in normal condition. The research is
properly and accurately working which satisfied
the objectives of this study, which satisfied the
objectives of this study. The time reponse meets
from 0.80 to 0.94 sec which is not destructive when
it comes to circuitry thus, this make the research
accurate.

You might also like