Sei sulla pagina 1di 26

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, kurtirvingbarcelona@gmail.com, avbc1996@gmail.com,
jeremypacabis@yahoo.com

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 operate in other areas other than a
permanent household structure (Smarthome,
Electricity is used to operate electric 2012).
devices. It has been a major source of
energy. However, some devices consume The proposed solution was an adaptable
more electrical energy if they are improperly electricity management system that utilized
managed. According to Bluejay (2011), wireless and programmable relay switches.
electricity can cause pollution because the These wireless programmable relay switches
generation of electricity utilizes fossil fuels. were able to turn on and off electrical
These fossil fuels contribute to the emission connections automatically or manually using
of pollutants to the air. According to wireless technology. The time for a relay
Schueler (2012), electric energy switch or a group of relay switches to turn
consumption would be reduced to 10% if on or off can be set by the user using the
devices are turned off and unplugged or preset program.
disconnected from the power source. Users
can reduce electrical energy and fossil fuels The made gadget can operate in various
consumed if they turn off devices or scenarios, other than a permanent
disconnect them from the power source. household. It is lightweight and portable. It
only focuses on switch automation, and not
The present solution to this problem was to in other automated functions. The gadget
manually switch off the electrical doesn’t use ISPs instead; it uses a free
connections of the devices when they are not wireless resource – public FM radio. It can
being used. This can be done by using be implemented in other systems which
mechanical switches. Mechanical switches require switch automation. The software
control the current flow within a circuit but bundled in this system can be easily
this has to be done manually (Scott, 2011). modified by the user, and the parts for the
Another solution to this problem was the use system are easy to find.
electromagnetic relays. Relays turn on and
off the electrical connections of the devices The system reduces human intervention and
using an external power source. They can it can be easily set up and installed since it’s
also function as switches because they can portable. It can turn on and off Alternating
open or close the pathway of current in a Current (AC) and Direct Current (DC)
circuit (Hewes, 2012). Another solution is connections in some electrical circuits,
the use of complex, heavy and network- unlike the commercially available systems
based home automation systems which can which can only turn on and off AC. The
automatically control switches and outlets system can be used in laboratories to switch
inside a structure to reduce human devices on specified periods of time. The
intervention. These systems have other system can be used in closed-circuit
integrated automated functions aside from television (CCTV) to switch different
switch automation and use Internet Service cameras. The system can also be used in
Providers (ISP) to extend the range of access production lines in the industry, where some
between the user and the system itself, but machines needed automatic switching. And
this makes the system costly and these are the system can be used in household to
limited by their heavy weight and difficulty switch different appliances over time. The
to be installed, making it not suitable to
system uses wireless technology, and Watt 10K Ω resistors, four ¼-Watt 8.2K Ω
doesn’t use physical hard wire connections. resistors, one ¼-Watt 47 Ω resistor, one ¼-
Watt 1K Ω resistor, six ¼-Watt 150 Ω
Materials and Methods resistor, eight 1N4007 diodes, three 3-18 pF
variable capacitors, one 22 μF 50V rated
An electricity management system that capacitor, four 1 µF 16V rated capacitors,
operates using wireless technology is a good two 2N2219 transistors, one 4.7 μF 50V
tool to address problems on improper rated electrolytic capacitor, one 10K Ω
electrical energy consumption. Currently, trimmer resistor, one 8-pin dual in line
electromagnetic relays and network-based switch, four ¼-Watt 100K Ω resistors, one
home automation systems are used but these ¼-Watt 1M Ω resistor. For the construction
have disadvantages such as inadaptability to of the receiver-decoder, the materials were:
various scenarios, bulky, expensive and one MC145436 DTMF tone decoder IC, one
large maintenance costs. LM7805 IC, one mini frequency modulation
(FM) radio receiver, one 16-pin IC socket,
Gathering of materials four 6V single pole double throw (SPDT)
relays, one 4 in. x 6 in. presensitized PCB,
For the construction of the system you may one 500mA 9-0-9 V transformer, one TO-
refer to Appendix A for the flow of 220 heat sinks, one outlet cord with
methods. The first part of the flow, the connector plugs, one 250V 1A fuse with
materials gathered were: one Gizduino fuse holder, 10 pairs 1/8 in. nuts and bolts,
microcontroller platform, one W91212 Dual eight m 1.5mm solid core wire, one latching
Tone Multi Frequency (DTMF) tone push button switch, one 3.5 mm mono
encoder Integrated Circuit (IC), two 4013 D- headphone jack chassis, one plastic
flip flop ICs, nine 1 mm diameter soldering enclosure: Alexan HC-823, four pair binding
lead with flux core, one 14-pin IC socket, posts, four red LEDs, four BC548
one 16-pin IC socket, one 4 in. x 6 in. transistors, four 1N4007 diodes, one ¼-Watt
presensitized printed circuit board (PCB), 2K Ω resistor, five 0.1 μF ceramic
one m American Wire Gauge (AWG) capacitors, one ½-Watt 1M Ω resistor, one
number 18 magnet wire, one meter AWG 2200 μF 16V rated electrolytic capacitor.
number 31 magnet wire, one 750 mA 15-0- For the construction of the encoder-
15 V transformer, eight pairs 1/8 in. nuts and transmitter, the materials used were: one
bolts, one plastic enclosure: Alexan HC-881, LM317 IC, two LM7805 IC, one 28V 12A
five normally open momentary push button direct current double pole double throw
switches, two single pole double throw (DPDT) relay, one 4 in. x 6 in. presensitized
toggle switches (SPST), four yellow light PCB, four 1N4007 diodes, one 1N4002
emitting diodes (LED), five red LEDs, three diode, three 9600 μF 50V rated electrolytic
green LEDs, eight m 1.5mm solid core wire, capacitor, one TO-220 heat sink, one outlet
one 3.5 mm mono headphone jack chassis, cord with connector plugs, one ¼-Watt 220
one 3.5 mm stereo headphone jack chassis, Ω resistor, one 5 pF ceramic capacitor, two
four pairs 1 in. nuts and bolts, one television 10 nF ceramic capacitors, one 100 μF 50V
bunny ears antenna female plug connector, rated capacitor and five 10 pF capacitors.
one bunny ears antenna, one male antenna You may refer to Appendix D for the
connector without filtering transformer, one costing of these gathered materials. You
¼-Watt 100 Ω resistor, two 1 nF ceramic may refer to Appendix A for the flowchart
capacitors, four BC548 transistors, nine ¼- of methodology for the preparation of
circuits. The parts in the system were the strategically placed in an Alexan H-823
encoder-transmitter circuit, the receiver- black plastic enclosure. The enclosure was
decoder circuit and the encoder-transmitter drilled with holes for LED indicators, push
power supply. PCB layouts for each circuit button switches, toggle switches, female
were designed and etched according to their banana jacks and auxiliary connectors for
proper schematic diagrams. user interface and monitoring. 1.5mm solid
core wire was used as connectors for the
Encoder – transmitter construction circuits. All connections from one circuit to
another in the encoder-transmitter were
You may refer to Appendix A for the based on the schematic diagram. All of the
construction of the system in the flow of parts of the encoder-transmitter power
methodology. The encoder-transmitter was supply were strategically placed inside a
composed of the Gizduino microcontroller black aluminum computer automatic voltage
platform, Dual Tone Multi Frequency regulator enclosure. The encoder-transmitter
(DTMF) encoder circuit and the 4-Watt external power supply output and ground
frequency modulation (FM) radio terminals were extended via wires and male
transmitter. The Gizduino microcontroller banana jacks.
platform was already prefabricated and it
only needed power and digital interface Receiver – decoder construction
connections to be inserted. The DTMF PCB
was designed and etched properly. Its You may refer to Appendix A for the
components were then soldered according to construction of the system in the flow of
the schematic diagram and its proper PCB methodology. The receiver-decoder was
layout referred in Appendix C figures C2, composed of a +5VDC power supply, mini
C6 and C7. The 4-Watt FM transmitter FM radio receiver, DTMF decoder circuit
circuit’s components were soldered and relay switchboard. The +5VDC power
according to the schematic diagram by supply’s components were connected and
Kyriakos Kontakos and the PCB layout of soldered according to the schematic diagram
Silver respectively referred in Appendix C and its PCB layout. It was designed to have
figures C3 and C4 (Kontakos and Silver, over current, over voltage and overheating
2007). The encoder-transmitter power protection (National Semiconductor, 2004).
supply’s components were soldered and The mini FM radio receiver was a small
connected according to the schematic AA-battery operated analog FM receiver.
diagram and its PCB layout. It supplies a Instead of using batteries, its power came
+12.6VDC and a +5VDC regulated power from the receiver-decoder’s +5VDC rail.
supply for the FM transmitter and other The DTMF decoder is made up of a DTMF
circuits in the encoder-transmitter tone to 4-bit hexadecimal converter and a
respectively. It can deliver 750 mA of latching circuit. The DTMF tone to 4-Bit
current and was designed to have over hexadecimal converter used was the
current, over voltage and overheating MC145436P (Motorola, 1994). The 4013 D-
protection (National Semiconductor, 2004). flip flop IC was used as a memory for the
Refer to Appendix C Figures C2, C8 and C9 latching circuit attached to the relay
for the schematic diagram, PCB parts layout switchboard composed of four 250V 5A
and copper side PCB layout for the power relays soldered on a strip of PCB (Johnson,
supply circuit respectively. Placement of the 2012). Refer to Appendix C Figures C2,
encoder-transmitter circuits were C10 and C11 for the schematic diagram,
PCB parts layout and copper side PCB range capability and its automatic switching
layout for the decoder circuit respectively. range capability in various distances. The
The receiver-decoder circuits were ratio of successful attempts to total attempts
strategically placed inside an Alexan HC – was recorded in each test.
881 black plastic enclosure. Holes were
drilled for parts that need to be attached to The manual switching range test determined
the enclosure such as the binding posts, LED the system’s capability to turn on or off
indicators, fuse holder, antenna, 3.5mm different relay combinations manually at
female jack and the AC power cord. The various distances. The initial distance was 5
mini FM radio receiver output is directly meters and was increased in 10 meter
connected to the DTMF decoder and to a increments. The testing distances were 5
3.5mm female audio jack mounted on the meters, 15 meters, 25 meters, 35 meters, 45
enclosure. Fine tuning of the FM radio meters, 55 meters and 65 meters. The testing
receiver to 108.1MHz was done by listening of the system was done given that the
to the DTMF tone transmitted by the encoder-transmitter and receiver-decoder
encoder-transmitter via speakers connected were in line of sight with each other. The
to the 3.5mm audio jack. Each relay’s DC testing was accomplished after testing the
side on the switchboard was connected to system at 65 meters because at this distance,
the DTMF decoder while its AC sides are the encoder-transmitter and receiver-decoder
connected to the binding posts attached on were completely out of communication
the enclosure. LEDs acting as indicators range. The manual switching range test was
were installed for each relay switch to light conducted using 15 combinations of
up when that relay switch is turned on different relay switches. Switch
(Betop Electronics, 2012). identifications were made which identified
each relay switch as ‘1’, ‘2’, ‘4’ and ‘8’. The
Microcontroller setup different combinations of relay switches that
were tested were the following: switch 8
The Gizduino microcontroller platform was only, switch 4 only, switches 8 and 4, switch
programmed using the Arduino’s integrated 2 only, switches 2 and 8, switches 2 and 4,
development environment (IDE). The switches 2, 4 and 8, switch 1 only, switches
program was designed only for automated 1 and 8, switches 1 and 4, switches 1, 4 and
relay switching purposes using a dedicated 8, switches 1 and 2, switches 1, 2 and 8,
version of the C and C++ programming switches 1, 2 and 4, and switches 1, 2, 4 and
languages for Arduino microcontroller 8. There will be a total of 15 switching
platform programming. The program attempts per combination. The receiver-
designed was to accept time values from the decoder had a LED installed to each relay
user to automatically turn on or off a relay switch in identifying the state of that relay,
switch (Arduino, 2012). Refer to Appendix whether it was turned on or off. The ratio of
C table C1 for the program code. successful attempts to the total attempts was
recorded on each combination.
Testing of the system
The automatic switching range test
The Wireless Programmable Relay Switches determined the system’s capability to
was tested in the Philippine Science High execute the program for automated
School Southern Mindanao Campus. The switching. The distances that were tested for
system was tested for its manual switching automatic switching test were the same with
the manual switching range test. The tested manually at varying distances until 65
distances for this test were 5 meters, 15 meters. The ratio of the number of
meters, 25 meters, 35 meters, 45 meters, 55 successful attempts to the total number of
meters and 65 meters. The automatic attempts was recorded per combination.
switching range test was done given that the These ratios of all combinations were
encoder-transmitter and receiver-decoder averaged in each distance.
were in line of sight with each other. The
pre-programmed data for the automation In the automatic switching range test, the
program had a set of time value of 16 result determined the capability of the
seconds for switches 1, 2 and 4 to turn on system to turn on and off the relay switches
and another 4 seconds before switch 8 could automatically at varying ranges until 65
turn on. This will be considered as one meters using a program with pre-
switching attempt. After all the switches programmed values embedded into the
were turned on, the program turned off these microcontroller. The ratio of the number of
switches after 20 seconds. This was also successful attempts to the number of total
considered as one switching attempt. There attempts will be recorded per range.
were a total of 15 switching attempts for
each distance. The ratio of successful to total For price comparison, a data of the prices of
attempts was recorded. the different commercially available
automation system was gathered and it will
The temperature on the encoder-transmitter be in US Dollar value as of December 2012.
and receiver-decoder’s immediate These prices were compared to the total
surrounding environment was recorded. price of constructing the Wireless
Temperature can affect the atmosphere’s Programmable Relay Switches and
index of refraction for radio waves (Graham determine whether the prices are significant
Brock Inc., 2009). The temperature in the or not.
atmosphere can affect the radio
communication of the system. Temperatures Results and Discussion
of the components were recorded on each
distance. Table 1. Manual switching range test.

Gathering of data Switch Distance (meters)


identification
There were two tests conducted to determine combination 5 15 25 35 45 55 65
the range and the ratio of success to total 1 15/15 15/15 15/15 15/15 15/15 0/15 0/15
Successful attempts to total attempts ratio

attempts. These tests were the manual 2 15/15 15/15 15/15 15/15 14/15 0/15 0/15
switching range test and the automatic 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
switching range test. The latter determined 1,2 15/15 15/15 15/15 15/15 14/15 0/15 0/15
the temperature of the immediate 1,4 15/15 15/15 15/15 15/15 14/15 0/15 0/15
surrounding environment of the components 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
which can affect the wave propagation 2,8 15/15 15/15 15/15 15/15 13/15 0/15 0/15
during testing (Graham Brock Inc., 2009). 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
In the manual switching range test, the result 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
determined the capability of the system to 2,4,8 15/15 15/15 15/15 15/15 15/15 0/15 0/15
turn on and off different relay combinations 1,2,4,8 15/15 15/15 15/15 15/15 13/15 0/15 0/15
Average ratio
on each 15/15 15/15 15/15 15/15 14/15 0/15 0/15
distance
Table 2. Surrounding temperature measured
Automatic Program the
on each distance. microcontroller
Distance (meters) 1.) Choose the
Component mode of
5 15 25 35 45 55 65 OR
Encoder- switching
Transmitter’s
surrounding 26.0 27.4 27.0 27.0 28.8 26.0 29.0 Press the push
temperature Manual
button switches
(°C)
Receiver- 2.) DTMF
Decoder’s encoder produces 3.) DTMF Wireless
surrounding 28.5 29.5 28.0 27.0 28.2 28.0 25.1 analog signals of signals are
temperature
specific DTMF broadcasted
(°C)
tone depending using FM
on the input transmission. Wireless
keypad codes.

Table 3. Automatic switching range test. 5.) Relay switches are


turned on or turned off 4.) DTMF signals are
Distance (meters) and the connected received by the mini
loads will also be FM receiver, decoded
5 15 25 35 45 55 65 turned on or turned by the DTMF decoder.
Successful off.
attempts to total 15/15 15/15 15/15 15/15 15/15 0/15 0/15
attempts ratio Figure 2. A step-by-step diagram of the
mechanism of the system.

To use manual switching, a toggle switch is


Table 4. Commercial and proponents’ activated to turn off the automated control of
prices. the Gizduino microcontroller platform. The
Commercially available The proponents’ activation of DTMF tones now rests on the
systems’ price system’s price push button switches attached on the
2500 USD 90.87 USD 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
Figure 1. The wireless programmable relay electronic parts store. The latching circuit
switches system. was mainly composed on the 4013 dual D
flip flop IC which provides latching
functions for the relay switches when a B. Catapang and Mrs. Ritza B. Catapang,
signal from the DTMF tone converter is Mr. Mario Barcelona and Mrs. Yolanda
detected. The automatic switching mode Barcelona, and Mr. Dominador R. Pacabis
should be turned on if the manual override and Mrs. Concepcion G. Pacabis, their
toggle switch is deactivated. The parents, for the moral and financial supports
microcontroller will execute the program they have given. Ms. Sharon Dejarme, Mr.
embedded to it. The system’s Bernard Beduya, Mr. Michael Casas, Engr.
microcontroller was programmed using C Michael Nalitan, Engr. Cromwell Castillo,
and C++ programming. The made Mr. Trextan Sanchez and Engr. Nelson
program’s purpose is to collect and execute Enano, Jr., their mentors in the field of
the user’s time value set for specific relay computer science, research and electronics.
switches to turn on or off. The They have provided time and taught them
microcontroller will momentarily activate on enough information to aid in the
a set of DTMF tones on the DTMF encoder construction of the system. Likewise, to
which will then be transmitted by the 4-watt their friends, classmates, and research mates
FM transmitter at a frequency of 108.1 who provided them companionship and
MHz. The signals will then be received by shared their experiences and advices during
the mini FM receiver tuned at a frequency of hard and easy times. Above all, to Almighty
108.1 MHz. These signals are then decoded God for giving them the grace to make all
by the DTMF decoder, which is directly these things possible. The success of their
connected to the relay switches. The relay research study and their other successes are
switches will turn on or off depending on the all for His greater glory.
DTMF tone being decoded by the DTMF
decoder. References

The encoder-transmitter controls the Arduino. (2012). “Why Arduino?”.


receiver-decoder wirelessly by broadcasting Retrieved on October 8, 2012 from
DTMF signals to the receiver-decoder using http://arduino.cc/en/Guide/Introduction
FM transmitter and the receiver-decoder will
receive and decode the signals then turn on Betop Electronics. (2009). “Application of
or turn off the specific relay switches that LEDs”. Retrieved January 1, 2012, from
correspond to the received and analysed http://www.betop- led.com/
DTMF signal. en_LED_knowledge.asp?id=32

Acknowledgements Bluejay, M. (2011). “Saving Electricity”.


Retrieved on July 20, 2011 from
The proponents of this research study would http://michaelbluejay.com/electricity/
like to express their sincere gratitude to the
people who made this research study Graham Brock Inc. (2009). “Weather-related
possible. Ms. Carolyn Mae Z. Villanaba and Interference”. Retrieved on January 12,
Ms. Jovie M. Narciso, their research 2013 from http://www.grahambrock.com
advisers, for effectively guiding them in /downloads/INVERSIONS.pdf
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
Hewes, J. (2011). “Relays”. Retrieved July Appendices
19, 2012 fromhttp://www.kpsec.
freeuk.com/components/relay.htm Appendix A
FLOWCHART OF METHODOLOGY
Johnson, D. et al. (2012). “Pushbutton
Oneshot and Latch”. Retrieved on Gathering of Materials
October 7, 2012 from
http://www.discovercircuits.com/DJ-
Circuits/4013oneshots.htm Preparation of Circuits

Kontakos, K. and Silver (2007). “4W FM


Transmitter”. Retrieved on May 27, 2012 Construction of the System
from http://www.free-
electronic-circuits.com/circuits/4w-fm-
transmitter.html
Testing of the System
Motorola. (1994). “Dual Tone Multiple
Frequency Receiver”. Retrieved on
October 7, 2012 from Gathering of System
http://www.datasheetcatalog.org/
datasheet/motorola/MC145436P.pdf
Appendix B
National Semiconductor. (2004). MECHANISM OF THE SYSTEM
“LM117/LM317T, LM317 3-Terminal User selects relay switches to turn on/off
Adjustable Regulator”. Retrieved on on the transmitter-encoder.
October 8, 2012 from
http://pdf1.alldatasheet.com/datasheet-
pdf/view/8619/NSC/LM317.html
The DTMF encoder is
Schueler, J (2011). “Are Energy Vampires activated and sends out
Sucking you dry?”. Retrieved on DTMF signals to the 4-Watt
November 13, 2012 from FM transmitter
http://energy.gov/articles/are-energy-
vampires-sucking-you-dry
The DTMF signal will be
Scott, B. (2011). “What Are the Different broadcasted over the air
Types of Electrical Switches?”. Retrieved
on July 20, 2011 from
http://www.wisegeek.com/what-are-the-
different-types-of-electrical-switches.htm
The receiver-decoder will
Smarthome. (2012). “What is Home receive and decode the
Automation?”. Retrieved on October 7, signal
2012 from http://www.smarthome.com/
homeautomation.html
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 C3. Kontakos, K. (2007).


4-Watt FM transmitter schematic diagram.
Retrieved from http://www.free-electronic-
circuits.com/circuits/4w-fm-transmitter.html
Figure C1. Conceptual diagram of wireless
programmable relay switches (WPRS).

Figure C4. Silver. (2007).


4-Watt FM transmitter PCB layout.
Retrieved from http://www.free-electronic-
circuits.com/circuits/4w-fm-transmitter.html

Figure C2. Schematic diagram of wireless


programmable relay switches.
Figure C5. Johnson, D. et al. (2012).
4013 latching circuit. Retrieved from
http://www.discovercircuits.com/
DJ-Circuits/4013oneshots.htm

Figure C7. Parts Layout of the DTMF


encoder PCB.

Figure C6. Copper side of the DTMF


encoder printed circuit board (PCB).

Figure C8. Copper side of the DTMF


encoder power supply PCB.
Figure C11. Parts layout of the DTMF
Figure C9. Parts layout of the DTMF decoder PCB.
encoder power supply PCB.

Figure C12. Copper side of the receiver-


decoder power supply PCB.

Figure C13. Parts layout of the receiver-


decoder power supply PCB.
Figure C10. Copper side of the DMTF
decoder PCB.
Figure C14. Wiring diagram of the front
view and back view of the encoder-
transmitter.

Figure C16. Wiring diagram of front view


and back view of encoder-transmitter
external power supply.

Figure C15. Wiring diagram of front view Figure C17. Receiver-decoder in operation.
and back view of receiver-decoder.
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


Figure C18. Encoder-transmitter in only set the number of seconds for a switch
operation. 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
Figure C19. Device efficiency equation. program might cause an unwanted and
inaccurate execution of a program. For
example, a user should set 16 seconds time
Table C1. Program for the Gizduino instead of 15. The program is not intended
microcontroller platform. for other numerical numbers for accuracy,
and the microcontroller will have a difficult
/* This is a program for the Wireless time handling decimal values of time one it's
Programmable Relay Switches System, not divisible by 4.
specifically for the encoder and transmitting
end. This program is used to set the time it This program has permalatch functions.
takes for a specific switch to turn on or off This means that a user can not only set the
automatically, by executing this program. time to turn on or off switches, but also the
user can set the time for a switch to turn on
There are only 4 switches that can be permanently after a period of time. This can
turned on or off. The switch ID's will be set also be applied when turning off switches.
as 1, 2, 4 and 8 for convention. This The user can set the time it takes for a
program will let the user set the switches to switch, usually in ON state, to turn off. A
be activated or deactivated. The program user cannot turn on both automated function
will also let the user choose the values of and permalatch function in once switch.
time when a specific switch or a group of Unwanted program executions might occur.
switches should turn on or off and the
program lets the user choose the option for Rules (format of switch variable):
delayed permanent power on or delayed
permanent power off. There are variables in <variable><switch ID number>=<value>;
the program that the user can set. The
maximum time that a user can set is 18 For example, input4=36;
hours and 35 minutes. This means that a
switch or group of switches can only stay on The variable input is the switch number 4
its programmed state for 18 hours and 35 with a value of 36.
*/ // Only number values divisible by 4 are
allowed. If permalatch function is not used,
// MAXIMUM: 18.0 hours and 35 minutes in both input and off variables must have
either off or on mode. Delay time max is number values divisible by 4.
67100000.
float input = 16;
float timechecb = 67100000;
float timechecc = 86400000; // AUTOMATED: desired time of on state
(in seconds). PERMALATCH: if permalatch
// ATTENTION! NOT RECOMMENDED function is enabled, the value will indicate
FOR USER INTERFACE BELOW!!! the time it will lapse until the device turns
on permanently, and in order for this to
float timecheck; function, the variable 'off' value must be 0.
float time = 0;
float period = 4; float off = 20;

// seconds it will take 1 cycle of the switch // AUTOMATED: desired time of off state.
scanning to complete. Longer period creates (in seconds). PERMALATCH: if permalatch
a higher change of success switching while function is enabled, this will indicate the
it increases time delays. Shorter periods will time of the switch to stay in on state before it
likely decrease unsuccessful switching. permanently switches off, and in order for
this to function, the variable 'input' value
float mechperiod = period * 1000; must be 0.

int selector = 0;

// Cycle time for each switch. // PERMALATCH ENABLER: enables the


PERMALATCH FUNCTION IF VALUE =
float delaytime =mechperiod/4; '1'. If selector value = '0' (PERMALATCH
DISABLED), offdelay variables must be in
// Delay time for the device to turn on the '0' value for safety of not using permalatch
DTMF generator. function.

int delayman=period*100; int offdelay = 0;


float delaytimer=100;
// PERMALATCH VERIFIER: if value = '1'
// Time for delay must be divisible by 4 in and selector = '1', will enable the
order to be accurate in timing. permatlatch function. Turning on this
function also requires to make the value of
// ATTENTION! NOT RECOMMENDED replaycheck = '0'
FOR USER INTERFACE ABOVE!!!
int replaycheck =0;
// ATTENTION!! USER'S ZONE FOR
SETTING THE TIME BELOW! // 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 int vv;
be ='0' too. int i=0;
int hh = 0;
float input2 = 16;
float off2 = 20; int oo;
int selector2 = 0; int m=0;
int zz = 0;
int offdelay2 = 0;
int replaycheck2 =0; int uno = 0;
int dos = 0;
float input4 = 16; int quatro = 0;
float off4 = 20; int otso = 0;
int selector4 = 0;
float delaytotal;
int offdelay4 = 0; int tau=1;
int replaycheck4 =0;
int autorunled = 7;
float input8 = 20;
float off8 = 16; int programpin = 8;
int selector8 = 0; int ledoutpin = 13;
int restart = 6;
int offdelay8 = 0;
int replaycheck8 =0;
// WARNING: NOT FOR USER void setup() {
SELECTION BELOW!!!!!
pinMode(autorunled,OUTPUT);
float x= input; pinMode(12,OUTPUT);
float y= off; pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
float z= input2; pinMode(9,OUTPUT);
float r= off2;
pinMode(2,OUTPUT);
float b= input4; pinMode(3,OUTPUT);
float k= off4; pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
float o= input8;
float p= off8; pinMode(programpin,INPUT);
pinMode(ledoutpin,OUTPUT);
int gg;
int n=0; pinMode(restart,INPUT);
int qq = 0; Serial.begin(9600);
Serial.println("SYSTEM START");
int ee;
int t=0; }
int uu = 0;
void loop() { Serial.println("LED 9 ON");
digitalWrite(9,LOW);
if(digitalRead(ledoutpin)==HIGH){ delay(100);
digitalWrite(ledoutpin,LOW);
digitalWrite(autorunled,HIGH); }
} if(selector==1){
replaycheck=1;
if(analogRead(A0)<=853){ }
digitalWrite(0,HIGH);
} x=y;
else{ uno =1;
digitalWrite(0,LOW); Serial.println("8 ON");
} qq++;
if(analogRead(A0)<=1023 && if (qq>1){
analogRead(A0)>=1000 && x=input;
digitalRead(3)==HIGH){ qq=0;
digitalWrite(1,HIGH); uno = 0;
} Serial.println("8 OFF. FINAL
else{ DATA OUTPUT. IGNORE FORMER
digitalWrite(1,LOW); OUTPUT");
} }
}

n=0; if(gg==1){
t=0;
i=0; n = delaytime+100;
m=0; }
}
timecheck = time=time+period; else if (replaycheck==1){
digitalWrite(autorunled,HIGH); if(x>0 && offdelay==1){
x=x-period;
// SWITCH 8 if(x==0){
gg=1;
if(replaycheck==0){ digitalWrite(9, HIGH);
if(x>0){ delay(delaytime);
gg=0; Serial.println("LED 9 ON");
x=x-period; digitalWrite(9,LOW);
} delay(100);
if(uno==1){
if(x==0){ uno=0;
gg=1; Serial.println("8 OFF");
if(replaycheck!=1){ }
else{
digitalWrite(9, HIGH); uno=1;
delay(delaytime); Serial.println("8 ON");
}
}
if(gg==1){ if(ee==1){
n=delaytime+100;
} t = delaytime+100;
} }
} }
} else if (replaycheck2==1){
if(z>0 && offdelay2==1){
z=z-period;
if(z==0){
ee=1;
// SWITCH 4 digitalWrite(10, HIGH);
delay(delaytime);
if(replaycheck2==0){ Serial.println("LED 10 ON");
digitalWrite(10,LOW);
if(z>0){ delay(100);
ee=0; if(dos==1){
z=z-period; dos=0;
} Serial.println("4 OFF");
}
if(z==0){ else{
ee=1; dos=1;
if(replaycheck2!=1){ Serial.println("4 ON");
digitalWrite(10, HIGH);
delay(delaytime); }
Serial.println("LED 10 ON"); if(ee==1){
digitalWrite(10,LOW); t=delaytime+100;
delay(100); }
} }
if(selector2==1){ }
replaycheck2=1; }
}
// SWITCH 2
z=r;
dos = 1; if(replaycheck4==0){
Serial.println("4 ON"); if(b>0){
uu++; vv=0;
if (uu>1){ b=b-period;
z=input2; }
uu=0;
dos = 0; if(b==0){
Serial.println("4 OFF. FINAL vv=1;
DATA OUTPUT. IGNORE FORMER if(replaycheck4!=1){
OUTPUT");
} digitalWrite(11, HIGH);
delay(delaytime); i=delaytime+100;
Serial.println("LED 11 ON"); }
digitalWrite(11,LOW); }
delay(100); }
} }
if(selector4==1){
replaycheck4=1; // SWITCH 1
}
if(replaycheck8==0){
b=k;
hh++; if(o>0){
quatro = 1; oo=0;
Serial.println("2 ON"); o=o-period;
if (hh>1){ }
b=input4; if(o==0){
hh=0; oo=1;
quatro = 0; if(replaycheck8!=1){
Serial.println("2 OFF. FINAL digitalWrite(12, HIGH);
DATA OUTPUT. IGNORE FORMER delay(delaytime);
OUTPUT"); Serial.println("LED 12 ON");
} digitalWrite(12,LOW);
delay(100);
} }
if(vv==1){ if(selector8==1){
i = delaytime+100; replaycheck8=1;
} }
} o=p;
else if (replaycheck4==1){ zz++;
if(b>0 && offdelay4==1){ otso = 1;
b=b-period; Serial.println("1 ON");
if(b==0){ if (zz>1){
vv=1; o=input8;
digitalWrite(11, HIGH); zz=0;
delay(delaytime); otso = 0;
Serial.println("LED 11 ON"); Serial.println("1 OFF. FINAL
digitalWrite(11,LOW); DATA OUTPUT. IGNORE FORMER
delay(100); OUTPUT");
if(quatro==1){ }
quatro=0;
Serial.println("2 OFF"); }
} if(oo==1){
else{
quatro=1; m = delaytime+100;
Serial.println("2 ON"); }
} }
if(vv==1){ else if (replaycheck8==1){
if(o>0 && offdelay8==1){ if(uno==0){
o=o-period; digitalWrite(2, LOW);
if(o==0){ }
oo=1; else{
digitalWrite(12, HIGH); digitalWrite(2, HIGH);
delay(delaytime); }
Serial.println("LED 12 ON");
digitalWrite(12,LOW); // PRELIMINARY
delay(100);
if(otso==1){ delaytotal = n+t+i+m;
otso=0; delay(mechperiod+delayman-
Serial.println("1 OFF"); delaytotal);
} time=timecheck;
else{ Serial.print("seconds have passed
otso=1; since start: ");
Serial.println("1 ON"); Serial.println(timecheck);
}
if(oo==1){ Serial.print("value of switch 1: ");
m=delaytime+100; Serial.println(x);
}
} Serial.print("value of switch 2: ");
} Serial.println(z);
}
Serial.print("value of switch 4: ");
Serial.println(b);
if(otso==0){
digitalWrite(5, LOW); Serial.print("value of switch 8: ");
} Serial.println(o);
else{
digitalWrite(5, HIGH); Serial.println("CYCLE
} COMPLETE");

if(quatro==0){ if(digitalRead(restart) == 1 ||
digitalWrite(4, LOW); digitalRead(programpin) == 1){
} if(uno==1){
else{
digitalWrite(4, HIGH); digitalWrite(12, HIGH);
} delay(delaytime);
Serial.println("LED 12 ON");
if(dos==0){ digitalWrite(12,LOW);
digitalWrite(3, LOW); delay(100);
} uno=0;
else{ Serial.println("SHUTDOWN: 8
digitalWrite(3, HIGH); OFF");
}
}
timecheck = 0;
if(dos==1){ time = 0;
digitalWrite(11, HIGH);
delay(delaytime); qq = 0;
Serial.println("LED 11 ON");
digitalWrite(11,LOW); uu = 0;
delay(100);
dos=0; hh = 0;
Serial.println("SHUTDOWN: 4
OFF"); zz = 0;

} digitalWrite(ledoutpin,HIGH);
digitalWrite(autorunled,LOW);
if(quatro==1){
digitalWrite(10, HIGH); delay(400);
delay(delaytime); }
Serial.println("LED 10 ON");
digitalWrite(10,LOW); if(digitalRead(programpin)==HIGH){
delay(100); if(uno==1){
quatro=0;
Serial.println("SHUTDOWN: 2 digitalWrite(12, HIGH);
OFF"); delay(delaytime);
} Serial.println("LED 12 ON");
digitalWrite(12,LOW);
if(otso==1){ delay(100);
digitalWrite(9, HIGH); uno=0;
delay(delaytime); Serial.println("SHUTDOWN: 8
Serial.println("LED 9 ON"); OFF");
digitalWrite(9,LOW); }
delay(100);
otso=0; if(dos==1){
Serial.println("SHUTDOWN: 1 digitalWrite(11, HIGH);
OFF"); delay(delaytime);
Serial.println("LED 11 ON");
} digitalWrite(11,LOW);
delay(100);
x=input; dos=0;
z=input2; Serial.println("SHUTDOWN: 4
b=input4; OFF");
o=input8; }

y=off; if(quatro==1){
r=off2; digitalWrite(10, HIGH);
k=off4; delay(delaytime);
p=off8; Serial.println("LED 10 ON");
digitalWrite(10,LOW);
delay(100); else{
quatro=0; digitalWrite(4, HIGH);
Serial.println("SHUTDOWN: 2 }
OFF");
}
if(otso==1){ if(dos==0){
digitalWrite(9, HIGH); digitalWrite(3, LOW);
delay(delaytime); }
Serial.println("LED 9 ON"); else{
digitalWrite(9,LOW); digitalWrite(3, HIGH);
delay(100); }
otso=0;
Serial.println("SHUTDOWN: 1
OFF"); if(uno==0){
} digitalWrite(2, LOW);
x=input; }
z=input2; else{
b=input4; digitalWrite(2, HIGH);
o=input8; }
while(tau>0){
y=off; tau=tau+1;
r=off2; digitalWrite(ledoutpin,HIGH);
k=off4; delay(60);
p=off8; digitalWrite(ledoutpin,LOW);
timecheck = 0; delay(60);
time = 0; Serial.println("STOP LOOP FOR
PROGRAMMING. Restart if needed.");
qq = 0; digitalWrite(autorunled,LOW);
if(digitalRead(restart) == 1){
uu = 0;
break;
hh = 0; digitalWrite(ledoutpin,HIGH);
digitalWrite(autorunled,LOW);
zz = 0;

if(otso==0){ }
digitalWrite(5, LOW); }
} }
else{ }
digitalWrite(5, HIGH);
}

if(quatro==0){
digitalWrite(4, LOW);
}
Appendix D ¼ Watt 8.2K 0.30 1.20
BUDGET FOR WIRELESS 4
Ohms resistor PHP PHP
PROGRAMMABLE RELAY SWITCHES
(WPRS) ½ Watt 1M 1.00 1.00
1
Ohms resistor PHP PHP
Table D1. Proposed Expenses in Wireless
Programmable Relay Switches 1 inch nuts 1.00 4.00
4
and bolts PHP PHP
Quantit Total
Component Price
y Cost 1 micro
Farads 16V 1.00 1.00
0.1 micro 1
rated PHP PHP
Farads 1.00 5.00 capacitors
5
ceramic PHP PHP
capacitor 1 nano Farads
0.30 0.60
ceramic 2
¼ Watt 100 0.30 0.30 PHP PHP
1 capacitors
Ohms resistor PHP PHP
1.5
¼ Watt 100K millimeters 5.00 60.00
0.30 1.20 12
Ohms 4 solid core PHP PHP
PHP PHP
resistors wire
¼ Watt 10K 1/8 inch nuts 1.00 18.00
0.30 5.40 18
Ohms 18 and bolts PHP PHP
PHP PHP
resistors
10 micro
¼ Watt 150 0.30 1.80 Farads 50V 3.00 3.00
6 1
Ohms resistor PHP PHP rated PHP PHP
¼ Watt 1K 0.30 0.30 capacitor
1
Ohms resistor PHP PHP 10 pico
0.30 0.30
¼ Watt 1M 0.30 0.30 Farads 1
1 PHP PHP
Ohms resistor PHP PHP capacitor

¼ Watt 220 0.30 0.30 100 micro


1 Farads 50 1.50 1.50
Ohms resistor PHP PHP 1
Volts rated PHP PHP
¼ Watt 2K 0.30 0.30 capacitor
1
Ohms resistor PHP PHP

¼ watt 47 0.30 0.30


1
Ohms resistor PHP PHP
100 nano 1.00 2 2.00
Farads PHP PHP
ceramic 28 Volts 12 78.00 1 78.00
Amperes PHP PHP
capacitor
Direct
14-pin Current
integrated 3.00 6.00 Double Pole
2
circuit (IC) PHP PHP Double
socket Throw Relay

16-pin 35.00 70.00P


2N2219 2
integrated 3.00 3.00 PHP HP
1
circuit (IC) PHP PHP
socket 3.5mm mono
8.00 16.00
headphone 2
PHP PHP
1. 00 1.00 jack chassis
1N4002 1
PHP PHP
3.5mm stereo
16.00 16.00
1.00 12.00 headphone 1
1N4007 12 PHP PHP
PHP PHP jack chassis

22 micro 3-18 pico


Farads 50 V 1.50 1.50 Farads 18.00 54.00
1 3
rated PHP PHP variable PHP PHP
capacitor capacitors

2200 micro 4 inches x 6


Farads 16 inches
16.00 16.00 135.00 270.00
Volts rated 1 presensitized 2
PHP PHP PHP PHP
electrolytic printed circuit
capacitor board (PCB),

250 Volts 1 4.7 micro


Ampere fuses 15.00 30.00 Farads 50
2 1.00 1.00
with fuse PHP PHP Volts rated 1
PHP PHP
holders electrolytic
capacitor
4700 micro 36.00 3 108.00 BC548 4.50 8 36.00
Farads PHP PHP transistors PHP PHP
electrolytic
50 Volts rated 18.00 36.00
CD4013 2
capacitors PHP PHP

5 pico Farads Gizduino


0.30 0.30 1000.0 1000.0
ceramic 1 microcontroll 1
PHP PHP 0 PHP 0 PHP
capacitor er platform

500 milli green light


2.00 6.00
Amperes 9-0- emitting 3
105.00 105.00 PHP PHP
9 Volts 1 diodes (LED)
PHP PHP
potential high grade
transformer plastic
170.00 170.00
6-Volt single enclosure 1
PHP PHP
pole double 20.00 80.00 Alexan HC-
4 881
throw (SPDT) PHP PHP
relays latching push
16.00 32.00
750 milli button 2
PHP PHP
Amperes 15- switches
150.00 150.00
0-15 Volts 1 17.00 17.00
PHP PHP LM317 1
potential PHP PHP
transformer
18.00 36.00
8-pin dual in LM7805 2
8.00 8.00 PHP PHP
line (DIP) 1
PHP PHP
switch 260.00 260.00
MC145436P 1
PHP PHP
American
Wire Gauge mini portable 100.00 100.00
5.00 5.00 1
(AWG) 1 fm radio PHP PHP
PHP PHP
number 18
magnet wire normally
open
8.00 40.00
AWG number 1.50 1.50 momentary 5
1 PHP PHP
31 PHP PHP push button
switches
one 10 K 10.00 1 10.00 yellow light
2.00 8.00
trimmer PHP PHP emitting 4
PHP PHP
resistor diodes (LED)

outlet cords 3733.1


TOTAL
with 28.00 56.00 0 PHP
2
connector PHP PHP
plugs

Pair of case-
mount
16.00 64.00
binding or 4
PHP PHP
connecting
posts

plastic
enclosure 280.00 280.00
1
Alexan HC- PHP PHP
823

red light
2.00 14.00
emitting 7
PHP PHP
diodes(LED)

single pole
double throw 8.00 16.00
2
toggle PHP PHP
switches

Soldering 4.00 72.00


18
lead with flux PHP PHP

television
bunny ears 80.00 80.00
1
antenna plus PHP PHP
connector

TO-220 heat 20.00 60.00


3
sinks PHP PHP

200.00 200.00
W91212 1
PHP PHP

Potrebbero piacerti anche