Project Report 36 on Digital Appliances Timer | ECE 445, Study Guides, Projects, Research of Electrical and Electronics Engineering

Material Type: Project; Class: Senior Design Project Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Spring 2003;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/16/2009

koofers-user-v57
koofers-user-v57 🇺🇸

9 documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Digital Appliance Timer
By
Justin Elkow
Nick Klezek
Becky Westendorf
ECE 345, SENIOR DESIGN PROJECT
Spring 2003
TA: Purvesh Thakker
May 6, 2003
Project No. 36
ABSTRACT
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download Project Report 36 on Digital Appliances Timer | ECE 445 and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Digital Appliance Timer By Justin Elkow Nick Klezek Becky Westendorf ECE 345, SENIOR DESIGN PROJECT Spring 2003 TA: Purvesh Thakker May 6, 2003 Project No. 36 ABSTRACT

A digital appliance timer is a device that can be programmed to automatically power on and power off small appliances such as lamps, coffee makers, air conditioners, etc. Many of the current products on the market are unreliable and manufactured poorly. The goal of the project was to design a digital appliance timer with a user friendly interface that would synchronize with a WWVB atomic clock. This circuit was constructed using three separate components: a power supply, RF and infrared communication, and a programmable microprocessor with an easy to use keypad and readable LCD display. The digital timer allowed up to four different programmable timer settings as well as a motion sensor interrupt. The circuit could be supplied by a 9V battery in the instance of a power outage. In conjunction with theoretical applications, the circuit design was verified through standard lab equipment and testing procedures. TABLE OF CONTENTS iii

1. INTRODUCTION

An appliance timer is a device that automatically controls power to an appliance from an electrical socket. The timer turns appliances on and off according to the user’s specification. Such timers are often used with a lamp for security purposes in so that a light will be on in a home while the homeowner is out of town. Additional uses of these timers included programmed timing to turn outside lights on and off. Such timers are not limited to lamps but are also capable of powering small appliances such as coffee makers, small heaters, or air conditioning units to name a few. Currently, the electromechanical timers available on the market are unreliable with limited options. 1.1 Specifications The goal of this design project was to design and build a functional digital appliance timer that would allow the user to program up to four distinct time periods that the appliance should be powered throughout a time span of 24 hours. The additional benefits to the user were to incorporate an easy to read digital display, a battery backup to preserve preset settings, atomic clock synchronization, and memory features to allow the user to override the timer and then restore the settings. One additional feature that was added was the automatic powering of the lamp through the use of infrared sensors when the user entered the room. 1.2 Subprojects The digital appliance timer design was dissected into four separate areas to fulfill each specification above: the power supply; the microcontroller, keypad, and LCD display; the WWVB clock; and the infrared sensor. Figure 1 below illustrates the integration of each separate part with the respective blocks. Figure 1. Block Diagram of the Digital Appliance Timer The Power block supplied the entire circuit with a constant power supply from the wall outlet. However, in the event of a power outage, a battery backup supply was also incorporated within this block. Also, the output from the microcontroller was integrated into the design of this block to control the power to the appliance. The WWVB clock section was to maintain the steady clock pulse from the signal sent out from Colorado. This circuit would then provide a consistent clock pulse to the microcontroller. Microcontroller

LCD

Power (Output) Keypad (Input)

WWVB

Clock Infrared Sensor

The infrared sensor block served as the interrupted input into the microcontroller to automatically turn power the light. This block controlled the powering of the lamp in the event that a person was in the same room as the timer. The microcontroller served as the overall command center which processed the input programs from the user sent via the keypad while directing the user through the LCD display. The microcontroller required a code in the Future Basic language to control the inputs from the other blocks as well as the correct output to the power block. To maintain a functional digital appliance timer, design decisions and test were made and discussed below to lead to the overall creation of a device that functioned to the above specifications.

2.1.2 The Infrared Sensor Circuitry The infrared sensor had to detect when its beam was broken from the transmitter to receiver, this had to be done at the width of a door so that the timer could detect a person entering a room and respond. In deciding upon hardware components and sensing techniques the IS417F IC by Sharp was chosen shown in Figure 3. This IC was chosen because it provided a pulsed signal that drove the infrared LED and then internally checked to make sure that it was detecting the proper pulsed signal and therefore eliminating any interference with other infrared sources (lights, remote controls). This IC provided a nearly complete system for driving and detecting the infrared beam. Above is the simple schematic of the IC and its necessary connections. This circuit however provided detection only up to 18 inches, while the application required 40 inches. Therefore, in the design of the final circuit the current driving the infrared LED would have to be increased and additional Infrared LEDs would have to be used to give an operating distance of 40 inches. The integration of this circuit with the power system and microcontroller also played an important role in the decisions made for the design. The circuit was only allowed supply voltages of +15 V and +5V and the current needed to be kept as low as possible. The device also had to output a 0V signal (binary 0) or a 5V signal (binary 1). Therefore in the case of the IS417F the voltage supplied to it must be 5V in order that its output meets these requirements. 2.1.3 The WWVB Circuitry The WWVB circuitry was used to receive the time from the atomic clock and then output the time through a digital signal to the microprocessor. This data would be used to set the microprocessor real time clock to the exact time. Therefore, the WWVB circuit needed to have an antenna that was tuned to 60kHz in order to pick up the time signal. This needed to be followed by a receiver that had amplifying and demodulated circuitry. Finally, the demodulated time signal needed to be fed into a decoder that could store data and send decoded digital time information to the microcontroller at the microcontroller’s request. An initial lineup looked like the diagram in Figure 4. The parts that were chosen for this application were made by HKW Elektronik and were the EM2S MSF receiver module, the MSF Antenna, and the MCM-RS232 microcontroller module. These parts along with some supporting components and code provide the complete system the required application. 280 0.33uF IS417F 1 2 3 4 5 V 18 inches Sensor Vout

Figure 3: Simple IS417F circuit connections

60 kHz Antenna Low Noise Amplifier Demodulator Decoder Serial Data Out

Figure 4: Receiver Lineup for the WWVB circuit

2.1.4 Microcontroller Design Decisions The only major decision for the user interface was to choose a microcontroller. Although there were a few options, the BasicX-24 was suited to fit all the needs of the project. The BX-24 had two sets of eight I/O lines. This was more than enough to supply the signals to and from the microcontroller. In addition, the BX- supported a real time clock. The clock would be the backbone of the project. The BX-24 also had a compatible 2x16 Serial LCD Display which required minimal interfacing to the microcontroller. A development board was purchased to minimize external wire connections. As shown in Figure 5, it contained a serial port to download code to the BX-24. Figure 5. BX-24 Demo Board Features The development board simplified the project even further by eliminated the need for external push buttons. The four user buttons were routed to four I/O pins on the BX-24. The 2x16 Serial LCD Interface was also routed to the BX-24. However, a jumper was added from pin 1 to pin 5 on the development board. The BX-24 manual suggested using Com1 pin1 for the Serial LCD, but, as seen in Figure 6, the development board routed the receive pin on the LCD to pin 5 of the BX-24. Considering pin 5 was not in use, placing a jumper between pin 1 and pin 5 should not have affected the overall functionality of the project. Figure 6. BX-24 Development Board Schematics Once the BX-24 and Serial LCD Display were connected, the development board could be powered by a single

(Eq 3) In both Equation 2 and Equation 3, “VDD” represents the battery supply voltage, and “VDO” represents the voltage on the cathode side of the diode. Therefore, these equations represent the ideal case of the diode Typically, the voltage drop across a diode is 0.7V when in the active mode indicated in Equation 2. The final component values and simulations are discussed in detail in section 3.3.1. 2.2.2 The Infrared Sensor Circuitry The infrared circuitry required several key tools in order to properly design, build, and test the system. A necessary tool was an infrared light sensor. This was a small strip of infrared sensitive material that glowed orange in the presence of infrared light. This was very useful for seeing the direction, strength, and transmission of the infrared beam. A power supply was used to power the circuit during testing, a multimeter was used to verify voltages and resistances, and an oscilloscope was essential for view the pulsed signal and output. 2.2.3 The WWVB Circuitry The tools needed for this circuitry were an oscilloscope for view the output from both the antenna (demodulated signal) and the modulated signal. In addition a power supply was needed to power the circuit during testing. A workspace that was relatively free from any low frequency generating devices as well as metal was important given the signal strength and low frequency nature of the incoming signal. 2.2.4 Microcontroller The only tool necessary for this block was a personal computer loaded with Basic X 2.00 software. This software was designed as a development system for the BX-24 microcontroller. It contained an editor where code could be written, compiled, and downloaded to the BX-24. A serial cable was also needed to connect the development board to the personal computer. 3 DESIGN DETAILS Once the original designs were established, the actual parameters were calculated using the theoretical concepts applied from above. 3.1 Components 3.1.1 Power Supply Circuit Components

V V V

turn off ( DD DO ) 0. 7

_ :

R k

V

R k k V 36

1 1 The power supply circuit components were placed as in the general schematic before the simulation. Actual values of the resistors for to decrease the 24V supply from the AC/DC Converter to obtain a voltage level which the diode could use without drawing voltage from the battery supply was calculated by using both Equation 1 and Equation 3. First, a minimum output voltage to the cathode of the diode was determined using Equation 3. These calculations are shown as Equation 4. (Eq. 4) From this calculation, the voltage, VO, from the Voltage Divider Rule in Equation 1 needed to be greater than 8.3V. Therefore, the value of 12V was large enough to ensure that the diode would remain in the cutoff mode. The values of the resitors were then arbitrarily chosen and calcualted in Equation 5. (Eq. 5) The value of the capacitors that connect the input and output pins to ground on the 5V voltage regulator were given in the specification sheets on the device and to be included in the circuit to adequately stabilize the output to 5V. Figure 8 illustrates the Power Supply Circuit schematic used after calculation of the component values. Figure 8. Power Supply Circuit Schematic with component values 3.1.2 The Infrared Sensor Circuitry The infrared circuit needed to be modified significantly in order to provide enough power to the infrared LEDs to get the circuit to operate at 40 inches. Initially it was thought that an op amp could be used to give the appropriate gain for the circuit. In a difference configuration the op amp should have been able to provide the infrared LED with additional current. The op amp circuit diagram (Figure 9) and gain equations (Eq.6) are shown below. Vo = -(R2/R1)V1 + (1+R2/R1)/(1+R3/R4)V2 (Eq 6) For R2 = 500k Vo = -3.3V1 + 10.

V V

V V V

DO DO

  1. 3

3.1.3 The WWVB Circuitry The WWVB circuit was built from three major components. Additional components used existed to aid in testing and development of the device. The diagram below (Figure 13: on the left) shows the circuit properly connected and ready to interface with the microcontroller. This circuit is impossible to perform testing and verification on. Therefore a testing circuit was built and it is shown above on the right. The components used are there to give a +5V (binary 1) and a 0V (binary 0) signal at the output of the serial out lines. The diode is used for protection and the capacitor is used to give stability on the power supply. Figure 13: Interfacing and testing WWVB circuits 3.1.4 Microcontroller The major design of the block was writing the code. The timer would utilize all four user buttons. Button one was labeled “Select” which was used to scroll between menus and enter times when setting the clock or timer. Button two was labeled “Hour” which increased the hour when setting the clock or timer. This button also controlled if the time was AM or PM. Once the time gets to 12:00, it would toggle either AM or PM accordingly. Button three was labeled “MinuteTen” which added ten minutes to the time whenever it was pressed. It would not affect the hour setting, so once 60 minutes was reached, it would just reset back to zero without adding an hour. The final button was labeled “MinuteOne” which added one minute every time it was pressed. If the button was pressed ten times, it would reset back to zero without affecting the tens digit in the minutes. Upon start up, the digital appliance timer would request the user to set the current time. After inputting the time with the Hour, MinuteTen, and MinuteOne buttons, the user would press Select to finish setting the time. The timer would then display the current time until the timers were programmed. To program the timers, the Select Button needed to be pressed. The next menu would access the first of four programmable timers. The first timer can then be programmed with the user buttons to turn on. Once the Select Button was pressed again, the user could program the first timer to turn off at a given time. Pressing the Select Button again would access the second timer. If the first timer was not programmed and the Select Button was pressed, the second timer would be accessed directly without having to pass through the menu to turn the first timer off. This flow process can be seen in Figure 14. MSF Antenna EM2 MSF Receiver Module Gnd Pon Vss (Time)^ MSF MCM - RS Gnd Pon Vcc MSF Serial In Serial Out Switching Output MSF Antenna EM2 MSF Receiver Module 200uF 50k GND Serial Out Vcc Vcc Vcc Vss MSF

Figure 14. Code Flow Chart

4. DESIGN VERIFICATION After proper construction of each block, individual testing was necessary to guarantee overall cohesion of every subgroup of the digital timer. To support the proper functioning of the digital appliance timer, the tests and results recorded below were performed. 4.1 Testing 4.1.1 Power Supply Circuit Results After completion of construction of the power supply circuit, testing the actual output voltages originally proved the simulation results correct. When the wall output voltage was used as the ac supply voltage, the output out of the AC/DC converter measured 24.01V repeatedly. After the voltage divider, this voltage was then compared to the 9V battery supply and sent to the 5V voltage regulator. The output on the voltage regulator was a constant 5.01V tested using either the battery supply voltage or the voltage created from the 120Vac wall outlet. However, with continued power to the circuit, the value of the voltage divider continued to decrease from 11.89V to 3.89V, which was too low for the remaining circuit and caused the battery backup to supply the remaining circuit. This was possibly due to the large amount of power dissipated in the resistor at such a high voltage. To alleviate the loss of heat, smaller resistors valued at 100 were substituted in place of the 36k resistors. This produced a

Figure 15. Relay Coil Voltage with 0V applied to the npn transistor. The voltage across the coil is averaged at 0V with a ripple of approximately 0.01V. This does not affect the switching of the relay because the turn-on voltage of the relay is required to be 24Vdc. A 5Vdc voltage was then applied to the transistor, and the relay coil voltage was observed in Figure 16. Relay Coil Voltage (Closing the Switch) 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.40E+ 2.41E+ 2.41E+ -6.00E-07 -4.00E-07 -2.00E-07 0.00E+00 2.00E-07 4.00E-07 6.00E- Time (sec) Voltage (V) Series

Figure 16. Relay Coil Voltage with 5V applied to the npn transistor. As shown, the coil voltage when the relay should turn on is centered at 24Vdc with a variation of less than 0.1V. This ripple voltage is small enough to not create a difference due to the fact that coil requires a steep difference of voltage before the relay switch is turned off. As a result, when the 5V was supplied to the transistor, the relay closed the high current circuit and created an output voltage to the load (lamp) of 119.1Vac. The output to each of the surrounding circuits was also recorded when the power circuit was supplied from the wall outlet. Figure 17 illustrates the output to the microcontroller, which is centered at the value of 5.945V. This output also indicated approximately a 0.3V variation in either direction on average. These variations in voltages were minimal, and did not cause extreme fatigue to the microcontroller. Microcontroller Supply Voltage Using Wall Outlet 5.89E+ 5.90E+ 5.91E+ 5.92E+ 5.93E+ 5.94E+ 5.95E+ 5.96E+ 5.97E+ 5.98E+ 5.99E+ 6.00E+ -1.50E-08 -1.00E-08 -5.00E-09 0.00E+00 5.00E-09 1.00E-08 1.50E- Time (sec) V o lt a g e ( V ) Series Figure 17. Voltage Output to the Microcontroller The output to the RF circuitry was then observed to ensure that a fairly constant voltage of 3.5 V was being supplied to the circuit. Figure 18 illustrates the output and ripple in the voltage to be approximately 3.525V with a small variation of approximately +/-0.01V.

voltages on each output of the power supply, as well as the voltage on the battery, were recorded at 5 minute intervals for one hour. The data collected is listed in Table 2. Time (min) Battery Voltage (V) Microcontrolle r Supply Voltage (V)

RF

Circuit Supply Voltage (V) Infrared Circuit Supply Voltage (V) 0 8.2 5.82 3.025 5. 5 8.023 5.86 3.523 5. 10 7.864 5.64 3.525 5. 20 7.748 5.53 3.523 5. 25 7.603 5.39 3.525 5. 30 7.396 5.18 3.525 5. 35 7.314 5.11 3.525 5. 40 7.275 5.07 3.25 5. 45 7.182 4.98 3.515 4. 50 7.147 4.90 3.462 4. 55 7.102 4.90 3.462 4. 60 7.067 4.87 3.439 4. Table 2. Data from testing the lifetime of the battery backup supply. This data is best viewed in Figure 20 and Figure 21. Battery Life and Voltage Supply of Other Circuits 0 1 2 3 4 5 6 7 8 9 0 20 40 60 80 Time (min) Voltage (V) (^) Battery RF IR microcontroller Figure 20. Voltages at each point over a span of one hour

Battery Lifetime y = 0.0002x^2 - 0.0307x + 8. R^2 = 0.

7

8

0 20 40 60 80 Time (min) Voltage (V) Battery Poly. (Battery) Figure 21. Average lifespan of 9V battery with estimated decaying curve From these interpretations of the results, the 9V battery was able to supply the circuit for a small period of time. Because the microcontroller requires a larger voltage, however, the battery supply was limited at approximately 35 minutes of continued use. Therefore, power supply circuit performed as was originally stated but with these limitations. Figure 22. Final Power Supply Schematic with Necessary Changes 4.1.2 The Infrared circuitry