Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Pinball MachineMei LiCaleb Whitehead
EGGN 383 Final Project
May 1, 2013
Project overviewObjective: small-scale pinball machine
Operations:○ User pushes a button to swing the paddle○ Machine records number of times the ball enters
different regions, using IR break-beam sensors○ Game over when the ball escapes 3 times○ The goal is to get as many points as possible
Mei
Hardware - Diagram
Score Regions
Escape Region
Mei
Hardware - ComponentsServo motors
○ swing the paddle○ operate on 6 V (Vservos)○ 60o rotation
Pushbuttons○ control the servo motors○ active high with pull-up
resistorhttp://image.made-in-china.com/2f0j00geNanjyoSZbY/Push-Button-Switch-PBS-28B-2L-.jpgMei
Hardware - Components
IR Break-Beam Sensors
○ detect the ball○ update the score○ modulated by 555
timer
Liquid crystal display (LCD)○ GDM2004D module○ Hitachi HD44780U controller○ display the scores○ display "escape" counter
Mei
Hardware - Components
http://www.circuitstoday.com/wp-content/uploads/2009/09/555-timer-ic-identification.jpg
http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/555_Astable_Diagram.svg/500px-555_Astable_Diagram.svg.png
LM 555CN Timer○ provide 38kHz signal for modulating the IR
emitter ○ configure in astable mode○ C = 1nF, R1 = 1kΩ, R2 varies
Mei
Schematic
Caleb
Software - Design Controlling the paddles
○ impulse vs holdInterrupts vs. PollingFrom PWM system to Servo outputsUse of PortAD for LCD
Caleb
Software - PseudocodeInitialize
LCD (on PortAD)PWM system (on PortT)IR sensors (already set as inputs on PortM)Set score to zeroSet number of escapes left to three
Caleb
Software - PseudocodePoll
Drive motor forward if button depressedDrive motor back if button releasedWaiting = 1 if score sensor detects ballIncrease score, waiting = 0 if score sensor doesn't detect ball and waiting = 1 If escape sensor detects ball, wait until escape sensor doesn't detect ball, then decrease escapes leftUpdate counters on the LCDDisplay "Game Over" if no escapes leftWhile (Game Over) enter infinite loop to disable game
Caleb
Challenges Pushbuttons
○ bouncing on input captureMotors
○ interfering with each otherIR Break-Beam Sensors
○ used 555 timer instead of function generatorMechanical construction
○ mounting of components
Caleb
SummaryDesign and implement a small-scale pinball machine
○ Use HCS12 microcontroller for interfacing○ Pushbutton activates the motor○ Motor swings the paddle to hit the ball○ IR sensors detect the ball○ LCD displays the scores
Mei
Questions or clarifications or suggestions?
?