wireless programmable relay switches · 2015-09-12 · wireless and programmable relay switches....
TRANSCRIPT
WIRELESS PROGRAMMABLE RELAY SWITCHES
KURT IRVING S. BARCELONA, ALLEN VINCENT B. CATAPANG, JEREMY PATRICK G. PACABIS
Philippine Science High School Southern Mindanao Campus, Sto. Nino Tugbok District, Davao
City, Philippines, [email protected], [email protected],
Abstract
Commercially available electricity management systems are used to address the wastage
of electric energy. However, these systems have disadvantages such as inadaptability in
various applications, mobility and price. This study was done to develop a portable,
adaptable and affordable electricity management system that switches electrical
connections automatically or manually with wireless and programmable technology.
Accomplished circuits based from designed schematic diagrams were interconnected to
form a system comprised of an encoder-transmitter and receiver-decoder. Then an
automation program, which accepts numerical values as to when a relay switch turns on
or off, was also constructed and inserted into the system. Manual switching range test and
automatic switching range test were conducted to determine the functionality of the
system in turning on or off electrical connections using relay switches. The manual
switching range test determined the system’s capability to wirelessly turn on and off
electrical connections at various distances, and automatic switching range test determined
the system’s automation capability at various distances. All tests showed that the system
was fully functional in switching within a 35 meter range. Over-all, the system was able
to carry out its function well from the tests above. Thus, the system functions properly by
turning on or off relay switches manually or automatically at different distances within its
optimal range of 35 meters.
Keywords: automatic switching, relay switches, wireless, programmable, Frequency
Modulation (FM), Dual – Tone Multi Frequency (DTMF)
Introduction
Electricity is used to operate electric
devices. It has been a major source of
energy. However, some devices consume
more electrical energy if they are improperly
managed. According to Bluejay (2011),
electricity can cause pollution because the
generation of electricity utilizes fossil fuels.
These fossil fuels contribute to the emission
of pollutants to the air. According to
Schueler (2012), electric energy
consumption would be reduced to 10% if
devices are turned off and unplugged or
disconnected from the power source. Users
can reduce electrical energy and fossil fuels
consumed if they turn off devices or
disconnect them from the power source.
The present solution to this problem was to
manually switch off the electrical
connections of the devices when they are not
being used. This can be done by using
mechanical switches. Mechanical switches
control the current flow within a circuit but
this has to be done manually (Scott, 2011).
Another solution to this problem was the use
electromagnetic relays. Relays turn on and
off the electrical connections of the devices
using an external power source. They can
also function as switches because they can
open or close the pathway of current in a
circuit (Hewes, 2012). Another solution is
the use of complex, heavy and network-
based home automation systems which can
automatically control switches and outlets
inside a structure to reduce human
intervention. These systems have other
integrated automated functions aside from
switch automation and use Internet Service
Providers (ISP) to extend the range of access
between the user and the system itself, but
this makes the system costly and these are
limited by their heavy weight and difficulty
to be installed, making it not suitable to
operate in other areas other than a
permanent household structure (Smarthome,
2012).
The proposed solution was an adaptable
electricity management system that utilized
wireless and programmable relay switches.
These wireless programmable relay switches
were able to turn on and off electrical
connections automatically or manually using
wireless technology. The time for a relay
switch or a group of relay switches to turn
on or off can be set by the user using the
preset program.
The made gadget can operate in various
scenarios, other than a permanent
household. It is lightweight and portable. It
only focuses on switch automation, and not
in other automated functions. The gadget
doesn’t use ISPs instead; it uses a free
wireless resource – public FM radio. It can
be implemented in other systems which
require switch automation. The software
bundled in this system can be easily
modified by the user, and the parts for the
system are easy to find.
The system reduces human intervention and
it can be easily set up and installed since it’s
portable. It can turn on and off Alternating
Current (AC) and Direct Current (DC)
connections in some electrical circuits,
unlike the commercially available systems
which can only turn on and off AC. The
system can be used in laboratories to switch
devices on specified periods of time. The
system can be used in closed-circuit
television (CCTV) to switch different
cameras. The system can also be used in
production lines in the industry, where some
machines needed automatic switching. And
the system can be used in household to
switch different appliances over time. The
system uses wireless technology, and
doesn’t use physical hard wire connections.
Materials and Methods
An electricity management system that
operates using wireless technology is a good
tool to address problems on improper
electrical energy consumption. Currently,
electromagnetic relays and network-based
home automation systems are used but these
have disadvantages such as inadaptability to
various scenarios, bulky, expensive and
large maintenance costs.
Gathering of materials
For the construction of the system you may
refer to Appendix A for the flow of
methods. The first part of the flow, the
materials gathered were: one Gizduino
microcontroller platform, one W91212 Dual
Tone Multi Frequency (DTMF) tone
encoder Integrated Circuit (IC), two 4013 D-
flip flop ICs, nine 1 mm diameter soldering
lead with flux core, one 14-pin IC socket,
one 16-pin IC socket, one 4 in. x 6 in.
presensitized printed circuit board (PCB),
one m American Wire Gauge (AWG)
number 18 magnet wire, one meter AWG
number 31 magnet wire, one 750 mA 15-0-
15 V transformer, eight pairs 1/8 in. nuts and
bolts, one plastic enclosure: Alexan HC-881,
five normally open momentary push button
switches, two single pole double throw
toggle switches (SPST), four yellow light
emitting diodes (LED), five red LEDs, three
green LEDs, eight m 1.5mm solid core wire,
one 3.5 mm mono headphone jack chassis,
one 3.5 mm stereo headphone jack chassis,
four pairs 1 in. nuts and bolts, one television
bunny ears antenna female plug connector,
one bunny ears antenna, one male antenna
connector without filtering transformer, one
¼-Watt 100 Ω resistor, two 1 nF ceramic
capacitors, four BC548 transistors, nine ¼-
Watt 10K Ω resistors, four ¼-Watt 8.2K Ω
resistors, one ¼-Watt 47 Ω resistor, one ¼-
Watt 1K Ω resistor, six ¼-Watt 150 Ω
resistor, eight 1N4007 diodes, three 3-18 pF
variable capacitors, one 22 μF 50V rated
capacitor, four 1 µF 16V rated capacitors,
two 2N2219 transistors, one 4.7 μF 50V
rated electrolytic capacitor, one 10K Ω
trimmer resistor, one 8-pin dual in line
switch, four ¼-Watt 100K Ω resistors, one
¼-Watt 1M Ω resistor. For the construction
of the receiver-decoder, the materials were:
one MC145436 DTMF tone decoder IC, one
LM7805 IC, one mini frequency modulation
(FM) radio receiver, one 16-pin IC socket,
four 6V single pole double throw (SPDT)
relays, one 4 in. x 6 in. presensitized PCB,
one 500mA 9-0-9 V transformer, one TO-
220 heat sinks, one outlet cord with
connector plugs, one 250V 1A fuse with
fuse holder, 10 pairs 1/8 in. nuts and bolts,
eight m 1.5mm solid core wire, one latching
push button switch, one 3.5 mm mono
headphone jack chassis, one plastic
enclosure: Alexan HC-823, four pair binding
posts, four red LEDs, four BC548
transistors, four 1N4007 diodes, one ¼-Watt
2K Ω resistor, five 0.1 μF ceramic
capacitors, one ½-Watt 1M Ω resistor, one
2200 μF 16V rated electrolytic capacitor.
For the construction of the encoder-
transmitter, the materials used were: one
LM317 IC, two LM7805 IC, one 28V 12A
direct current double pole double throw
(DPDT) relay, one 4 in. x 6 in. presensitized
PCB, four 1N4007 diodes, one 1N4002
diode, three 9600 μF 50V rated electrolytic
capacitor, one TO-220 heat sink, one outlet
cord with connector plugs, one ¼-Watt 220
Ω resistor, one 5 pF ceramic capacitor, two
10 nF ceramic capacitors, one 100 μF 50V
rated capacitor and five 10 pF capacitors.
You may refer to Appendix D for the
costing of these gathered materials. You
may refer to Appendix A for the flowchart
of methodology for the preparation of
circuits. The parts in the system were the
encoder-transmitter circuit, the receiver-
decoder circuit and the encoder-transmitter
power supply. PCB layouts for each circuit
were designed and etched according to their
proper schematic diagrams.
Encoder – transmitter construction
You may refer to Appendix A for the
construction of the system in the flow of
methodology. The encoder-transmitter was
composed of the Gizduino microcontroller
platform, Dual Tone Multi Frequency
(DTMF) encoder circuit and the 4-Watt
frequency modulation (FM) radio
transmitter. The Gizduino microcontroller
platform was already prefabricated and it
only needed power and digital interface
connections to be inserted. The DTMF PCB
was designed and etched properly. Its
components were then soldered according to
the schematic diagram and its proper PCB
layout referred in Appendix C figures C2,
C6 and C7. The 4-Watt FM transmitter
circuit’s components were soldered
according to the schematic diagram by
Kyriakos Kontakos and the PCB layout of
Silver respectively referred in Appendix C
figures C3 and C4 (Kontakos and Silver,
2007). The encoder-transmitter power
supply’s components were soldered and
connected according to the schematic
diagram and its PCB layout. It supplies a
+12.6VDC and a +5VDC regulated power
supply for the FM transmitter and other
circuits in the encoder-transmitter
respectively. It can deliver 750 mA of
current and was designed to have over
current, over voltage and overheating
protection (National Semiconductor, 2004).
Refer to Appendix C Figures C2, C8 and C9
for the schematic diagram, PCB parts layout
and copper side PCB layout for the power
supply circuit respectively. Placement of the
encoder-transmitter circuits were
strategically placed in an Alexan H-823
black plastic enclosure. The enclosure was
drilled with holes for LED indicators, push
button switches, toggle switches, female
banana jacks and auxiliary connectors for
user interface and monitoring. 1.5mm solid
core wire was used as connectors for the
circuits. All connections from one circuit to
another in the encoder-transmitter were
based on the schematic diagram. All of the
parts of the encoder-transmitter power
supply were strategically placed inside a
black aluminum computer automatic voltage
regulator enclosure. The encoder-transmitter
external power supply output and ground
terminals were extended via wires and male
banana jacks.
Receiver – decoder construction
You may refer to Appendix A for the
construction of the system in the flow of
methodology. The receiver-decoder was
composed of a +5VDC power supply, mini
FM radio receiver, DTMF decoder circuit
and relay switchboard. The +5VDC power
supply’s components were connected and
soldered according to the schematic diagram
and its PCB layout. It was designed to have
over current, over voltage and overheating
protection (National Semiconductor, 2004).
The mini FM radio receiver was a small
AA-battery operated analog FM receiver.
Instead of using batteries, its power came
from the receiver-decoder’s +5VDC rail.
The DTMF decoder is made up of a DTMF
tone to 4-bit hexadecimal converter and a
latching circuit. The DTMF tone to 4-Bit
hexadecimal converter used was the
MC145436P (Motorola, 1994). The 4013 D-
flip flop IC was used as a memory for the
latching circuit attached to the relay
switchboard composed of four 250V 5A
relays soldered on a strip of PCB (Johnson,
2012). Refer to Appendix C Figures C2,
C10 and C11 for the schematic diagram,
PCB parts layout and copper side PCB
layout for the decoder circuit respectively.
The receiver-decoder circuits were
strategically placed inside an Alexan HC –
881 black plastic enclosure. Holes were
drilled for parts that need to be attached to
the enclosure such as the binding posts, LED
indicators, fuse holder, antenna, 3.5mm
female jack and the AC power cord. The
mini FM radio receiver output is directly
connected to the DTMF decoder and to a
3.5mm female audio jack mounted on the
enclosure. Fine tuning of the FM radio
receiver to 108.1MHz was done by listening
to the DTMF tone transmitted by the
encoder-transmitter via speakers connected
to the 3.5mm audio jack. Each relay’s DC
side on the switchboard was connected to
the DTMF decoder while its AC sides are
connected to the binding posts attached on
the enclosure. LEDs acting as indicators
were installed for each relay switch to light
up when that relay switch is turned on
(Betop Electronics, 2012).
Microcontroller setup
The Gizduino microcontroller platform was
programmed using the Arduino’s integrated
development environment (IDE). The
program was designed only for automated
relay switching purposes using a dedicated
version of the C and C++ programming
languages for Arduino microcontroller
platform programming. The program
designed was to accept time values from the
user to automatically turn on or off a relay
switch (Arduino, 2012). Refer to Appendix
C table C1 for the program code.
Testing of the system
The Wireless Programmable Relay Switches
was tested in the Philippine Science High
School Southern Mindanao Campus. The
system was tested for its manual switching
range capability and its automatic switching
range capability in various distances. The
ratio of successful attempts to total attempts
was recorded in each test.
The manual switching range test determined
the system’s capability to turn on or off
different relay combinations manually at
various distances. The initial distance was 5
meters and was increased in 10 meter
increments. The testing distances were 5
meters, 15 meters, 25 meters, 35 meters, 45
meters, 55 meters and 65 meters. The testing
of the system was done given that the
encoder-transmitter and receiver-decoder
were in line of sight with each other. The
testing was accomplished after testing the
system at 65 meters because at this distance,
the encoder-transmitter and receiver-decoder
were completely out of communication
range. The manual switching range test was
conducted using 15 combinations of
different relay switches. Switch
identifications were made which identified
each relay switch as ‘1’, ‘2’, ‘4’ and ‘8’. The
different combinations of relay switches that
were tested were the following: switch 8
only, switch 4 only, switches 8 and 4, switch
2 only, switches 2 and 8, switches 2 and 4,
switches 2, 4 and 8, switch 1 only, switches
1 and 8, switches 1 and 4, switches 1, 4 and
8, switches 1 and 2, switches 1, 2 and 8,
switches 1, 2 and 4, and switches 1, 2, 4 and
8. There will be a total of 15 switching
attempts per combination. The receiver-
decoder had a LED installed to each relay
switch in identifying the state of that relay,
whether it was turned on or off. The ratio of
successful attempts to the total attempts was
recorded on each combination.
The automatic switching range test
determined the system’s capability to
execute the program for automated
switching. The distances that were tested for
automatic switching test were the same with
the manual switching range test. The tested
distances for this test were 5 meters, 15
meters, 25 meters, 35 meters, 45 meters, 55
meters and 65 meters. The automatic
switching range test was done given that the
encoder-transmitter and receiver-decoder
were in line of sight with each other. The
pre-programmed data for the automation
program had a set of time value of 16
seconds for switches 1, 2 and 4 to turn on
and another 4 seconds before switch 8 could
turn on. This will be considered as one
switching attempt. After all the switches
were turned on, the program turned off these
switches after 20 seconds. This was also
considered as one switching attempt. There
were a total of 15 switching attempts for
each distance. The ratio of successful to total
attempts was recorded.
The temperature on the encoder-transmitter
and receiver-decoder’s immediate
surrounding environment was recorded.
Temperature can affect the atmosphere’s
index of refraction for radio waves (Graham
Brock Inc., 2009). The temperature in the
atmosphere can affect the radio
communication of the system. Temperatures
of the components were recorded on each
distance.
Gathering of data
There were two tests conducted to determine
the range and the ratio of success to total
attempts. These tests were the manual
switching range test and the automatic
switching range test. The latter determined
the temperature of the immediate
surrounding environment of the components
which can affect the wave propagation
during testing (Graham Brock Inc., 2009).
In the manual switching range test, the result
determined the capability of the system to
turn on and off different relay combinations
manually at varying distances until 65
meters. The ratio of the number of
successful attempts to the total number of
attempts was recorded per combination.
These ratios of all combinations were
averaged in each distance.
In the automatic switching range test, the
result determined the capability of the
system to turn on and off the relay switches
automatically at varying ranges until 65
meters using a program with pre-
programmed values embedded into the
microcontroller. The ratio of the number of
successful attempts to the number of total
attempts will be recorded per range.
For price comparison, a data of the prices of
the different commercially available
automation system was gathered and it will
be in US Dollar value as of December 2012.
These prices were compared to the total
price of constructing the Wireless
Programmable Relay Switches and
determine whether the prices are significant
or not.
Results and Discussion
Table 1. Manual switching range test.
Switch
identification
combination
Distance (meters)
5 15 25 35 45 55 65
Su
cces
sful
atte
mp
ts t
o t
ota
l at
tem
pts
rat
io 1 15/15 15/15 15/15 15/15 15/15 0/15 0/15
2 15/15 15/15 15/15 15/15 14/15 0/15 0/15
4 15/15 15/15 15/15 15/15 15/15 0/15 0/15
8 15/15 15/15 15/15 15/15 14/15 0/15 0/15
1,2 15/15 15/15 15/15 15/15 14/15 0/15 0/15
1,4 15/15 15/15 15/15 15/15 14/15 0/15 0/15
1,8 15/15 15/15 15/15 15/15 12/15 0/15 0/15
2,4 15/15 15/15 15/15 15/15 14/15 0/15 0/15
2,8 15/15 15/15 15/15 15/15 13/15 0/15 0/15
4,8 15/15 15/15 15/15 15/15 15/15 0/15 0/15
1,2,4 15/15 15/15 15/15 15/15 14/15 0/15 0/15
1,2,8 15/15 15/15 15/15 15/15 14/15 0/15 0/15
1,4,8 15/15 15/15 15/15 15/15 14/15 0/15 0/15
2,4,8 15/15 15/15 15/15 15/15 15/15 0/15 0/15
1,2,4,8 15/15 15/15 15/15 15/15 13/15 0/15 0/15
Average ratio
on each
distance 15/15 15/15 15/15 15/15 14/15 0/15 0/15
Table 2. Surrounding temperature measured
on each distance.
Table 3. Automatic switching range test.
Table 4. Commercial and proponents’
prices.
Figure 1. The wireless programmable relay
switches system.
Figure 2. A step-by-step diagram of the
mechanism of the system.
To use manual switching, a toggle switch is
activated to turn off the automated control of
the Gizduino microcontroller platform. The
activation of DTMF tones now rests on the
push button switches attached on the
encoder-transmitter enclosure. Whenever a
push button switch is pressed, it will turn on
specific DTMF tones that will be
broadcasted by the 4-watt FM transmitter at
a frequency of 108.1 MHz. The signals will
then be received by the mini FM receiver
tuned at a frequency of 108.1 MHz. These
signals will be decoded by the DTMF
decoder, composed of a DTMF tone to 4-Bit
hexadecimal converter and latching circuits.
The DTMF tone to 4-Bit hexadecimal IC
used was the MC145436P. It was used
because it can detect and convert all
standard DTMF tones to hexadecimal values
and it was readily available from a local
electronic parts store. The latching circuit
was mainly composed on the 4013 dual D
flip flop IC which provides latching
Component Distance (meters)
5 15 25 35 45 55 65
Encoder-Transmitter’s
surrounding
temperature
(°C)
26.0 27.4 27.0 27.0 28.8 26.0 29.0
Receiver-
Decoder’s surrounding
temperature (°C)
28.5 29.5 28.0 27.0 28.2 28.0 25.1
Distance (meters)
5 15 25 35 45 55 65
Successful
attempts to total
attempts ratio
15/15 15/15 15/15 15/15 15/15 0/15 0/15
Commercially available
systems’ price
The proponents’
system’s price
2500 USD 90.87 USD
Automatic
OR
Press the push
button switches
3.) DTMF
signals are
broadcasted
using FM
transmission.
4.) DTMF signals are
received by the mini
FM receiver, decoded
by the DTMF decoder.
5.) Relay switches are
turned on or turned off
and the connected
loads will also be
turned on or turned
off.
Wireless
Wireless
2.) DTMF
encoder produces
analog signals of
specific DTMF
tone depending
on the input
keypad codes.
Program the microcontroller
1.) Choose the
mode of
switching
Manual
functions for the relay switches when a
signal from the DTMF tone converter is
detected. The automatic switching mode
should be turned on if the manual override
toggle switch is deactivated. The
microcontroller will execute the program
embedded to it. The system’s
microcontroller was programmed using C
and C++ programming. The made
program’s purpose is to collect and execute
the user’s time value set for specific relay
switches to turn on or off. The
microcontroller will momentarily activate on
a set of DTMF tones on the DTMF encoder
which will then be transmitted by the 4-watt
FM transmitter at a frequency of 108.1
MHz. The signals will then be received by
the mini FM receiver tuned at a frequency of
108.1 MHz. These signals are then decoded
by the DTMF decoder, which is directly
connected to the relay switches. The relay
switches will turn on or off depending on the
DTMF tone being decoded by the DTMF
decoder.
The encoder-transmitter controls the
receiver-decoder wirelessly by broadcasting
DTMF signals to the receiver-decoder using
FM transmitter and the receiver-decoder will
receive and decode the signals then turn on
or turn off the specific relay switches that
correspond to the received and analysed
DTMF signal.
Acknowledgements
The proponents of this research study would
like to express their sincere gratitude to the
people who made this research study
possible. Ms. Carolyn Mae Z. Villanaba and
Ms. Jovie M. Narciso, their research
advisers, for effectively guiding them in
their research project and for being patient
in following up their responsibilities.
Without them guidance, this research study
would not have been possible. Mr. Vincent
B. Catapang and Mrs. Ritza B. Catapang,
Mr. Mario Barcelona and Mrs. Yolanda
Barcelona, and Mr. Dominador R. Pacabis
and Mrs. Concepcion G. Pacabis, their
parents, for the moral and financial supports
they have given. Ms. Sharon Dejarme, Mr.
Bernard Beduya, Mr. Michael Casas, Engr.
Michael Nalitan, Engr. Cromwell Castillo,
Mr. Trextan Sanchez and Engr. Nelson
Enano, Jr., their mentors in the field of
computer science, research and electronics.
They have provided time and taught them
enough information to aid in the
construction of the system. Likewise, to
their friends, classmates, and research mates
who provided them companionship and
shared their experiences and advices during
hard and easy times. Above all, to Almighty
God for giving them the grace to make all
these things possible. The success of their
research study and their other successes are
all for His greater glory.
References
Arduino. (2012). “Why Arduino?”.
Retrieved on October 8, 2012 from
http://arduino.cc/en/Guide/Introduction
Betop Electronics. (2009). “Application of
LEDs”. Retrieved January 1, 2012, from
http://www.betop- led.com/
en_LED_knowledge.asp?id=32
Bluejay, M. (2011). “Saving Electricity”.
Retrieved on July 20, 2011 from
http://michaelbluejay.com/electricity/
Graham Brock Inc. (2009). “Weather-related
Interference”. Retrieved on January 12,
2013 from http://www.grahambrock.com
/downloads/INVERSIONS.pdf
Gathering of Materials
Preparation of Circuits
Construction of the System
Testing of the System
Gathering of System
Hewes, J. (2011). “Relays”. Retrieved July
19, 2012 fromhttp://www.kpsec.
freeuk.com/components/relay.htm
Johnson, D. et al. (2012). “Pushbutton
Oneshot and Latch”. Retrieved on
October 7, 2012 from
http://www.discovercircuits.com/DJ-
Circuits/4013oneshots.htm Kontakos, K. and Silver (2007). “4W FM
Transmitter”. Retrieved on May 27, 2012
from http://www.free-
electronic-circuits.com/circuits/4w-fm-
transmitter.html
Motorola. (1994). “Dual Tone Multiple
Frequency Receiver”. Retrieved on
October 7, 2012 from
http://www.datasheetcatalog.org/
datasheet/motorola/MC145436P.pdf
National Semiconductor. (2004).
“LM117/LM317T, LM317 3-Terminal
Adjustable Regulator”. Retrieved on
October 8, 2012 from
http://pdf1.alldatasheet.com/datasheet-
pdf/view/8619/NSC/LM317.html
Schueler, J (2011). “Are Energy Vampires
Sucking you dry?”. Retrieved on
November 13, 2012 from
http://energy.gov/articles/are-energy-
vampires-sucking-you-dry
Scott, B. (2011). “What Are the Different
Types of Electrical Switches?”. Retrieved
on July 20, 2011 from
http://www.wisegeek.com/what-are-the-
different-types-of-electrical-switches.htm
Smarthome. (2012). “What is Home
Automation?”. Retrieved on October 7,
2012 from http://www.smarthome.com/
homeautomation.html
Appendices
Appendix A
FLOWCHART OF METHODOLOGY
Appendix B
MECHANISM OF THE SYSTEM
User selects relay switches to turn on/off
on the transmitter-encoder.
The DTMF encoder is
activated and sends out
DTMF signals to the 4-Watt
FM transmitter
The DTMF signal will be
broadcasted over the air
The receiver-decoder will
receive and decode the
signal
The relay will turn on/off
corresponding to the specific
DTMF signal being
received.
Appendix C
SCHEMATIC, CONCEPTUAL
DIAGRAMS AND PICTURES
OF THE SYSTEM
Figure C1. Conceptual diagram of wireless
programmable relay switches (WPRS).
Figure C2. Schematic diagram of wireless
programmable relay switches.
Figure C3. Kontakos, K. (2007).
4-Watt FM transmitter schematic diagram.
Retrieved from http://www.free-electronic-
circuits.com/circuits/4w-fm-transmitter.html
Figure C4. Silver. (2007).
4-Watt FM transmitter PCB layout.
Retrieved from http://www.free-electronic-
circuits.com/circuits/4w-fm-transmitter.html
Figure C5. Johnson, D. et al. (2012).
4013 latching circuit. Retrieved from
http://www.discovercircuits.com/
DJ-Circuits/4013oneshots.htm
Figure C6. Copper side of the DTMF
encoder printed circuit board (PCB).
Figure C7. Parts Layout of the DTMF
encoder PCB.
Figure C8. Copper side of the DTMF
encoder power supply PCB.
Figure C9. Parts layout of the DTMF
encoder power supply PCB.
Figure C10. Copper side of the DMTF
decoder PCB.
Figure C11. Parts layout of the DTMF
decoder PCB.
Figure C12. Copper side of the receiver-
decoder power supply PCB.
Figure C13. Parts layout of the receiver-
decoder power supply PCB.
Figure C14. Wiring diagram of the front
view and back view of the encoder-
transmitter.
Figure C15. Wiring diagram of front view
and back view of receiver-decoder.
Figure C16. Wiring diagram of front view
and back view of encoder-transmitter
external power supply.
Figure C17. Receiver-decoder in operation.
Figure C18. Encoder-transmitter in
operation.
Figure C19. Device efficiency equation.
Table C1. Program for the Gizduino
microcontroller platform.
/* This is a program for the Wireless
Programmable Relay Switches System,
specifically for the encoder and transmitting
end. This program is used to set the time it
takes for a specific switch to turn on or off
automatically, by executing this program.
There are only 4 switches that can be
turned on or off. The switch ID's will be set
as 1, 2, 4 and 8 for convention. This
program will let the user set the switches to
be activated or deactivated. The program
will also let the user choose the values of
time when a specific switch or a group of
switches should turn on or off and the
program lets the user choose the option for
delayed permanent power on or delayed
permanent power off. There are variables in
the program that the user can set. The
maximum time that a user can set is 18
hours and 35 minutes. This means that a
switch or group of switches can only stay on
its programmed state for 18 hours and 35
minutes. That switch should change its state
after 18 hours and 35 minutes because the
microcontroller can't handle values greater
than 18 hours and 35 minutes. For example,
a user turned on a switch. He/she should set
the time for a switch to turn off after 18
hours and 35 minutes because the program
won't run properly once the values exceed
18 hours and 35 minutes.
In the program itself, the user will
only set the number of seconds for a switch
or a group of switches to turn on or off. The
number of seconds must also be divisible by
number 4, so that the microcontroller will
have ease executing a program cycle. Not
following the divisibility rule of this
program might cause an unwanted and
inaccurate execution of a program. For
example, a user should set 16 seconds time
instead of 15. The program is not intended
for other numerical numbers for accuracy,
and the microcontroller will have a difficult
time handling decimal values of time one it's
not divisible by 4.
This program has permalatch functions.
This means that a user can not only set the
time to turn on or off switches, but also the
user can set the time for a switch to turn on
permanently after a period of time. This can
also be applied when turning off switches.
The user can set the time it takes for a
switch, usually in ON state, to turn off. A
user cannot turn on both automated function
and permalatch function in once switch.
Unwanted program executions might occur.
Rules (format of switch variable):
<variable><switch ID number>=<value>;
For example, input4=36;
The variable input is the switch number 4
with a value of 36.
*/
// MAXIMUM: 18.0 hours and 35 minutes in
either off or on mode. Delay time max is
67100000.
float timechecb = 67100000;
float timechecc = 86400000;
// ATTENTION! NOT RECOMMENDED
FOR USER INTERFACE BELOW!!!
float timecheck;
float time = 0;
float period = 4;
// seconds it will take 1 cycle of the switch
scanning to complete. Longer period creates
a higher change of success switching while
it increases time delays. Shorter periods will
likely decrease unsuccessful switching.
float mechperiod = period * 1000;
// Cycle time for each switch.
float delaytime =mechperiod/4;
// Delay time for the device to turn on the
DTMF generator.
int delayman=period*100;
float delaytimer=100;
// Time for delay must be divisible by 4 in
order to be accurate in timing.
// ATTENTION! NOT RECOMMENDED
FOR USER INTERFACE ABOVE!!!
// ATTENTION!! USER'S ZONE FOR
SETTING THE TIME BELOW!
// Only number values divisible by 4 are
allowed. If permalatch function is not used,
both input and off variables must have
number values divisible by 4.
float input = 16;
// AUTOMATED: desired time of on state
(in seconds). PERMALATCH: if permalatch
function is enabled, the value will indicate
the time it will lapse until the device turns
on permanently, and in order for this to
function, the variable 'off' value must be 0.
float off = 20;
// AUTOMATED: desired time of off state.
(in seconds). PERMALATCH: if permalatch
function is enabled, this will indicate the
time of the switch to stay in on state before it
permanently switches off, and in order for
this to function, the variable 'input' value
must be 0.
int selector = 0;
// PERMALATCH ENABLER: enables the
PERMALATCH FUNCTION IF VALUE =
'1'. If selector value = '0' (PERMALATCH
DISABLED), offdelay variables must be in
'0' value for safety of not using permalatch
function.
int offdelay = 0;
// PERMALATCH VERIFIER: if value = '1'
and selector = '1', will enable the
permatlatch function. Turning on this
function also requires to make the value of
replaycheck = '0'
int replaycheck =0;
// If value is '1' and selector and offdelay are
'0', this will disable the operation of this
specific switch being used in the program.
For using solely for automated mode, this
must be in '0' and offdelay and selector must
be ='0' too.
float input2 = 16;
float off2 = 20;
int selector2 = 0;
int offdelay2 = 0;
int replaycheck2 =0;
float input4 = 16;
float off4 = 20;
int selector4 = 0;
int offdelay4 = 0;
int replaycheck4 =0;
float input8 = 20;
float off8 = 16;
int selector8 = 0;
int offdelay8 = 0;
int replaycheck8 =0;
// WARNING: NOT FOR USER
SELECTION BELOW!!!!!
float x= input;
float y= off;
float z= input2;
float r= off2;
float b= input4;
float k= off4;
float o= input8;
float p= off8;
int gg;
int n=0;
int qq = 0;
int ee;
int t=0;
int uu = 0;
int vv;
int i=0;
int hh = 0;
int oo;
int m=0;
int zz = 0;
int uno = 0;
int dos = 0;
int quatro = 0;
int otso = 0;
float delaytotal;
int tau=1;
int autorunled = 7;
int programpin = 8;
int ledoutpin = 13;
int restart = 6;
void setup() {
pinMode(autorunled,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
pinMode(9,OUTPUT);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(programpin,INPUT);
pinMode(ledoutpin,OUTPUT);
pinMode(restart,INPUT);
Serial.begin(9600);
Serial.println("SYSTEM START");
}
void loop() {
if(digitalRead(ledoutpin)==HIGH){
digitalWrite(ledoutpin,LOW);
digitalWrite(autorunled,HIGH);
}
if(analogRead(A0)<=853){
digitalWrite(0,HIGH);
}
else{
digitalWrite(0,LOW);
}
if(analogRead(A0)<=1023 &&
analogRead(A0)>=1000 &&
digitalRead(3)==HIGH){
digitalWrite(1,HIGH);
}
else{
digitalWrite(1,LOW);
}
n=0;
t=0;
i=0;
m=0;
timecheck = time=time+period;
digitalWrite(autorunled,HIGH);
// SWITCH 8
if(replaycheck==0){
if(x>0){
gg=0;
x=x-period;
}
if(x==0){
gg=1;
if(replaycheck!=1){
digitalWrite(9, HIGH);
delay(delaytime);
Serial.println("LED 9 ON");
digitalWrite(9,LOW);
delay(100);
}
if(selector==1){
replaycheck=1;
}
x=y;
uno =1;
Serial.println("8 ON");
qq++;
if (qq>1){
x=input;
qq=0;
uno = 0;
Serial.println("8 OFF. FINAL
DATA OUTPUT. IGNORE FORMER
OUTPUT");
}
}
if(gg==1){
n = delaytime+100;
}
}
else if (replaycheck==1){
if(x>0 && offdelay==1){
x=x-period;
if(x==0){
gg=1;
digitalWrite(9, HIGH);
delay(delaytime);
Serial.println("LED 9 ON");
digitalWrite(9,LOW);
delay(100);
if(uno==1){
uno=0;
Serial.println("8 OFF");
}
else{
uno=1;
Serial.println("8 ON");
}
if(gg==1){
n=delaytime+100;
}
}
}
}
// SWITCH 4
if(replaycheck2==0){
if(z>0){
ee=0;
z=z-period;
}
if(z==0){
ee=1;
if(replaycheck2!=1){
digitalWrite(10, HIGH);
delay(delaytime);
Serial.println("LED 10 ON");
digitalWrite(10,LOW);
delay(100);
}
if(selector2==1){
replaycheck2=1;
}
z=r;
dos = 1;
Serial.println("4 ON");
uu++;
if (uu>1){
z=input2;
uu=0;
dos = 0;
Serial.println("4 OFF. FINAL
DATA OUTPUT. IGNORE FORMER
OUTPUT");
}
}
if(ee==1){
t = delaytime+100;
}
}
else if (replaycheck2==1){
if(z>0 && offdelay2==1){
z=z-period;
if(z==0){
ee=1;
digitalWrite(10, HIGH);
delay(delaytime);
Serial.println("LED 10 ON");
digitalWrite(10,LOW);
delay(100);
if(dos==1){
dos=0;
Serial.println("4 OFF");
}
else{
dos=1;
Serial.println("4 ON");
}
if(ee==1){
t=delaytime+100;
}
}
}
}
// SWITCH 2
if(replaycheck4==0){
if(b>0){
vv=0;
b=b-period;
}
if(b==0){
vv=1;
if(replaycheck4!=1){
digitalWrite(11, HIGH);
delay(delaytime);
Serial.println("LED 11 ON");
digitalWrite(11,LOW);
delay(100);
}
if(selector4==1){
replaycheck4=1;
}
b=k;
hh++;
quatro = 1;
Serial.println("2 ON");
if (hh>1){
b=input4;
hh=0;
quatro = 0;
Serial.println("2 OFF. FINAL
DATA OUTPUT. IGNORE FORMER
OUTPUT");
}
}
if(vv==1){
i = delaytime+100;
}
}
else if (replaycheck4==1){
if(b>0 && offdelay4==1){
b=b-period;
if(b==0){
vv=1;
digitalWrite(11, HIGH);
delay(delaytime);
Serial.println("LED 11 ON");
digitalWrite(11,LOW);
delay(100);
if(quatro==1){
quatro=0;
Serial.println("2 OFF");
}
else{
quatro=1;
Serial.println("2 ON");
}
if(vv==1){
i=delaytime+100;
}
}
}
}
// SWITCH 1
if(replaycheck8==0){
if(o>0){
oo=0;
o=o-period;
}
if(o==0){
oo=1;
if(replaycheck8!=1){
digitalWrite(12, HIGH);
delay(delaytime);
Serial.println("LED 12 ON");
digitalWrite(12,LOW);
delay(100);
}
if(selector8==1){
replaycheck8=1;
}
o=p;
zz++;
otso = 1;
Serial.println("1 ON");
if (zz>1){
o=input8;
zz=0;
otso = 0;
Serial.println("1 OFF. FINAL
DATA OUTPUT. IGNORE FORMER
OUTPUT");
}
}
if(oo==1){
m = delaytime+100;
}
}
else if (replaycheck8==1){
if(o>0 && offdelay8==1){
o=o-period;
if(o==0){
oo=1;
digitalWrite(12, HIGH);
delay(delaytime);
Serial.println("LED 12 ON");
digitalWrite(12,LOW);
delay(100);
if(otso==1){
otso=0;
Serial.println("1 OFF");
}
else{
otso=1;
Serial.println("1 ON");
}
if(oo==1){
m=delaytime+100;
}
}
}
}
if(otso==0){
digitalWrite(5, LOW);
}
else{
digitalWrite(5, HIGH);
}
if(quatro==0){
digitalWrite(4, LOW);
}
else{
digitalWrite(4, HIGH);
}
if(dos==0){
digitalWrite(3, LOW);
}
else{
digitalWrite(3, HIGH);
}
if(uno==0){
digitalWrite(2, LOW);
}
else{
digitalWrite(2, HIGH);
}
// PRELIMINARY
delaytotal = n+t+i+m;
delay(mechperiod+delayman-
delaytotal);
time=timecheck;
Serial.print("seconds have passed
since start: ");
Serial.println(timecheck);
Serial.print("value of switch 1: ");
Serial.println(x);
Serial.print("value of switch 2: ");
Serial.println(z);
Serial.print("value of switch 4: ");
Serial.println(b);
Serial.print("value of switch 8: ");
Serial.println(o);
Serial.println("CYCLE
COMPLETE");
if(digitalRead(restart) == 1 ||
digitalRead(programpin) == 1){
if(uno==1){
digitalWrite(12, HIGH);
delay(delaytime);
Serial.println("LED 12 ON");
digitalWrite(12,LOW);
delay(100);
uno=0;
Serial.println("SHUTDOWN: 8
OFF");
}
if(dos==1){
digitalWrite(11, HIGH);
delay(delaytime);
Serial.println("LED 11 ON");
digitalWrite(11,LOW);
delay(100);
dos=0;
Serial.println("SHUTDOWN: 4
OFF");
}
if(quatro==1){
digitalWrite(10, HIGH);
delay(delaytime);
Serial.println("LED 10 ON");
digitalWrite(10,LOW);
delay(100);
quatro=0;
Serial.println("SHUTDOWN: 2
OFF");
}
if(otso==1){
digitalWrite(9, HIGH);
delay(delaytime);
Serial.println("LED 9 ON");
digitalWrite(9,LOW);
delay(100);
otso=0;
Serial.println("SHUTDOWN: 1
OFF");
}
x=input;
z=input2;
b=input4;
o=input8;
y=off;
r=off2;
k=off4;
p=off8;
timecheck = 0;
time = 0;
qq = 0;
uu = 0;
hh = 0;
zz = 0;
digitalWrite(ledoutpin,HIGH);
digitalWrite(autorunled,LOW);
delay(400);
}
if(digitalRead(programpin)==HIGH){
if(uno==1){
digitalWrite(12, HIGH);
delay(delaytime);
Serial.println("LED 12 ON");
digitalWrite(12,LOW);
delay(100);
uno=0;
Serial.println("SHUTDOWN: 8
OFF");
}
if(dos==1){
digitalWrite(11, HIGH);
delay(delaytime);
Serial.println("LED 11 ON");
digitalWrite(11,LOW);
delay(100);
dos=0;
Serial.println("SHUTDOWN: 4
OFF");
}
if(quatro==1){
digitalWrite(10, HIGH);
delay(delaytime);
Serial.println("LED 10 ON");
digitalWrite(10,LOW);
delay(100);
quatro=0;
Serial.println("SHUTDOWN: 2
OFF");
}
if(otso==1){
digitalWrite(9, HIGH);
delay(delaytime);
Serial.println("LED 9 ON");
digitalWrite(9,LOW);
delay(100);
otso=0;
Serial.println("SHUTDOWN: 1
OFF");
}
x=input;
z=input2;
b=input4;
o=input8;
y=off;
r=off2;
k=off4;
p=off8;
timecheck = 0;
time = 0;
qq = 0;
uu = 0;
hh = 0;
zz = 0;
if(otso==0){
digitalWrite(5, LOW);
}
else{
digitalWrite(5, HIGH);
}
if(quatro==0){
digitalWrite(4, LOW);
}
else{
digitalWrite(4, HIGH);
}
if(dos==0){
digitalWrite(3, LOW);
}
else{
digitalWrite(3, HIGH);
}
if(uno==0){
digitalWrite(2, LOW);
}
else{
digitalWrite(2, HIGH);
}
while(tau>0){
tau=tau+1;
digitalWrite(ledoutpin,HIGH);
delay(60);
digitalWrite(ledoutpin,LOW);
delay(60);
Serial.println("STOP LOOP FOR
PROGRAMMING. Restart if needed.");
digitalWrite(autorunled,LOW);
if(digitalRead(restart) == 1){
break;
digitalWrite(ledoutpin,HIGH);
digitalWrite(autorunled,LOW);
}
}
}
}
Appendix D
BUDGET FOR WIRELESS
PROGRAMMABLE RELAY SWITCHES
(WPRS)
Table D1. Proposed Expenses in Wireless
Programmable Relay Switches
Component Price Quantit
y
Total
Cost
0.1 micro
Farads
ceramic
capacitor
1.00
PHP 5
5.00
PHP
¼ Watt 100
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ Watt 100K
Ohms
resistors
0.30
PHP 4
1.20
PHP
¼ Watt 10K
Ohms
resistors
0.30
PHP 18
5.40
PHP
¼ Watt 150
Ohms resistor
0.30
PHP 6
1.80
PHP
¼ Watt 1K
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ Watt 1M
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ Watt 220
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ Watt 2K
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ watt 47
Ohms resistor
0.30
PHP 1
0.30
PHP
¼ Watt 8.2K
Ohms resistor
0.30
PHP 4
1.20
PHP
½ Watt 1M
Ohms resistor
1.00
PHP 1
1.00
PHP
1 inch nuts
and bolts
1.00
PHP 4
4.00
PHP
1 micro
Farads 16V
rated
capacitors
1.00
PHP 1
1.00
PHP
1 nano Farads
ceramic
capacitors
0.30
PHP 2
0.60
PHP
1.5
millimeters
solid core
wire
5.00
PHP 12
60.00
PHP
1/8 inch nuts
and bolts
1.00
PHP 18
18.00
PHP
10 micro
Farads 50V
rated
capacitor
3.00
PHP 1
3.00
PHP
10 pico
Farads
capacitor
0.30
PHP 1
0.30
PHP
100 micro
Farads 50
Volts rated
capacitor
1.50
PHP 1
1.50
PHP
100 nano
Farads
ceramic
capacitor
1.00
PHP
2 2.00
PHP
14-pin
integrated
circuit (IC)
socket
3.00
PHP 2
6.00
PHP
16-pin
integrated
circuit (IC)
socket
3.00
PHP 1
3.00
PHP
1N4002 1. 00
PHP 1
1.00
PHP
1N4007 1.00
PHP 12
12.00
PHP
22 micro
Farads 50 V
rated
capacitor
1.50
PHP 1
1.50
PHP
2200 micro
Farads 16
Volts rated
electrolytic
capacitor
16.00
PHP 1
16.00
PHP
250 Volts 1
Ampere fuses
with fuse
holders
15.00
PHP 2
30.00
PHP
28 Volts 12
Amperes
Direct
Current
Double Pole
Double
Throw Relay
78.00
PHP
1
78.00
PHP
2N2219 35.00
PHP 2
70.00P
HP
3.5mm mono
headphone
jack chassis
8.00
PHP 2
16.00
PHP
3.5mm stereo
headphone
jack chassis
16.00
PHP 1
16.00
PHP
3-18 pico
Farads
variable
capacitors
18.00
PHP 3
54.00
PHP
4 inches x 6
inches
presensitized
printed circuit
board (PCB),
135.00
PHP 2
270.00
PHP
4.7 micro
Farads 50
Volts rated
electrolytic
capacitor
1.00
PHP 1
1.00
PHP
4700 micro
Farads
electrolytic
50 Volts rated
capacitors
36.00
PHP
3 108.00
PHP
5 pico Farads
ceramic
capacitor
0.30
PHP 1
0.30
PHP
500 milli
Amperes 9-0-
9 Volts
potential
transformer
105.00
PHP 1
105.00
PHP
6-Volt single
pole double
throw (SPDT)
relays
20.00
PHP 4
80.00
PHP
750 milli
Amperes 15-
0-15 Volts
potential
transformer
150.00
PHP 1
150.00
PHP
8-pin dual in
line (DIP)
switch
8.00
PHP 1
8.00
PHP
American
Wire Gauge
(AWG)
number 18
magnet wire
5.00
PHP 1
5.00
PHP
AWG number
31
1.50
PHP 1
1.50
PHP
BC548
transistors
4.50
PHP
8 36.00
PHP
CD4013 18.00
PHP 2
36.00
PHP
Gizduino
microcontroll
er platform
1000.0
0 PHP 1
1000.0
0 PHP
green light
emitting
diodes (LED)
2.00
PHP 3
6.00
PHP
high grade
plastic
enclosure
Alexan HC-
881
170.00
PHP 1
170.00
PHP
latching push
button
switches
16.00
PHP 2
32.00
PHP
LM317 17.00
PHP 1
17.00
PHP
LM7805 18.00
PHP 2
36.00
PHP
MC145436P 260.00
PHP 1
260.00
PHP
mini portable
fm radio
100.00
PHP 1
100.00
PHP
normally
open
momentary
push button
switches
8.00
PHP 5
40.00
PHP
one 10 K
trimmer
resistor
10.00
PHP
1 10.00
PHP
outlet cords
with
connector
plugs
28.00
PHP 2
56.00
PHP
Pair of case-
mount
binding or
connecting
posts
16.00
PHP 4
64.00
PHP
plastic
enclosure
Alexan HC-
823
280.00
PHP 1
280.00
PHP
red light
emitting
diodes(LED)
2.00
PHP 7
14.00
PHP
single pole
double throw
toggle
switches
8.00
PHP 2
16.00
PHP
Soldering
lead with flux
4.00
PHP 18
72.00
PHP
television
bunny ears
antenna plus
connector
80.00
PHP 1
80.00
PHP
TO-220 heat
sinks
20.00
PHP 3
60.00
PHP
W91212 200.00
PHP 1
200.00
PHP
yellow light
emitting
diodes (LED)
2.00
PHP 4
8.00
PHP
TOTAL 3733.1
0 PHP