590 likes | 935 Views
Digital Appliance Timer. Justin Elkow Nick Klezek Becky Westendorf Friday, May 2, 2003. Complete Circuit. Idea. Design a reliable digital appliance timer Sync with GPS Atomic clock Battery backup 4 programmable timers Motion sensor interrupt. Benefits. Saves energy and money
E N D
Digital Appliance Timer Justin Elkow Nick Klezek Becky Westendorf Friday, May 2, 2003
Idea • Design a reliable digital appliance timer • Sync with GPS Atomic clock • Battery backup • 4 programmable timers • Motion sensor interrupt
Benefits • Saves energy and money • Motion sensor turns power on even if timer has not yet triggered • Easy user interface
Challenges • CODE!!! • Select Button Functionality • GPS Atomic clock • Interface between clock signal and BX-24 processor
Power Power Microcontroller Microcontroller LCD (Output) LCD (Output) WWVB Clock WWVB Clock Infrared Sensor Infrared Sensor Keypad (Input) Keypad (Input) Digital Timer Block Diagram
Power Power Microcontroller Microcontroller LCD (Output) LCD (Output) WWVB Clock WWVB Clock Infrared Sensor Infrared Sensor Keypad (Input) Keypad (Input) The Power Block
Objectives of the Power Supply • Provide a constant 5V DC supply voltage to remaining circuitry of the digital timer • Provide quick switching to turn on the load (lamp) to supply with 120 V AC • Allow user to easily switch between using the microcontroller for programming timing or normal use of the lamp switch
Key Features • Provides an additional 9V battery back-up supply voltage in event of a power outage • Allows user to switch between the use of the programmed microcontroller and normal appliance turn-on through one simple switch • Easy on/off switch for entire circuit
AC/DC Converter • OBR-24SA • Input Range: 85-132 VAC 50/60 Hz • 18 Amps • Output: 24VDC, 0.26A, 81% efficiency • Over current protection (self-recovering protection)
12 Amp Relay • T7CS1D-24 • Input Voltage: 24V • Contact Current: 12A • Coil Resistance: 1600 Ohms • Actual Resistance: 5513 Ohms
Relay Function • Relay allows a low current to control an electrically isolated higher current circuit • Relay coil is used to “trip” the switch in the relay • Coil composed of magnetic wire around a metal core • Voltage across the coil causes current to pass through the coil creating a magnetic field • Magnetic field flips the switch by pulling the contacts together
Relay Function (Cont.) • When the current flow is cut off (voltage across the coil is zero), the magnetic field decreases and releases the contacts which open the high current circuit • Back emf created when voltage removed from coil to counteract change • To reduce potential voltage spike from back emf, diode in parallel with coil
Test Results • Relay functionality: Turn-on voltage for the coil: 24V • Output voltages: to the microcontroller : ~5.94873 V to the atomic clock: ~3.57668 V to the laser circuit: ~5.02155 V
Test Results (cont.) • Output currents: to the microcontroller : ~80 mA to the atomic clock: ~70 mA to the infrared circuit: ~0.0743 mA • Output Voltage from Relay to Load (Lamp): ~119.1Vac
Successes • Implemented a battery back-up supply for emergency use • Employed user-friendly switch interface that directly turned on the lamp when switched from the microcontroller to the wall • Maintained constant voltages necessary to power each respective circuit
Power Microcontroller LCD (Output) Power Microcontroller LCD (Output) WWVB Clock Infrared Sensor Keypad (Input) WWVB Clock Infrared Sensor Keypad (Input) The Infrared Sensor Block
Infrared Sensor Objectives • To detect a person entering a room and to turn on an appliance • Must work across the width of a door • Must be small • Should be minimally noticed by user
Initial Circuit • 8 kHz Signal • 940nm light • Maximum distance 18in. • Must enhance circuit to reach 40 inches (doorway width)
Op Amp Solution • Use Op Amp to amplify signal • Infrared LED runs at 55mA, increase current to 150mA and use two diodes
Problem with Op Amps • Slew Rate was too slow ~400kV/sec
Current Mirrors • Used 12 pnp current mirrors to drive 3 diodes • 165mA per diode
Complete Sensor Design • Works at 40 inches!
Power Microcontroller LCD (Output) Power Microcontroller LCD (Output) WWVB Clock Infrared Sensor Keypad (Input) WWVB Clock Infrared Sensor Keypad (Input) The WWVB Clock Block
WWVB Clock • Use the time from the atomic clock to set the exact time on the digital timer • 60 kHz signal • Broadcast from the atomic clock in Boulder Colorado • Binary Coded Decimal • AM Modulation • Ideal broadcast at night, weak broadcast by day
Problems with WWVB • Ordering difficult (only vendor in England) • Technical Support almost nonexistent • Some data sheets only in German • Electrical Engineering Terminology different in Europe
Successes • Infrared Sensors worked at 40inches after many different circuit designs • Sensors integrated with microcontroller and fully functional within the entire system • WWVB circuit can output the clock signal when atmospheric conditions are favorable
The User Interface Blocks Power Microcontroller LCD (Output) Power Microcontroller LCD (Output) WWVB Clock Infrared Sensor Keypad (Input) WWVB Clock Infrared Sensor Keypad (Input)
Design Decisions • BX-24 • Chosen because basic code is simple (haha) • Sufficient number of I/O lines • Compatible with Serial LCD • Development board contained LCD interface and 4 programmable buttons
BX-24 Development Board • Serial Port for connecting to computer • 2x16 Serial LCD Interface • Four Push Buttons • *** Placed jumper from pin 1 to pin 5 on BX-24
Obstacles • LCD not receiving data and backlight not working • Random characters being sent to LCD display • Select Button functionality • Debouncing buttons • Disabling timers
LCDNot Outputting Data • Applied voltages directly to pins from same power supply • LCD then received data • Conclusion: When inserting LCD, pins must make contact at exact same time • Power must be supplied to +5 pin simultaneously or prior to the LEDSV+ pin
LCD Backlight Not Working • Operation manual stated that LCD should power up with 80% backlight • Factory code did not include command to turn on backlight • Solution: Used “LCDPutBrightness(100)” command to turn on backlight
LCD Random Characters • While code was looping, useless data was constantly outputting on LCD • Serial code being sent from computer to BX-24 on Com1 pin 1 • Again, deleted factory settings from code • Solution: Used “LCDOpenSerialPort(3, 9600, 0, 5)” command
Select Button Functionality • Select Button Changes Menus • If Timer On is not programmed, Select button will access next timer • If Timer On is programmed, select button will access Timer Off Menu • After programming, Select button will display real time clock
Solving TWO Problems • Added a new boolean variable to code • Button would equal true if hour, ten minute, or one minute button was pressed • If Button = True, select button would access timer off menu • If Button = False, select button would access next timer on menu • Processor would only store timers to EEPROM if Button = True • Eliminated problem of disabling timers