Transcript
Jukebox Hero
Group #41 James Brewster Ross Bulkley Zach Glueckert Kevin Wills
MECH 307 Mechatronics Colorado State University 12/7/2007
Table of Contents Figures, Schematics, and Illustrations
3
Design Summary
7
Design Details
8
Design Evaluation
9
PIC Code
11
master.bas main.bas heatpic.bas main_sensor_pic.bas noisetester.bas
2
Figures, Schematics, and Illustrations
Figure 1- Jukebox complete with disco ball
Figure 2- Control Panel 3
Figure 3- Main circuit with motor and LCD PIC’s
Figure 4- Auto sensing circuits 4
Figure 5- Stepper Motor TIP120 transistors
Figure 7- CD gripper arm and tower
5
Figure 8-Finished inside
6
Design Summary The title of Jukebox Hero is self describing, but this is no ordinary jukebox. This jukebox has the option of operating as a normal, select-individual-songs style jukebox or by an automatic setting based on environmental input. The jukebox uses temperature, light, and sound sensors (figure 2) to detect the environmental "mood." The mood is an array of three setting descriptions such as hot or cold, loud or quiet, and light or dark. This allows for 8 unique moods, each of which has a predetermined CD and track number associated with it to provided the perfect song for each situation. The mode selection button in figure 2 is an interrupt to select the mode desired by the user, auto or manual. Manual operation works by the user interfacing with the keypad and the LCD (figure 2). The LCD prompts the user to select a CD using the keypad. Then the LCD asks for a track number. If the user inputs an invalid entry it will prompt the question again. After successful selection of the CD and track, the LCD will inform the user that the CD is being loaded, and then it will play the selected song. A potentiometer (figure 2) is used to control the output volume of the speakers. Referring to figure 7, the arm is lifted by a unipolar stepper motor to 18 different preset locations for each of the CD's location in the CD tower. The requirement for 18 positions arises from the need to place the CD's back in the tower at a higher position than they were received at, due to the CD's drooping while being carried. A limit switch stops the arm's motion downward at the home position. The arm is also rotated by an H-bridged DC geared motor which allows the arm to travel through two positions, one two engage the CD tower for CD pick up and delivery, and another for traveling up and down along the tower. The CD tower also has an H-bridged DC geared motor with timing and physical stops to control the gate at two positions, open and closed (holds the CD's in their slots). The CD player has been modified to interface with the LCD/Keypad PIC to play, stop, and eject the CD. All of the moving parts have been timed in the program of the tower/gate PIC to interact with each other in sync. Up in the "attic" (figure 4) the circuit boards for the sensors and the sound amplification are presented. The lid on the Jukebox is removable so these components can be viewed and calibrated. All of the sensory circuits have LED's that indicate the values of the environments temperature, noise volume, and brightness so that, if desired, the operate would be aware of what mood the Jukebox senses. The sound amplification runs to speakers which rest on top of the Jukebox maximum exposure and adjustability
7
Design Details The automatic setting is activated by a pound command from the keypad which allows communication between the master PIC and the automatic sensors. The sensor readings are compiled by combining A/D converted values from each of the sensors. For the light reading, a PIC converts the voltages from three photo resistors to either a high (light) or low (dark) rating. The sound rating is derived from a microphone that is amplified through two op-amps that force the signal above the op-amp’s gain-bandwidth. This results in high output in quiet environments. When sound waves are felt by the microphone, the negative oscillations are felt by the op-amps which then plunge below there maxed output. From the amps, the signal is polarized by an ansel operation in a PIC. The polarized signal can be seen by an LED that will flicker when one speaks or whistles in front of the microphone. A separate PIC averages the polarized outputs for two seconds before outputting the high (noisy) or low (quiet) signal based on the calculated duty cycle. The heat sensor uses five RTD’s in series and an op-amp to amplify the RTD’s change in resistance based on temperature. A PIC then converts the signal to a DC voltage via an ansel command. It uses this digital reading to calculate its output of high (hot) or low (cold). All three of the final signals are placed on a single “main sensor” PIC that uses serial communication to alert the main circuit of the environmental conditions. Normal operation would continue from this point. In conventional use, users first entered a CD selection. This was limited to 9 different CD’s. The user could not proceed without a selection, and would be reminded politely of this fact. After CD selection, a track number was needed. Between switching from the CD selection to track selection a small subroutine was run in order to find the maximum track for the given CD. This variable restricted entry of nonexistent track numbers by comparing the selected track number to the input variable and determining if the selection was feasible. Once the track and CD were selected, or in the automatic modes preselected, a serial connection was made with the arm microcontroller. The CD variable was converted to units that allowed the motion of the stepper motor. Coordination of ejecting the CD, replacing it, retrieving a new CD, and homing were all handled by the arm microcontroller. With the process complete and CD loaded into the player, the arm microcontroller alerted the main microcontroller that movement had ceased and music operations could begin. At this point the main microcontroller would manipulate the CD player features in order to select and play the desired track. After a momentary pause, the user could select a new CD and track, or conversely, activate the automatic sensing mode to have song chosen for them. Displayed on the larger LCD would be the album name and track number of the current CD. 8
A
B
C
D
E
F
JUKEBOX HERO 1 +5V
+5V
Stepper Motor
+5V
1
CD Player
1 2
Power
Open
Play/Pause
FF
3 4 +5V Gnd +5
+5
Gnd
SPST Relay
+5V
+5
Gnd SPST Relay
A1 A0 A7 A6 +5 B7 B6 B5 B4
2
SPST Relay
A2 A3 A4 A5 Gnd B0 B1 B2 B3
+5
PIC16F88
A1 A0 A7 A6 +5 B7 B6 B5 B4
Gnd
A2 A3 A4 A5 Gnd B0 B1 B2 B3
2
SPST Relay
PIC16F88 +5V
3
3
Light
+5V
PIC16F88 +5V
5
Vcc1 4A 4Y Gnd Gnd 3Y 3A 34EN
+5 SPST Relay Gnd 4
+5V
DC Motor DC Motor
A1 A0 A7 A6 +5 B7 B6 B5 B4
+5V
+5V
SPST Relay
Sound PIC16F88 A2 A3 A4 A5 Gnd B0 B1 B2 B3
H Bridge 12EN 1A 1Y Gnd Gnd 2Y 2A Vcc2
+5
4
A1 A0 A7 A6 +5 B7 B6 B5 B4
Gnd
A2 A3 A4 A5 Gnd B0 B1 B2 B3
5 1
2
3
4
5
6
7
8
9
*
0
#
Temp
6
6
PIC16F88 A2 A3 A4 A5 Gnd B0 B1 B2 B3
+5V
A1 A0 A7 A6 +5 B7 B6 B5 B4
+5V
EDE702 Baud POL +5 +5 Gnd Enable RS RW N/C
7
DigOut SerIn Osc Osc +5 D7 D6 D5 D4
EDE1144 Xmit Baud +5V +5V Gnd R0 R1 R2 R3
+5V
Vss
Vcc
Vee
RS
R/W
E
DB4
DB5
DB6
B
7
DB7
*All pull up resistors are 4.7K and all pull downs are 1K
LCD
A
Buzzer
Beep Valid Osc Osc +5V C3 C2 C1 C0
C
D
E
F