Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 72

CHAPTER I

INTRODUCTION

BACKGROUND OF THE STUDY

Technology emerged to introduce many ways of advancement. The rise of

modern technology is so fast that most of the recent technology now is beyond the

knowledge of older generations. Automation ruled the world, replacing things that are

operated manually before. People expect more breakthroughs as time goes by.

Reducing human efforts in accomplishing a task is the main purpose of why

technology keeps changing over time. People are bound to errors and inconsistencies

when they get tired, affecting the performance and decisions that it will make. Some

machines are programmed to follow only certain instructions, enabling them to focus on

specific tasks assigned to them. Through this advancement of technology human works

made easier and can be done at a short period of time, therefore more things can be

processed at a certain time and reduce possible errors.

An electric fan is a device used to produce an airflow for the purpose of creating

comfort and ventilation. Electric fans are designed to create breezed and circulate air in a

region(Bai & Ku ,2008). The fan creates its cooling effect based on the speed at which its

blades rotate; hence, the speed controller is a very important part of a fan.

During hot conditions, the usage of the electric fan is a cheaper choice compared

to spending more on using an air conditioner especially in some areas where high

temperature is naturally normal. Problems such as users forget to turn off the fan when

being away is inevitable, these result in a rise of electricity bill from leaving the fan on

when it is not in use and it may cause accidents like fire hazards when the motor got

heated up. Some people might get a feeling of annoyance and perhaps frustration when
2

getting up from the seat in order to adjust the speed. This non-innovative feature makes it

unable to change the speed and turn on/off the fan automatically. This is why an

automatic temperature and occupancy control system is applied for the purpose of

switching and controlling the speed of the fan.

The idea of this work is to construct an efficient energy generating fan with a

circuit that will automatically turn on/off and change the speed of the fan based on the

motion and on the temperature of its environment with the help of the microcontroller,

together with an additional dynamo that will generate an output voltage which is being

stored in the battery that can be used for charging small appliances. The motion and the

temperature-controlled fan is an alternative way to control the switching of the fan in

response to the sensed movements and with the changes in ambient temperature, by

using a microcontroller to compare their input signals and produce the required output

signal that will turn on the electric fan.


3

Objectives

The objective of this research is to:

A. To develop an Electric Fan with the following features:

A.1 Automatically turn on/off using motion and temperature sensor.

A.2 Automatically change its speed and varies to the room/environment

temperature.

A.3 Generate electricity that will be used for charging small appliances.

A.4 Preview the status of the room temperature by the use of Android Phone

B. To determine the significant advancement of Motion and Thermal Sensor-based

Energy Generating Electric Fan.

Significance of the Study

The result of the study may be beneficial to the following:

Students. This study will benefit the students because it does not use human effort

to function the fan. Since it only uses a temperature and motion signals to operate the

device, as long as it meets the said signals it will automatically function. Plus, an

additional charging port, since most of the students often use gadgets and that usually get

drained fast, not only for the automatic fan but for charging purposes also.

Community. In public hospitals, through the use of automatic electric fan

patients will not any more exert effort just to turn on the electric fan with the right

temperature and motion, it will automatically switch. Together with an extra charging

system to those who have drained phone batteries while waiting to their patients.
4

Person with Disability (PWD). Providing help to those who are disabled, to

improve their quality of life. To lessen their effort and feel the freshness of the air

without exerting any effort.

Researchers. This study could help the researchers to improve their skills

especially in the design and improve their capability in decision making as a future

Engineer. The study also improves social skills by meeting experienced professionals

and to be flexible in adapting modern ideas.


5

Conceptual Framework of the Study

Figure. 1 Project Flow Process


6

Scope and Delimitation of the Study

This study aims to develop an electric fan that will automatically switch on/off

when motion is applied to the 3D gesture motion sensor within a range of 12 inches. To

automatically change the speed level of the electric fan based on the environment

temperature. To operate the electric fan with the use of wirelessly connected android

phone through bluetooth connection with a maximum range of 50 meters within direct

line of sight and displays the current temperature of the room. The device together with

the electric fan has only a limited length of 3 meters from device to electric fan. By the

use of the Android phone, it is possible to control the fan in a distant by connecting the

android phone to the Bluetooth of the device. The device can also be controlled manually

by just turning the toggle switch to its manual mode operation. This innovative study is

intended for the use of students in every classroom with specified dimensions.

Definition of Terms

In order to have a clearer understanding of the study, the following terms are

operationally defined:

Arduino -Arduino is an open-source hardware and software company, project

and user community that designs and manufactures single-board microcontrollers and

microcontroller kits for building digital devices and interactive objects that can sense and

control objects in the physical and digital world (David Kushner, 2011).

Automation-or automatic control is the use of various control systems for

operating equipment such as machinery, processes in factories, boilers and heat treating

ovens, switching on telephone networks, steering and stabilization of ships, aircraft and

other applications and vehicles with minimal or reduced human.


7

Battery Bank -is a device consisting of one or more electrochemical cells with

external connections provided to power electrical devices such as flashlights,

smartphones. When a battery is supplying electric power, its positive terminal is the

cathode and its negative terminal is the anode (Kiran Deware, 2015).

Bluetooth- short-range wireless communication technology that allows devices

such as mobile phones, computers, and peripherals to transmit data or voice wirelessly

over a short distance. The purpose of Bluetooth is to replace the cables that normally

connect devices, while still keeping the communications between them secure ((Melanie

Pinola, 2010).

DHT11 temperature - is a basic, low-cost digital temperature and humidity

sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding

air.

Dynamo -DC generator i.e. an electrical machine which converts mechanical

power into direct current electrical power. Dynamo is essentially just another name for

an electric dc generator (Pauling, 1988)

Electric fan- is a powered machine used to create flow within a fluid, typically a

gas such as air. A fan consists of a rotating arrangement of vanes or blades which act on

the air. The rotating assembly of blades and hub is known as an impeller, a rotor, or a

runner. Usually, it is contained within some form of housing or case. This may direct the

airflow or increase safety by preventing objects from contacting the fan blades

(Needham, 1986).
8

Microcontroller -A microcontroller is a small computer on a single integrated

circuit. In modern terminology, it is similar to, but less sophisticated than, a system on a

chip; an SoC may include microcontroller as one of its components.

Microprocessor - The microprocessor is a multipurpose, clock driven, register

based, digital integrated circuit that accepts binary data as input, processes it according

to instructions stored in its memory, and provides results as output. Microprocessors

contain both combinational logic and sequential digital logic. Microprocessors operate

on numbers and symbols represented in the binary number system (Krishna Kant, 2010).

Technology -can be the knowledge of techniques, processes, and the like, or it

can be embedded in machines to allow for operation without detailed knowledge of their

workings. The simplest form of technology is the development and use of basic tools

(Liddell, 1980).

Relay- are switches that open and close circuits electromechanically or

electronically. Relays control one electrical circuit by opening and closing contacts in

another circuit. As relay diagrams show, when a relay contact is normally open (NO),

there is an open contact when the relay is not energized. When a relay contact is

Normally Closed (NC), there is a closed contact when the relay is not energized. In either

case, applying electrical current to the contacts will change their state.

Relay Module- is a separate hardware device used for remote device switching.

With it you can remotely control devices over a network or the Internet. Devices can be

remotely powered on or off with commands coming from Clock Watch Enterprise

delivered over a local or wide area network. You can control computers, peripherals or

other powered devices from across the office or across the world.
9

Signals-In the physical world, any quantity exhibiting variation in time or

variation in space (such as an image) is potentially a signal that might provide

information on the status of a physical system, or convey a message between observers,

among other possibilities.

Temperature - is a physical quantity expressing hot and cold. It is measured with

a thermometer calibrated in one or more temperature scales. The most commonly used

scales are the Celsius scale, Fahrenheit scale, and Kelvin scale.

Thermoelectric effect – It refers to the conversion of temperature differences

into electrical voltage. The thermoelectric effect addresses the science underlying

cooking, heating and cooling as well as the generating of electricity and measuring

temperature.

Transformer - A transformer is a static electrical device that transfers electrical

energy between two or more circuits. A varying current in one coil of the transformer

produces a varying magnetic field, which in turn induces a varying electromotive force

or "voltage" across a second coil.

Transistor --a semiconductor device used to amplify or switch electronic signals

and electrical power. It is composed of semiconductor material usually with at least three

terminals for connection to an external circuit.

Ventilation-Ventilation is the intentional introduction of ambient air into a space

and is mainly used to control indoor air quality by diluting and displacing indoor

pollutants; it can also be used for purposes of thermal comfort or dehumidification.

USB port - A USB port is a standard cable connection interface for personal

computers and consumer electronics devices. USB stands for Universal Serial Bus, an
10

industry standard for short distance digital data communications. USB ports allow USB

devices to be connected to each other with and transfer digital data over USB cable.
11

CHAPTER II

REVIEW OF RELATED LITERATURE

Related Literature

The world is a storehouse of energy. We all know that energy can neither be

created nor be destroyed but can be transformed from one form to another. But we

are wasting resources that can produce energy as if they are limitless. If we can

renew and Reuse the energy we waste, it would help in some way to the problem of

scarcity of energy, which is the major threat of the present world. By using the

concept of wind turbines wind generated electricity can be used for battery charging

and for connection with the power grid. Beside every fan, there is a tube light by a

mechanism inside the fans motor or a belt that rotates and light up the bulb or store

the energy in a battery which could be used to power up other machines (Saquib

Gadkari et al, 2014).

Sensors are sophisticated devices that are frequently used to detect and

respond to electrical or optical signals. A sensor converts the physical parameters

(for example: temperature, blood pressure, humidity, speed etc.) into a signal which

can be measured electrically. There are certain features which have to be considered

in choosing a sensor. Such of which are accuracy, environmental condition, range,

calibration, resolution, repeatability and lastly is cost. Sensors are classified also into

the following criteria such as primary input quantity (Measurable), transduction

principles (Using physical and chemical effects), material and technology, property

and lastly is application (Merculita, 2016).

Motion sensors are used to switch on power only when a human is detected in

the area covered. Technology has advanced enough to differentiate between humans,

animals and other objects during detection. Moreover, controls can be customized to
12

run lighting based on the availability of daylight. Organizations are using these

sensors for highly accurate lighting and another appliances’ control. Use of PIR

motion sensors in your office space can cut your electricity bill by up to 30 per cent,

depending on factors like the area covered, the frequency of electricity usage in the

covered area, load devices that the sensor is connected to and so on. PIR sensors

themselves draw less than one watt of power per hour in idle situation, so their own

electricity consumption does not impact the bill at all (Saad, 2013).

The alternator is a generator that produces Alternating Current (AC), similar

to the electrical current in your home. This current is immediately converted to

Direct Current (DC) inside the alternator. This is because all modern automobiles

have a 12-volt, DC electrical system. The alternator is driven by a belt that is

powered by the rotation of the engine. This belt goes around a pulley connected to

the front of the engine's crankshaft and is usually responsible for driving a number of

other components including the water pump, power steering pump and air

conditioning compressor. For the most part, alternators are relatively small and

lightweight. Roughly the size of a coconut, the alternators found in most passenger

cars and light trucks are constructed using an aluminum outer housing, as the

lightweight metal does not magnetize. This is important since aluminum dissipates

the tremendous heat generated by producing the electrical power and since the rotor

assembly produces a magnetic field (JacksonVille A.U., 2010)

The speed of fan will change due to the temperature of environment. The

speed of fan had been controlled by the output of Microcontroller PIC 16F877A.

The PWM signal on output Microcontroller had been settled in the different duty

cycle due to different temperature detected from temperature sensor (Hussain, 2018).

The PIR sensor response is very fast in which the fan will turn on as there is

motion detected. However, the limitation of the system is found where the fan will
13

turn off if the person that the PIR detected earlier is not moving. The fan will turn on

again if there is motion made by the user even with small movement for example

waving the hand (Rahman, 2015).

Pyroelectric (PIR) motion sensor consists of two main parts. Each of these

parts include a special material that is sensitive to infrared radiation. In this case, the

lens is not particularly affecting the operation of the sensor, so that we see two

sections of the entire module sensitivity. When the sensor is at rest, both sensors

determine the same amount of radiation. For example, it may be building radiation

or the environment in the street. When warm-blooded object (a person) passes, it

crosses the first sensor sensitivity zone. Whereby two different values of the

radiation are generated in the PIR sensor module. When a person leaves the

sensitivity zone of the first sensor, the values are aligned. Then changes in the

readings of the two sensors are recorded and HIGH or LOW pulses are generated on

the output (Vlandyslav, 2017.)

Passive Infrared Sensor (PIR) module is used for motion detection. It requires

10-60 seconds of settling time before starting its operation. It consists of pyroelectric

sensor that detects motion by measuring change in the infrared levels emitted by the

objects. It can detect motion up to 6 meters (Vaghela, 2017)

A thermistor or thermal resistor is a type of resistor whose resistance is

dependent on temperature, more so than a standard resistor. As a result of this

property, it is usually used in measurement and control circuits. The relationship

between a thermistor’s temperature and its cresistance is highly dependent on the

material from which it is made. Thermistors are broadly divided into 2 categories:

Negative Temperature Coefficient (N.T.C) and Positive Temperature Coefficient

(P.T.C) Negative Temperature Coefficient (N.T.C) thermistors are non-linear

resistors which alter their resistance characteristics with temperature. The resistance
14

of NTC will decrease as the temperature increases. Many N.T.C thermistors are

made from pressed disc, rod, plate, bead, or cast chip of semiconducting material.

They work because raising the temperature of a semiconductor increases the number

of active charge carriers. It promotes them into conduction band. The more the

charge carrier that are available the more the current a material can conduct.

Positive Temperature Coefficient (P.T.C) thermistor exhibit increasing electrical

resistance with increase in environmental temperature and decreasing electrical

resistance with decrease in temperature. Most P.T.C thermistor are made from doped

polycrystalline ceramic (containing bariumtitanate and other compound). One

unique property of this material is the sharp increase in resistance at certain critical

temperatures. At the Curie point temperature, the dielectric constant drops

sufficiently to allow the formation of potential barriers at the grain boundaries

(Adeloye, 2017).

Related Studies

A related study about developing an automatic switch which is a device that

detects the presence of a human in a predefined area and can turn on the lights, fans

or any electrical appliances that we want. The device will automatically turn off the

lights, fans or electrical appliance if nobody is present in the area. PIR sensor is used

to detect the presence of a human. PIR is consist of IR sensors which are used to

detect the heat of the human body and if the presence of a human is detected then the

electrical appliances connected to this automatic switch will automatically turn on.

They used Arduino mini pro to control the PIR sensor while relay modules are used

to control the electrical appliances (Gajjar, 2017).

A simple installation of commercially available motion sensors can contribute

to reduce the electricity bill from the increase of energy efficiency, abundance in
15

availability of energy being the main factor in Indonesian high energy consumption

habits. High electricity demand for consumption at current supply level in Indonesia

led to the rising cost of electricity bills. This factor is compounded by the fact that

many electric generators in Indonesia still use fossil fuels, which contributes to the

high basic generation cost (Indra Reyanto, 2018).

The study explores the possibility of installing motion sensors to contribute to

the energy efficiency. Although mostly common in developed countries, the use of

motion sensors for energy efficiency is still rare, especially in Indonesia. Despite

rising cost and supply shortages, Indonesian buildings are still of high energy

consumption. Our experiment shows that simple installation of commercially

available motion sensors can contribute to reduce the electricity bill from the

increase of energy efficiency. One of the efforts to lower energy demand on the

consumer side is to use the electricity efficiently, such as turning off lights in a room

when it is not in use. This method can be simply done by turning the light switches

for office and classrooms, but difficult to do in public spaces such as toilets and

corridors (Appl.Syst. Innov., 2019).

A design of device that uses a temperature sensor; a comparator unit and

relay switch to automatically regulate the speed of the electric ceiling fan, creating

breeze to enhance convective heat transfer. The developed household electric fan

automatically changes speed in five different ascending levels with respect to the

calibrated temperature range of the environment. The operation of this innovative

device makes it suitable for users who may not be able to access the manual electric

fan regulator. A sudden change in weather conditions affecting the ambient

temperature might harm a person sleeping under a manually regulated fan.

Depending on the temperature of the environment, the fan automatically regulates its
16

speed, making the device safe for sleeping, very convenient for patients in the

hospital, infants and all users. The aero foil of the cross section of the applied

blades, the smooth and even three blades, the length and width of the blades all

improved the air velocity distribution of the device. The developed temperature-

controlled household ceiling fan achieved improved ventilation of the room up to

20% using enhanced blades designed with due consideration to fan aerodynamics.

The ceiling fan blades spin with reduced noise and created uniform flow pattern

across the room (Oduah U.I., and Osuntola , 2017).

The world is a storehouse of energy but we are just wasting resources that can

produce energy as if they are limitless. If we can renew and reuse the energy we

waste, it would help in some way to the problem of scarcity of energy, which is the

major threat of present world. By using the concept of wind turbines Wind-generated

electricity can be used for battery charging and for connection with the power grid.

Beside every fan there is a tube light by a mechanism inside the fans motor or a belt

that rotates and light up the bulb or store the energy in a battery which could be used

to power up other machines. The rotational energy of the dynamo, can be used to

operate several small powered devices. Both dynamo and alternator can be used. The

various applications where this power can be used are charging of laptops, cell

phones etc. (Gadkari and Beatrice, 2014).

The Power Fan works on the principle of generator. It works on the faraday’s

law of electromagnetic induction. The law state that, When a electrical conductor

placed in the strong magnetic field and when the magnetic lines of force cuts the

conductor then EMF is induced on the surface of the conductor. He assembled the

copper winding on the shaft of the fan which is connected to the ceiling. This copper

winding acts as a conductor. The copper winding is place in the circular way and
17

around which strong magnets are place in circular way as like winding. Strong

magnets are connected to the rotating disc of the fan (the disc to which blades of the

fan are connected). As this disc is rotating magnets also rotates and rotating

magnetic field (RMF) is produce. This RMF cuts the copper winding and EMF is

induced on the surface of conductor by the principle of induction. Meaning if there

is an interaction between the copper winding and RMF due the mutual induction,

EMF can be generated on the copper winding. In this way we can generate electrical

power by fan. The generated EMF is carrying by wires and stored into the battery

(Deshmukh, 2016)
18

CHAPTER III

METHODOLOGY

Method of Research Used

This research uses an experimental and development method, dealt on the

effectiveness of using a motion and thermal sensor-based energy generating electric

fan. Through this, we will be able to test and to develop an automatic system that

aims to minimize the power consumption as well as sustainable development of

energy system in the future.

Research Procedure

Researchers will follow a systematic procedure:

1. Identification of the problem

2. Observation and Data Gathering

3. Preparation of Materials needed

4. Experimentation and Analysis

5. Designing of the Thermal and PIR Occupancy sensor-based Energy

Generating Electric Fan for charging small appliances

6. Assembly and Construction of the Sensor-based Energy Generating Electric


Fan

7. Testing the Sensor-based Energy Generating Electric Fan

8. Data Presentation and Describing the results


19

Research Locale

The main location of the research is at Eastern Visayas State University, Main

Campus, Tacloban City. The Eastern Visayas State University (EVSU) is a public

university in the Philippines and the oldest higher educational institution in the

Eastern Visayas region. It is mandated to provide advanced education, higher

technological, professional instruction and training in trade, fishery, agriculture,

forestry, science, education, commerce, architecture, engineering, and related

courses. It is also mandated to undertake research and extension services and

provide progressive leadership in its area of specialization.

Research Instruments

Instrument and Equipment’ used:

1. Multi-Tester

2. Measuring Tools

3. Sensors

4. Calibration

5. Letters to Experts for technical advice


20
Start

Toggle

Automatic Automatic
or Manual Manual

Selector
Switch
Motio Temperatur

Low Medium High


Speed Speed Speed

Read Read
Motion Temp.

Is the
Is there 8 Ye temperature
No Yes No
secs. Of equal or
sensing greater than
motion? 22⁰C?
Relay for
Relay for 220V
220V will turn
will turn Relay for 220V Ye Off
Ye
Off supply will turn
Is there any On
motion being Buzze Is there any
detected which detected
cause the buzzer temperature
to buzz 3 times? below 22⁰C?

No N
For 22⁰C- For 27⁰C- For 33⁰C
26⁰C the 32⁰C the above the
fan speed is fan speed is fan speed
Low Medium is High
Relay for Relay for
220V 220V
will will
remain remain
Generating and
Charging System

Display

END

Figure. 2 Flow Diagram


21

The figure shows that once a gadget is already plugged into the 220V supply,

the operator may choose on how he will operate the fan, whether in automatic mode

or in manual mode operation. In automatic mode, there are two variables that must

be considered, the motion and temperature. The motion sensor must detect first a

movement for a time period of eight seconds while the temperature sensor must

detect a temperature that is equal or greater than the set temperature which is 22⁰C. If

this condition is not met, then the fan will not operate and it will undergo again on

the reading process or the detection of required movement and temperature. If the

conditions are met, then the fan will operate at a speed which is proportional to the

detected temperature of the specific area. While the electric fan is in operation and

there are moves that are being detected by the motion sensor that causes the buzzer

to buzz 3 times then the fan will automatically turn off, the same also for the

temperature sensor that if there is a detected temperature below the required

temperature of 22⁰C the fan will automatically turn off.

If the operator chooses the manual mode operation, then he will just manually

control the operation of the fan by using the selector switch in turning On/Off the fan

and controlling the speed of the fan.

An is an electricity that will be generated for every operation of the fan

because of the generating system being coupled to the shaft of the fan. And this

generated electricity is being regulated and is used for charging gadgets. The

temperature of the room and the battery percentage of the power bank where the

generated electricity is being stored are viewed in each box that has its own display

component.
22

Figure. 3 Schematic Diagram


23

CHAPTER IV

PRESENTATION ANALYSIS AND INTERPRETATION OF DATA

This chapter presents an analysis and interpretation of data gathered. The

presentation starts on device system functionality in terms of motion, temperature,

speed and charging system.

Device System Operation

The test for the device is done by applying motion to the sensor along with the

desired set temperature to be able to operate and give the desired output of the device.

In automatic mode, the fan will operate by first applying motion that requires eight

seconds of detecting motion before it sends the signal to the microcontroller and

triggers the relay which is the main switch in turning on/off the fan. This relay that

serves as the main switch will supply power in either of the three relays when there is a

desired set temperature sensed by the temperature sensor. The fan will not operate if

the current temperature is less than the set temperature which is 22⁰C, and when the fan

is in operation and then there’s a drop of temperature the fan will automatically turn

off. And if the current room temperature is greater than the set temperature, the fan

will operate. It will operate at a low, medium and high speed depending on the

acquired temperature in the room. The device can also be controlled using an Android

phone which serves as a remote that is connected to the Bluetooth of the device. The

Android phone displays the current temperature of the room.

The electric fan can be operated manually by just changing the toggle switch in

its manual mode operation. This is to provide the user an option if he or she wants to

operate the fan manually by using a selector switch.


24

There are dynamos that are coupled to the shaft of the electric fan that

generates electricity during the operation of the fan. This electricity is harnessed by a

device which has a circuit that regulates the electricity produced by the dynamo to be

used for charging a power bank that serves as the storage of the generated electricity.

The stored energy in the power bank can be utilized for charging small devices.

Control Device
Charging
System USB Port for
Charging

Display

Toggle Switch for


Manual mode and
Automatic Mode
Operation Display

Motion Sensor

Temperature Sensor

DC Motor
Generator

Figure. 4 Device Picture


25

Figure. 5 Device Initialization Flow

In using the Android phone to manipulate the operation of the electric fan, first

is to connect it with the Bluetooth of the device. It is done by searching the name of

the Bluetooth of the device and pair it using the pins shown above which are 1234.

Once the android phone is already connected to the device then, a customized

application installed to the android phone can now be open and through it, the current

temperature of the room can be viewed as well as the buttons: Automatic and off, can

now be used in controlling the operation of the fan.


26

Used to turn off the electric fan

manually using Android Phone.

Used to operate the Electric fan automatically


by applying motion to turn on along with the
right temperature. If the temperature is lesser
than the set room temperature the Fan will
automatically turn off and if the temperature
is greater than the set room temperature the
Fan will operate.

Used to preview the temperature

status of the room.

Figure. 6 Graphic User Interface Functions

Product Evaluation Results

The device undergoes a series of tests in order to determine the functionality of

the system in terms of motion, temperature, speed and charging system.

Motion. The study conducted a motion test to be able to find out the accuracy of the

motion sensor if it produces desired output for the device to function properly.
27

Time Distance Result

Functional Nonfunctional

1 second 1 ft. 

2 seconds 1 ft. 

3 seconds 1 ft. 

4 seconds 1 ft. 

5 seconds 1 ft. 

6 seconds 1 ft. 

7 seconds 1 ft. 

8 seconds 1 ft. 

Table 1. Motion Test Result

The table shows that with the maximum distance of 1 ft. that is being applied to

the motion sensor, at 1 second to 7 seconds there is a time delay before the fan to operate

to prevent the things that may easily trigger the sensor when someone passes through or

something cross through the sensor.

The applied motion must continue up to 8 seconds of delay within the range of

the sensor to be able to trigger the sensor and operate the fan.

Temperature. The study conducted temperature test to be able to observe the accuracy

of the temperature sensor if it previews exact reading of the temperature and will deliver

the desired signal and make the fun to operate based on the acquired signal.
28

Table 2. Temperature Test Result

Note that the set temperature that will make the electric fan to operate is 22°C. If

the temperature becomes lower than the set value, then the fan will be nonfunctional, and

if the temperature is greater than the set value the fan will be functional given that if the

detected room temperature is at the range of 22°C to 26°C the fan will operate at low

speed, at a temperature of 27°C to 32°C the electric fan will operate at its medium speed

and above 32°C the electric fan will automatically reach its high speed.

Speed. The study conducted speed test during operation for low speed, medium speed

and high-speed operation of the fan. The test got the corresponding output voltage and

output current (produced by the two dynamos that are connected in parallel with each

other and are coupled to the rotor of the fan) based on the speed operation of the fan.
29

Formula: 𝑅𝑃𝑀𝐹 𝑋 𝐷𝐹 = 𝑅𝑃𝑀𝐷 𝑋 𝐷𝐷

Where; 𝑅𝑃𝑀𝐹 = Revolution per minute of the fan 𝐷𝐹 = Shaft diameter of the fan

𝑅𝑃𝑀𝐷 = Revolution per minute of the 𝐷𝐷 = Shaft diameter of the dynamo

dynamo

Speed Rpm of Rpm of Voltage output of Current output of the

E-fan Dynamo Dynamo Dynamo

Low 1060 3687 7.3 V 60 mA

Medium 1180 4100 9.3 V 70 mA

High 1480 5148 10.02 V 90 mA

Table. 3 Speed Test Result

Given the rpm of the fan for low, medium and high-speed operation and its shaft

diameter of 8mm that is being coupled with 2 dynamos that are connected in parallel,

with a shaft having a diameter of 2.3 mm. Using the formula above that is based on the

principle of belt drive we are able to attain the corresponding rpm of the dynamos. At

low speed operation having a 3687rpm the parallel connected dynamos produce 7.3 V

with a current 60 mA. At medium speed operation having a 4100rpm the parallel

connected dynamos produce 9.3V with a current of 70 mA and at high speed operation

having a 5148rpm the parallel connected dynamos produce 10.02 V having an output

current of 90mA.

Charging. The study conducted charging test to observe if it produces enough current

to supply the power bank, and also to provide source of power that comes from the

rotation of the motor that is being converted to electrical energy.


30

Power Bank

Conducted test # of Generator Time Voltage Current %

Charging

1 1 pc. 1hr. 5V 60mA 4%

2 2 pcs. 1hr. 5V 100mA 9%

Table. 4 Power bank charging Test Result

The table shows the comparison of the increase of battery percentage in charging

the power bank using single dynamo and the two parallel connected dynamos with a

constant period of time which is one hour. For the first experiment, a single dynamo is

used and the generated output voltage is being regulated to 5V and a current of 60 mA

which is used to charge the power bank in an hour. The experiment records only 4% of

increase from its current battery percentage. For the second experiment, we used two pcs

of dynamo which are parallel connected to each other to boost the current it produces. It

has also a regulated voltage of 5V and measured current of 100mA. This records of about

9% of increase on the battery from its current battery percentage.

Mobile Phone

Conducted Test Time Voltage Current % Charging

1 1 hour 5V 100 mA 23%

Table.5 Mobile Phone Charging Test Result

In a 1-hour period of time of charging the mobile phone using the regulated

power of the two parallel connected dynamos and the phone having a current battery
31

percentage of 10%, an increase 23% is obtained. Meaning from the 10% battery

percentage of the mobile phone it becomes 33% after an hour of charging.

Distance Test. The study conducted distance test to be able to determine if the

electric fan will still operate at a certain distance through Bluetooth connection using

android phone.

Distance Result

5 Meters Functional

10 Meters Functional

15 Meters Functional

20 Meters Functional

Table.6 Distance Test Result

Through the use of an android phone, we are able to control the operation of the

fan in a specific range of distance by just connecting the android phone to the bluetooth

of the device. Based on the experiment, at 5 meters of distance from the device the fan

still operates properly, and also for 10, 15 meters. For 20 meters the use of android phone

still functional but there is a delay in receiving the signal to the device.

Product Limitations:

The study found out some limitations of the device based on the direct

observation conducted by the researchers. These are the following;

1. The device will still operate properly regardless of sudden changes of temperature

reading in the room which is displayed in the Android phone.


32

2. Sensing the motion takes time and also requires limited sensing distance of 1 ft. to

able for the motion sensor to detect the movement.

3. Electricity is produced by the dynamo that is being regulated and delivers to the

storage bank. The storage bank charges faster up to 6% of battery and when it reaches

the said percentage the current generated from the dynamo will become insufficient to

charge the power bank.


33

CHAPTER V

SUMMARY, CONCLUSION AND RECOMMENDATION

This chapter presents the summary of the study based on the results presented, the

conclusion made and some of the recommendation for the improvement of the device.

Summary of Findings

The summarized results of the study are herein presented:

1. This device energy generating electric fan with motion and thermal sensor

for charging small gadgets, senses the motion and temperature sensor and also generates

power.

2. The device attained the intended preview status of the temperature scanned

inside the classroom.

3. After the experiment was done, there were limitations that were recorded

through the conduct of direct observations of its functionalities. These are the following.

3.1 After hours of operation, the electric will heat up, because the

mechanical load applied to the shaft is not enough to match the torque of

the fan.

3.2 The temperature sensor that records the current status of the room and

is being viewed on the android screen is somewhat not accurate and has a

delay.

3.3 Power generated by the dynamo has sufficient voltage but has an

insufficient current.
34

4. In turning on the electric there is a delay before the sensor sends signal and to

be able for the electric fan to operate. After turning off the electric fan, and planning to

turn on the fan the operator must wait for about 1 minute before applying motion

because data are still being processed inside the microprocessor.


35

Conclusion

Based on the findings of the study, the following conclusions are drawn:

1. The energy generating electric fan with motion and thermal sensor for

charging small gadgets that uses motion and temperature variables is much a convenient

way of controlling the operation of the fan compared with the normal electric fan.

2. The device satisfactorily passed the evaluation on the functionalities in terms

of motion, temperature, speed and charging. But still there are some errors encountered

during tests specially in generating system that produces desired voltage but insufficient

current that affects the charging of the power bank.

3. The energy-generating electric fan with motion and temperature sensor is

much expensive than the normal electric fan but it has features that the normal electric

fan doesn’t have, like an automatic mode which has the ability to operate the device by

the use of sensors. It has a manual drive which uses the android phone that serves as a

remote connection to the Bluetooth of the device for the purpose of controlling the on

and off switch of the fan in distance. It also can generate power that is stored in a power

bank and provides charging ports for charging small gadgets.


36

Recommendation

Though the project has been proven to meet the required functionalities, there is

still a recommendation for improvement. These recommendations are being offered:

1. Use of high mechanical load dynamo that is applied to the shaft of the electric

fan to match its torque.

2. Use single but high current rating dynamo is advised to be able to charge the

power bank.

3. Use of much more accurate and steady temperature sensor is advised.

4. Use of accurate but larger reach of motion sensor in operating the electric

fan.

5. To decrease the required temperature into 22°C for the low speed operation

of the fan.

6. Create medium speed that ranges from 27-32°C.

7. Put a selector switch to be able to operate the electric fan manually.


37

BIBLIOGRAPHY
38

Bibliography

A. Books

Merculita C. (2016), Development of Anti-Electrical Pilferage Device. Philipines:


Institute of Electronics and Communications Engineers

Levărdă, B. and Budaciu, C. (2010), “The Design of Temperature Control System


Using Pic18f46201,” ICSTC, PP 282−286.

William, J.P. (1986); Control Systems Engineering, 2nd Ed., pp. 1-3.

(Needham (1986), Volume 4, Part 2, 99, 134, 151, 233.) Krishna Kant
Microprocessors and Microcontrollers: Architecture Programming and System

Design, PHI Learning Pvt. Ltd., 2007 ISBN 81-203-3191-5, page 61, describing
the iAPX 432.) (Pauling, Linus (1988). "15: Oxidation-Reduction Reactions;
Electrolysis.". General Chemistry. New York: Dover Publications, Inc. p. 539. ISBN
978-0-486-65622-9)

(Liddell, Henry George; Scott, Robert (1980). A Greek-English Lexicon


(Abridged Edition). United Kingdom: Oxford University Press).

(Computer History Museum Oral History, 2008. p. 4. Retrieved 2016-04-04.)

B. Internet and Electronic Sources

Bai, Y., & Ku, Y. (2008), Automatic room light intensity detection and control
using a microprocessor and light sensors. Retrieved from
https://www.researchgate.net/publication/4348956 Automatic room light intensity
detection and control using a microprocessor and light sensors

Fu, T., Wang, X., Yang, G. (2010), “Design of automatic- temperature-control


circuit module in tunnel microwave heating system,”
Retrieved from https://www.researchgate.net/publication/327232898 Design and
simulation of an automatic room heater control system

Mustafa Saad, Hossam Abdoalgader, and Muammer Mohamed (2014),"


Automatic Fan Speed Control System Using Microcontroller "
Retrieved from https://www.slideshare.net/imraanbracu/automatic-room-temperature-
controlled-fan-using-arduino-uno-microcontroller
39

Nwankwo Nonso Prince , Alumona Theophilus , Onwuzulike Daniel .A.,


Nwankwo Vincent (2014), "Design and implementation of microcontroller based
automatic fan speed regulator (using temperature sensor) " Retrieved from
https://docplayer.net/amp/57090826-Real-time-based-temperature-control-using-
arduino.html

Saad, M., Farij, A., Salah, A. and Abdaljalil, A. (2013), “Automatic Street Light
Control System Using Microcontroller,” Retrieved from
https://www.researchgate.net/publication/321319185_Automatic_Street_Light_Control_
System_Using Microcontroller

JACKSONVILLE A. U. (2010). Retrieved from


https://jacksonvilleautohatboro.com/

M.H. Hussain, H.H. Hok, S.R.A. Rahim, N. Hashim, M. Ibrahim (2011).


Retrieved https://www.researchgate.net/publication/297527865 Microcontroller based
Energy Saving System

Md Mozasser Rahman, Mohd Fahrul Radzi Bin Zakaria, Shahrul Na‟im Sidek
(2015). Sensory and Control System for Smart Fan. Retrived from
http://researchpub.org/journal/jac/number/vol4-no3/vol4-no3-1.pdf

Vladyslavthesis_larionov_LS2017_kos (2009) Retrieved from


https://dspace.cvut.cz/bitstream/handle/10467/69521/F3-BP-2017-Larionov-
Vladyslavthesis larionov LS2017 kos.pdf

Abhishek N Vaghela, Bhavin D Gajjar, Subhash J Patel, Assistant Professor


Assistant Professor (2017). Retrieved from
https://www.ijedr.org/papers/IJEDR1701109.pdf

Adeloye, M.Y, Kotoye, A.A,Idris,O.Y, Egbedele, I .A (2017). Construction of A


Temperature Controlled Fan Using A Microprocessor. Retrieved from
http://www.ajer.org/papers/v6(09)/ZL0609324328.pdf

Uzoma Oduah (2017). Automatic Temperature Controlled Household Electric


Ceiling Fan. Retrieved from https://www.researchgate.net/publication/323384762
Automatic Temperature ControlledHousehold Electric Ceiling Fan

MD Saquib Gadkari, Khemchand Kolte, Mrunal Jasani, Akash Vichare,


Beatrice.S (2014). Generation of Electricity from Fans. Retrieved from
https://ijcsit.com/docs/Volume%205/vol5issue03/ijcsit20140503136.pdf

Akash Narayan Deshmukh (2016). Electricity Generative Fan. Retrieved from


https://www.irjet.net/archives/V3/i5/IRJET-V3I5618.pdf

Appl. Syst. Innov. 2018, 1(3), 23; https://doi.org/10.3390/asi1030023


Received: 7 April 2018 / Revised: 5 July 2018 / Accepted: 6 July 2018 / Published: 23
40

APPENDICES
41

APPENDIX A

Bill of Materials

Item Unit Unit Cost Amount

Arduino Uno 1 pc P1000 P1000

Bluetooth Module 1 pc P500 P500

3D Gesture (Motion Sensor) 1 pc P1300 P1300

DHT11(Temp. Sensor) 1 pc P95 P95

Four channel Relay modules 1 pc P300 P300

Casing 2 pc P700 P700

Electric Fan 1 pc P2400 P2400

Power Supply 1 pc P85 P85

Android Phone 1 pc P2000 P2000

Dynamo 1 pc P200 P200

Assembly Cost P500 P500

Total Cost: P9,080


42

APPENDIX B

Material Specifications

4 CHANNEL RELAY MODULE

Brief Data:
• Relay Maximum output: DC 30V/10A, AC 250V/10A.
• 4 Channel Relay Module with Opto-coupler. LOW Level Trigger expansion board,
which is compatible with Arduino control board.
• Standard interface that can be controlled directly by microcontroller (8051, AVR, *PIC,
DSP, ARM, ARM, MSP430, TTL logic).
• Relay of high-quality low noise relays SPDT. A common terminal, a normally open,
one normally closed terminal.
• Opto-Coupler isolation, for high voltage safety and prevent ground loop with
microcontroller.
43

Detailed Specifications
44

3D Gesture (ZX Sensor)

Connecting

Pins
IR TRANSMITTER IR
LED
RECEIVER
ZX Sensor Pin-out
The ZX sensor board contains two emitters and one receiver module, to determine
the position of a reflector in the Z X space, and is powered externally using a 4-pin
standard 0.025-inch dip connector.
The following is the pin configuration:
1. Pin 1: NC
2. pin 2: Input voltage (5.0 volts DC)
3. Pin 3: RX for connection to an external UART serial transmitter (TX) line
4. Pin 4: TX for connection to an external UART serial receiver (RX) line
5. Pin 5: GND for ground.
6. Pin 6: GND for ground.
7. Pin 7: DR (Data Ready) for the I2C interface.
8. Pin 8: CL (or the SCL) clock signal for the I2C interface.
9. Pin 9: DA (or SDA) data signal for the I2C Interface.
45

ARDUINO UNO

Specifications

Microcontroller ATmega328
Operating Voltage 5V
Input Voltage 7-12V
(recommended)

Input Voltage (limits) 6-20V


Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB
used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
46

DC Generator
47
48

APPENDIX C

Program Codes

Arduino Codes

nclude <MsTimer2.h> // includes libraries for timer


#include <SoftwareSerial.h> // includes libraries for software serial
#include <Wire.h> // includes wire library
#include <ZX_Sensor.h> // includes libraries for gesture sensor connection
#include <Adafruit_Sensor.h> // library for humidity sensor
#include <DHT.h> // library for humidity sensor
#include <DHT_U.h> // library for humidity sensor
// Constants
const int ZX_ADDR = 0x10; // ZX Sensor I2C address

// Global Variables
ZX_Sensor zx_sensor = ZX_Sensor(ZX_ADDR);
GestureType gesture;
uint8_t gesture_speed;
SoftwareSerial mySerial(10, 11); // RX, TX
#define DHTPIN 9
#define DHTTYPE DHT11
DHT_Unified dht(DHTPIN, DHTTYPE);
int relay3 = 3; // declare variables for pins on the Arduino
int relay2 = 4; // declare variables for pins on the Arduino
int relay1 = 5; // declare variables for pins on the Arduino
boolean flag1 = true;

int buzzer = 7; // declare variables for pins on the Arduino

boolean vFlag1 = false;

int vctr = 0;

int vctr2 = 0;

void flash()

void setup() {
49

pinMode(relay1,OUTPUT); //setup pin 5 as an output pin

pinMode(relay2,OUTPUT); //pin 4 as output pin

pinMode(relay3,OUTPUT); //pin 3 as output pin

pinMode(buzzer,OUTPUT); //pin 7 as output pin

digitalWrite(buzzer,HIGH); //setup pin 7 as

digitalWrite(relay1,HIGH); //pin 5 open

digitalWrite(relay2,HIGH); //pin 4 open

digitalWrite(relay3,HIGH); //pin 3 open

dht.begin();

sensor_t sensor;

dht.temperature().getSensor(&sensor);

uint8_t ver;

dht.humidity().getSensor(&sensor);

// Initialize Serial port

delay(300);

digitalWrite(buzzer,LOW);

mySerial.begin(9600);

Serial.begin(9600);

Serial.println();

Serial.println("----------------------------------------");

Serial.println("SparkFun/GestureSense - I2C Gesture Demo");

Serial.println("Note: higher 'speed' numbers mean slower");

Serial.println("----------------------------------------");
50

// Initialize ZX Sensor (configure I2C and read model


ID)

if ( zx_sensor.init() ) {

Serial.println("ZX Sensor initialization complete");

} else {

Serial.println("Something went wrong during ZX Sensor init!");

// end of function setup

// Read the model version number and ensure the


library will work

ver = zx_sensor.getModelVersion(); // get model version of temp. sensor

if ( ver == ZX_ERROR ) {

Serial.println("Error reading model version number"); // if error model version

} else {

Serial.print("Model version: "); // if not error model version

Serial.println(ver);

if ( ver != ZX_MODEL_VER ) { //if version is not equal to current version

Serial.print("Model version needs to be ");

Serial.print(ZX_MODEL_VER);

Serial.print(" to work with this library. Stopping.");

while(1);

// Read the register map version and


ensure the library will work
51

ver = zx_sensor.getRegMapVersion();

if ( ver == ZX_ERROR ) {

Serial.println("Error reading register map version number");

} else {

Serial.print("Register Map Version: ");

Serial.println(ver);

if ( ver != ZX_REG_MAP_VER ) {

Serial.print("Register map version needs to be ");

Serial.print(ZX_REG_MAP_VER);

Serial.print(" to work with this library. Stopping.");

while(1);

MsTimer2::set(500, flash); // 500ms period //delay 500ms

MsTimer2::start();

void loop() {

// If there is gesture data available, read and print it

if ( zx_sensor.gestureAvailable() ) { //if gesture data is available

gesture = zx_sensor.readGesture(); //read gesture data

gesture_speed = zx_sensor.readGestureSpeed(); //read gesture speed

switch ( gesture ) {

case NO_GESTURE: //if no gesture

Serial.print(vctr);Serial.println(" Detected"); //display message “detected”


52

// mySerial.println("No Gesture");

vctr++; //increment variable vctr(initial value is 0)

delay(1000);

if(vctr > 2){

digitalWrite(relay1,LOW); //pin 5 turned off

digitalWrite(buzzer,HIGH); //pin 7 is turned on

delay(100); //delay time 100ms

digitalWrite(buzzer,LOW); //pin 7 turned off

delay(100); // delay 100ms

digitalWrite(buzzer,HIGH); //turn on pin 7

delay(100); //delay 100ms

digitalWrite(buzzer,LOW); //turn off pi 7

flag1 = true;

if(vctr > 5){ //if increment reach 5

digitalWrite(relay1,HIGH); // turn on pin 5

digitalWrite(buzzer,HIGH); //turn on pin 7

delay(400); //delay 400ms

digitalWrite(buzzer,LOW); //turn off pin 7

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,HIGH);

vctr = 0; //pin 5 on, pin 4 off, pin 3 on

flag1 = false;

break;
53

while (mySerial.available()) { //if connection to android app available

// get the new byte:

char inChar = mySerial.read(); //read data

if (inChar == 'L') //if fetched data is “L” (low) or OFF

digitalWrite(relay1,LOW);digitalWrite(relay2,LOW);digitalWrite(relay3,LOW);

digitalWrite(buzzer,HIGH); //pin 5 off, pin 4 off, pin 3 off, pin 7 on

delay(300); //delay 300ms

digitalWrite(buzzer,LOW); //pin 7 off

else if(inChar == 'H') //if data fetched from app is “H” (means HIGH or
ON)

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,LOW);

digitalWrite(buzzer,HIGH); //pin 5 on, pin 4 on, pin 3 off, pin 7 on

delay(300); // delay 300ms

digitalWrite(buzzer,LOW); //pin 7 off

else if(inChar == 'O') //if data fetched is “0”

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,HIGH);

digitalWrite(buzzer,HIGH); //pin 5 on, pin 4 off, pin 3 on, pin 7 on


54

delay(300); //delay 300ms

digitalWrite(buzzer,LOW); //pin 7 off

else if(inChar == 'M') //if data is “M” or Manual

flag1 = false;

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,HIGH);

digitalWrite(buzzer,HIGH); // pin 5 off, pin 4 off, pin 3 on, pin 7 on

delay(300); //delay 300ms

digitalWrite(buzzer,LOW); //pin 7 off

flag1 = false;

else if(inChar == 'A') //if data is “A” or Automatic

digitalWrite(buzzer,HIGH); //pin 7 on

delay(300); //delay 300ms

digitalWrite(buzzer,LOW); //pin 7 off

flag1 = true;

sensors_event_t event;

dht.temperature().getEvent(&event); //read temperature

if (isnan(event.temperature)) { //if temperature not detected

Serial.println("Error reading temperature!"); //display


55

else { //if detected

vctr2++; //increment vctr

if(

vctr2 > 80){

mySerial.print("Temperature: "); //if temperature: (temperature)

mySerial.println(event.temperature); //if temperature: (temperature)

//Serial.println(event.temperature);

vctr2 = 0; //reset vctr to 0

if (flag1 == true){ //of variable flag 1 is true

if(event.temperature> 21 && event.temperature < 27){ //if temp is greater than 22 and
less than 27

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,LOW);

//delay(50000); //pin 5 on, pin 4 off, pin 3 off

if(event.temperature> 26 && event.temperature < 33){ //if temp is greater than 26 and less
than 33

digitalWrite(relay1,HIGH);digitalWrite(relay2,HIGH);digitalWrite(relay3,LOW);

//pin 5 on, pin 4 on, pin 3 off

//delay(50000);

else if(event.temperature > 32){ //if temperature is greater than 32

digitalWrite(relay1,HIGH);digitalWrite(relay2,LOW);digitalWrite(relay3,HIGH);

//pin 5 on, pin 4 off, pin 3 on

//delay(50000);
56

dht.humidity().getEvent(&event); //get humidity event and print its value

if (isnan(event.relative_humidity)) { //if no data fetched

Serial.println("Error reading humidity!"); //display

else { //else if humidity data is read

//Serial.print("Humidity: ");

//Serial.print(event.relative_humidity);

//Serial.println("%");

Device Graphical User Interface Codes

#Region Project Attributes //android setup

#ApplicationLabel: BTControllerv1.0 //android setup

#VersionCode: 1 //android setup

#VersionName: //android setup

'SupportedOrientations possible values: unspecified, landscape or portrait.//android


setup

#SupportedOrientations: portrait //android setup

#CanInstallToExternalStorage: False //android setup

#End Region
57

#Region Activity Attributes //setup of GUI for android

#FullScreen: False //setup of GUI for android

#IncludeTitle: True //setup of GUI for android

#End Region

Sub Process_Globals

'These global variables will be declared once when the application starts.

'These variables can be accessed from all modules.

Dim Serial1 As Serial //serial variable

Dim ast As AsyncStreamsText //initialize global variable

Dim Sms1 As PhoneSms //initialize global variable

Dim SI As SmsInterceptor //initialize global variable

SI.Initialize2("SI", 999) //initialize global variable

End Sub

Sub Globals

'These global variables will be redeclared each time the activity is created.

'These variables can only be accessed from this module.

Dim connected As Boolean //declaring of private variables

Private EditText1 As EditText //declaring of private variables

Private btnsend As Button //declaring of private variables

Private lbldata As Label //declaring of private variables


58

Private ImageView1 As ImageView //declaring of private variables

Private CheckBox1 As CheckBox //declaring of private variables

Private CheckBox2 As CheckBox //declaring of private variables

Private EditText2 As EditText //declaring of private variables

Public thisTelmo As String //declaring of private variables

Private CheckBox3 As CheckBox //declaring of private variables

End Sub

Sub Activity_Create(FirstTime As Boolean)

'Do not forget to load the layout file created with the visual designer. For example:

Activity.LoadLayout("Layout1") //load first layout in the app

If Serial1.IsEnabled = False Then //check if serial is not enabled

Serial1.Initialize("serial1") //enable serial

Else //if serial is enabled

Serial1.Listen 'listen for incoming connections //check for connections

End If

lbldata.TextSize = 30 //change font size for lbl data

btnsend.BringToFront //send to front button btnsend

Delay(1500) //delay 1500ms

CheckBox1.Checked = True //check checkbox

End Sub
59

Sub Activity_Resume

mnuOpenComm //all mnuOpenComm function

End Sub

Sub Activity_Pause (UserClosed As Boolean)

If connected = True Then

ast.close

End If

End Sub

Sub Delay (DurationMs As Int)

Dim target As Long = DateTime.Now + DurationMs //delay function

Do While DateTime.Now < target //delay function

Loop //delay function

''ToastMessageShow("Delay Done!",False) //delay function

End Sub

Sub ast_NewText(Text As String)

Dim temp,str As String //declare variable temp and str as string

temp = Text // assign value for temp as text

lbldata.Text = temp //change text lbl data with the value of variable
temp

Dim gasint As Int //declare gasint as variable with integer value

''ToastMessageShow(temp,False) //pop out text value of temp


60

If temp.Length>2 Then //if number of letters assigned to temp is


greater than 2

Try

If temp.Contains("sen")Then //check if temp contains


“sen” string

str = temp //assign the value of temp to str variable

lbldata.Text = str.SubString(4) //change text of lbl data text to the 5th letter of str value

gasint = str.SubString(4) //assign the 5th letter/character to gasint


variable

If gasint > 200 Then //if gasint is greater than 200

Sms1.Send("09278920228","Gas alert triggered!") //send sms

End If

End If

Catch

Log("Errr")

End Try

End If

End Sub

Sub Serial1_Connected (Success As Boolean) //connection to serial

If Success Then //if connection succeeds

'ToastMessageShow("Connected successfully", False) //pop out message

'Delay(500) //delay 500ms


61

connected = True //assign value to connected as


true

ToastMessageShow("System is now connected!",False) //pop out message

'btnConn.Text = "About" //change text for btncnn as “about”

If ast.IsInitialized Then ast.Close

ast.Initialize(Me, "ast", Serial1.InputStream, Serial1.OutputStream) 'initialize


AsyncStreamsText with the socket streams.

Log(LastException)

End If

End Sub

Sub mnuOpenComm

Dim PairedDevices As Map

PairedDevices = Serial1.GetPairedDevices //get paired devices

Dim l As List

l.Initialize

For i = 0 To PairedDevices.Size – 1 //extract paired devices

l.Add(PairedDevices.GetKeyAt(i))

Next

Dim res As Int

res = InputList(l, "Choose device", 0) 'show list with paired devices

If res <> DialogResponse.CANCEL Then

Serial1.Connect(PairedDevices.get(l.get(res))) 'convert the name to mac address


62

//connect to selected devices

End If

End Sub

Sub mnuCloseComm_Click

If connected = True Then

ast.close

End If

End Sub

Sub btnsend_Click //when button is checked

If connected = True Then //if connected is true

ast.Write("M" & Chr(13)) //pop out message

End If

End Sub

//this area is for mode changing “OFF or Automatic”

Sub checkbox1_CheckedChange(Checked As Boolean) //checkbox event checked

If connected = True Then // if connected

If CheckBox1.Checked = True Then //if checkbox is checked

ast.Write("A" & Chr(13)) //send “A” to Arduino

CheckBox1.Text = "Automatic" //change text to “Automatic”

Else //if checkbox is not checked


63

ast.Write("M" & Chr(13)) //send “M” to arduino

CheckBox1.Text = "OFF" //change text to “OFF”

End If

End If

End Sub

//this area is for turning on and off of device

Sub CheckBox2_CheckedChange(Checked As Boolean)

If connected = True Then //if app is connected to device

If CheckBox2.Checked = True Then //if checkbox 2 is checked

ast.Write("H" & Chr(13)) //send “H” to Arduino

CheckBox2.Text = "HIGH" //change text to HIGH

Else //if checkbox is not checked

ast.Write("L" & Chr(13)) //send “L” to Arduino

CheckBox2.Text = "LOW" //change text to “LOW”

End If

End If

End Sub

Sub SI_MessageReceived (From As String, Body As String) As Boolean

thisTelmo = From //assign variable from to variable thisTelmo

'Msgbox(From & " " & Body,"System message")

Dim strBody As String //declare strBody as string


64

strBody = Body //assign variable Body to strBody

Dim str1 As String //declare strl as string

Dim str1 As String

If strBody.Contains("Load1on") Then //check of strBody contains “Loadlon”

ast.Write("1" & Chr(13)) //send “1” to arduino

Dim str1 As String //redeclare str 1 as string

str1 = "Load1 is now ON" //assign value “Load1 is now ON to variable


strl 1

Try

Sms1.Send(thisTelmo,str1) //sent text message

ToastMessageShow("SMS sent",False) //pop out message “sms sent”

Catch

Log("Error")

End Try

Else If strBody.Contains("Load1off") Then //check if strBody contains “Load1 off”

ast.Write("2" & Chr(13)) //send “2” to arduino

str1 = "Load1 is now OFF" //assign “Load1 is now OFF” to variable


str1

Try

Sms1.Send(thisTelmo,str1) //send message

ToastMessageShow("SMS sent",False) //pop out message

Catch
65

Log("Error")

End Try

End If

End Sub

Sub CheckBox3_CheckedChange(Checked As Boolean)

If connected = True Then

If CheckBox3.Checked = True Then //if checkbox3 is checked

ast.Write("C" & Chr(13)) //send “C” to arduino

Else //else if checkbox3 is not checked

ast.Write("c" & Chr(13)) //send “c” to arduino

End If

End If

End Sub
66

APPENDIX C

Pictures
67
68

APPENDIX D

Curriculum Vitae
PERSONAL BACKGROUND

Name: Reynaldo U. Baculo

Birthdate: October 22, 1997

Address: Brgy.83 Paraiso San Jose Tacloban city

Gender: Male

Civil status: Single

Citezenshp: Filipino

PARENTS

Father’s name: Reynaldo J. Baculo Sr.

Mother’s name: Regina U. Baculo

EDUCATIONAL BACKGROUND

Elementary: San Fernando Central School 2008-2009

Secondary: Leyte National High School 2012-2013

Tertiary: Eastern Visayas State University 2018-2019

Organizational affiliation: Institute of Integrated Electrical Engineers(IIEE)

Religion: Roman catholic

Training attended: On the job training at Leyeco II (SLRD) Engineering


Department

Motto: “Matter what happen in life, keep a good heart. Don’t let the darkness of
this world harden your heart.”
69

PERSONAL BACKGROUND

Name: Kenneth John T. Hernandez

Birth Date: March 5, 1997

Address: Brgy. 3 Sto. Nino St. Calbiga, Samar

Gender: Male

Civil Status: Single

Citizenship: Filipino

PARENTS:

Father’s Name: Judito T. Hernandez

Mother’s Name: Floreza Milagros T. Hernandez

EDUCATIONAL BACKGROUND

Elementary: Calbiga Central Elem. School 2004-2010

Secondary: Eastern Visayas Regional Science High School 2010-2014

Tertiary: Eastern Visayas State University 2014-2019

Organization Affiliation: Institute of International of Electrical Engineers (IIEE)

Religion: Roman Catholic

Training Attended: On the Job Training at National Grid Corporation of the


Philippines (NGCP) May-June 2019
70

PERSONAL BACKGROUND

Name: Jhon Erick C. Lacambra

Birth Date: June 9, 1997

Address: Brgy. Camayse, Sta. Rita, Samar

Gender: Male

Civil Status: Single

Citizenship: Filipino

PARENTS:

Father’s Name: Ramon E. Lacambra

Mother’s Name: Juana C. Lacambra

EDUCATIONAL BACKGROUND

Elementary: Sta. Rita I Central Elementary School 2004-2010

Secondary: Sta. Rita, National High School 2010-2014

Tertiary: Eastern Visayas State University 2014-2019

Organization Affiliation: Institute of International of Electrical Engineers (IIEE)

Religion: Roman Catholic

Training Attended: On the Job Training at Samelco II Basey May-June 2019

Eligibility: TESDA Electrical Installation and Maintenance NCII


71

PERSONAL BACKGROUND

Name: Riyhad F. Tamayo

Birth Date: March 05, 1996

Address: San Roque St, Brgy.Holy Child I

Alangalang Leyte

Gender: Male

Civil Status: Single

Citizenship: Filipino

PARENTS:

Father’s Name: Adelino F. Tamayo

Mother’s Name: Emeline F. Tamayo

EDUCATIONAL BACKGROUND

Elementary: Alangalang I Central School 2007-2008

Secondary: Alangalang National High School 2011-2012

Tertiary: Eastern Visayas State University 2018-2019

Organization Affiliation: Institute of International of Electrical Engineers (IIEE)

Religion: Roman Catholic

Training Attended: On the Job Training at LEYECO III, Tunga Leyte May - June
2018
72

You might also like