Upload
lekhanh
View
214
Download
2
Embed Size (px)
Citation preview
The Perfect Wake Up Machine
Group Project Report
Group #41
Matt Cuff
Brian Wagner
Steve Schmitt
Ryan Seeboth
i
December 11, 2008
Table of Contents
• List of Figures‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ii
• List of Tables‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐iii
• Problem Definition‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐1
• Abstract‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐1
• Design Summary‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐2
• Design Details‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐3
• Functional Diagram‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐10
• Wiring Diagram‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐11
• Software Flowchart‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐13
• Design Evaluation‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐16
• Partial Parts list‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐18
• Appendix‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐19 ‐List of Programming code ‐Manufacturing Drawings
i
List of Figures
• Figure 1: Main Circuit Board‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐3
• Figure 2: Full View‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐4
• Figure 3: Light Dimmer Circuit‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐5
• Figure 4: Back View‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐6
• Figure 5: Relays‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐7
• Figure 6: AC Outputs, Inside‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐8
• Figure 7: 4-Bar Bed Sheet Removal Mechanism---------------------------------------9
ii
List of Tables
• Table One: Partial Parts List‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐18
iii
Problem Definition:
Goal:
To design an alarm clock that gradually awakens the customer using lights, sounds and aromas to entice the user to get out of bed before more violent and persuasive measures are taken.
Objectives:
-To interact with the surroundings to initialize a cooling fan if temperature gets too high.
-The system will consist of three alarm stages that progress from gentle and calm using sweet coffee smells, followed by choice of buzzer or music, until vibrating pillows and 4-bar are activated.
-Easy availability for add-ons using two A/C outlets.
-Incorporate a keypad for easy inter time and alarm time along with temperature and humidity settings and music on/off functions.
Constraints: -Operate off of a 5V A/c to D/C converter. -Fit neatly into the contained space. -Quickly detect if lights or turned off or on.
Abstract
Our objective was to design a machine that could wake up any person, without fail, using
a series of alarms with increasing intensity. Before the series of alarms commence, a coffee pot
will be triggered to brew. Next, the sequence will begin with various auditory alarms, followed
by an alarm that will stimulate multiple senses. And, for the heavier sleepers, our final alarm will
ensure the consciousness of the consumer is achieved. The user will be able to choose which of
these alarms they would like to be active.
1
Design Summary
Our goal is to use sequential logic, achieved through a PIC Microcontroller, to design a
machine that would adjust the consciousness of a user during sleep through a multi-functional
alarm clock. This device will include switches and buttons to control various process
combinations. First, the user will be able to input the time, followed by an alarm time, using a
keypad. Six LEDs will indicate depressed buttons or command functions. When depressed and
the time increments to the specified alarm time, the buttons will activate two AC outputs (used
here to power a coffee maker and fan), a buzzer alarm system, pillow vibrator, music output, and
bed sheet remover all at the specified alarm times. For example, if one would like to wake up
slowly the user can program the coffee maker to come on early, so the smell of brew lingers
while mellow music begins, lead into more abrasive pillow vibrations, and for the heavier
sleeper, one could end with an obnoxious buzzer. If this proves ineffective, after a designated
amount of time a mechanism will remove the bed sheets off the user's bed guaranteeing the user's
consciousness to be adjusted. A small scale prototype for both the vibrating pillow and the bed
sheet remover will be implemented. A seven segment, four digit LED will display time, alarm
time, temperature readings, and various animations. Through implementation of Thermister the
user can select a temperature input threshold that if past will turn on an ac output that can be
either a fan or a heater. In our project, the combination of switches will provide desired
functionality, and the variety of outputs will leave the options wide open for the user. With this
machine you will never have to worry about sleeping through that eight am test, or miss the bus
ever again. Internal body clocks and standard alarm clocks are obsolete, but sleep with ease
knowing your consciousness will be adjusted by the Perfect Wake-Up Machine.
2
Design
Details
Figure 1: Main Circuit Board
Figure 2: Full View of Circuits and Power Sources
4
Figure 3: Light Dimmer Circuit
5
Figure 4: Back View Outlets, Kill Switch and Snooze
6
Button
Figure 5: Relays, Power Converters, and Bus
7
Figure 6: AC Power Jacks, Inside View
8
Figure 7: 4-Bar Bed Sheet Removal Mechanism
9
Keypad Buttons
Button Function 1 Temp (°F) 2 Rel. Humidity 3 Clock Brightness 4 Temp (°C) 5 --- 6 Clock Brightness 7 Music on 8 Music off 9 Input Temp # Enter Alarm Time * Enter Time
Figure 8: Keypad Button Functionality
15
Design Evaluation
A. Output Display
The Perfect Wake Up Machine fully satisfies this category through a serially controlled four digit
seven segment LED that acts as a clock display, and also six pushbutton LEDs. The LEDs in the
pushbuttons are activated when the button is depressed, to indicate which alarm the user would
like active. The LED clock display is easily one of the most important parts of this project. The
display will read the current time, allow you to set the current or alarm time, and it will read the
room temperature, humidity as well as set a threshold temperature.
B. Audio Output Device
This project has multiple audio outputs, featuring two speakers on the front which play music, a
buzzer which acts as one of the alarms, and one additional speaker which sends out a beep when
a keypad button is pressed. The keypad beeper was achieved using an EDE1144 keypad encoder,
which has a pin devoted to making this sound. By design the user can plug in an audio jack
straight into the machine and have it play music through the front speakers. This music can be
used either as an alarm, or can be turned on and off using the keypad at any time during the day.
C. Manual Data Input
Once again, The Perfect Wake Up Machine shows several elements of this category. The main
manual data input is a 3 x 4 keypad, which allows you to enter time, check the temperature
(Celsius or Fahrenheit) or humidity of the room, set a threshold temperature in Fahrenheit, adjust
the brightness of the clock display, and turn the music on or off.. The device is wired through an
EDE1144 keypad encoder, which reduces the number of pins that go to the master PIC to two.
16
Other data inputs include the six pushbuttons which activate the various alarms, a snooze button
used to delay the sequence until the next alarm, and a 'kill' switch which disables the alarm. A
potentiometer was used in the amplifier circuit to control the volume coming from the music
speakers. Also, digital potentiometers were used to control the dimness of the LEDs. The
potentiometers were controlled using a PIC microcontroller, which read the resistance value of
photo resistor. After reading the photo resistor the PIC would either make the potentiometer use
a high resistance or a lower one depending if it was light or dark. If dark, the maximum
resistance will control the LED lights to a dimed value compared to the brightness it will exhibit
if the light sensor is lit. The dimming of the lights allows the user to see the display and buttons
at night, but not be blinded while attempting to sleep.
D. Automatic Sensor Input
This project has two sensor inputs, one simple and one more complex. The simple sensor is a
photo cell, which changes resistance values depending on the light. As the light decreases, the
resistance of the photo cell increases and visa versa. The cell was used to control the brightness
of the LEDs, as was talked about in the previous section. The other sensor was a SHT11 digital
humidity and temperature sensor, or thermister. With this devise, one could measure the
temperature and humidity in the room easily at the push of a button on the keypad.
E. Actuators
Again, this functional category was satisfied multiple times in our design, both in the form of
motors. To activate the motion of the four-bar bed sheet remover, one on-off DC motor was
used. As the final alarm this motor is activated using a relay to quickly pull off the bed sheets.
Another component that used motors is the pillow vibrator. The vibration is achieved using five
17
of the small vibrating motors used to make cell phones vibrate, which are placed in a block of
wood to resonate the sound and vibration.
F. Logic, Counting, Integration, and Control
The final category was the most essential, and also the most time consuming part of this project.
To control the multiple outputs in the system, multiple PICs had to be used. A 40-pin master
PIC16F747 communicates serially with 2 different slave PIC16F88s to activate the various
alarms. Each slave PIC contains a small amount of code, but the master PIC required more
extensive programming to do all of the desired tasks. Counting had to be used in a couple places
in the project. The master PIC was used to generate a time that counted at the same rate as a
clock in the LED display. The SLED-C4 LED display comes with preprogrammed functions,
which helped to utilize it as a clock. However, a lot of programming went in to making the
machine count, as well as act like an alarm clock and display temperature. Another place
counting was used was in the potentiometers. The digital potentiometers require a clock input, so
a 555 timer was used to create a pulse train. Another element that fits in this category is the fact
that this device runs on logic, which was all done with programming. The entire alarm sequence
is based around logic. For example, if none of the buttons are pressed except for one, then the
code will check each alarm case and then only activate the one corresponding to the depressed
button. Alternatively if every button was pressed, the code would go through and cause each
alarm to go high in turn. And finally, code was used to quickly turn off and on a DC motor,
through a relay, so the actuator would only be active for a second.
18
Parts List:
Table 2: Partial Parts List
Description Supplier Part Number Price
LED display 4-Digit Serial LED With Clock Display
Reynolds Electronics
SLED-C4 $35.00
Thermister Digital Humidity and Temperature Sensor
Parallax SHT11 $30.00
Potentiometer Dual Digital Potentiometer
Maxim DS1867 $3.00
555 Timer Creates Clock Output Jameco CMOS 555 timer $0.60
Keypad Encoder Interfaces Keypad to PIC
Jameco EDE1144 $7.00
Microcontroller Master PIC microcontroller
Jameco PIC16F747 $4.00
Microcontroller PIC microcontroller Jameco PIC16F88 $4.00
Tiny Vibrator 5 Cell phone sized vibrating motor
All Electronics
DCM-320 $14.00
Darlington Transistor
High-Current Darlington transistor
Array
Reynolds Electronics
ULN2803A $2.00
Motor DC Drill motor DeWalt DC730KA N/A
Fan Small household fan Home Fan N/A
Coffee Maker Household coffee maker
Home Coffee N/A
Relay 4 24v Relays and Relay socket channel
Automation Direct
ZL-RS4-120 $40.00
Battery 9.7v Drill battery DeWalt DC730KA N/A
DPDT Push buttons
6 DPDT LED illuminated push
button switch
KZB Electronics
KB-26 $15.00
19
1
1
2
2
A A
B B
1k
1k
1uF
4.7k
1uF
1uF
4.7k
4.7k
4.7k
LED
LED
1uF
1uF
4.7k
4.7k
1uF
1uF
1k
1uF
1uF10 M
LED
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
+5v
DS1267-010
DS1267-010
555 Timer
DS1267-010
PIC16F88
Light Dimmer Circuit
#
1
1
2
2
A A
B B
1uF
1uF
1uF
+ -
+-
+
-
+ -
+-
+
-
+-
+
-
+ -
9.7v
1uF
1k
1uF
LED
+
-
+-
+-
1k1uF
+5v
+5v
+5v +5v
+5v
+5v
+5v
12v
12v
12v
+5v
+5v+5v
+5v
12v+5v
+5v
VddVss
VssVdd
SLED-C4 LED Display
RC2
RD0RD1
RC0
RD6
RD4
RC6
RC4RD3RD2
RC7
RC5
RD5
RD7
RC3
RC1
RB6RB7
RB4RB5
RB3RB2RB1RB0
31 2
6
7 9
# *
5
8
0
4
EDE1144
Row 0
Row 1
Row 2
Row 3
Col
umn
0
Col
umn
1
Col
umn
2
4 MHz
Osc2Osc1
+5V+5V+5V
GND
1 k
4.7k 4.
7k
4.7k
330
330
330
330
1 k
330
Snooze Button
Relay
FAN
120v
COFFEE MAKER
Relay120v
Relay
PIC16F88
1k k
Pillow Vibrator10
BeeperMaster
330
MCLR
RA1RA0
RA2RA3RA4RA5RE0
RE2RE1
RA7RA6
PIC16F747
Motor for four-bar
Relay
120v
Buzzer
PIC16F88
#
Speaker for Music