Difference between revisions of "S16: Pinball"

From Embedded Systems Learning Academy
Jump to: navigation, search
(References Used)
(Grading Criteria)
 
(84 intermediate revisions by one other user not shown)
Line 1: Line 1:
=== Grading Criteria ===
 
<font color="green">
 
*  How well is Software & Hardware Design described?
 
*  How well can this report be used to reproduce this project?
 
*  Code Quality
 
*  Overall Report Quality:
 
**  Software Block Diagrams
 
**  Hardware Block Diagrams
 
**:  Schematic Quality
 
**  Quality of technical challenges and solutions adopted.
 
</font>
 
 
 
=Pinball=
 
=Pinball=
  
 
== Abstract ==
 
== Abstract ==
 
For our project, we wanted to design a pinball machine. We wanted to incorporate bumpers, a 7 segment LED display driven by a UART interface for the total points earned, a sound system that would go off after each bumper was hit, and LED's surrounding the machine. In addition, we wanted the user to be able to interact with the machine by turning it on and off with a power button, as well as control the flippers with push buttons that are placed on the sides of the pinball machine.
 
For our project, we wanted to design a pinball machine. We wanted to incorporate bumpers, a 7 segment LED display driven by a UART interface for the total points earned, a sound system that would go off after each bumper was hit, and LED's surrounding the machine. In addition, we wanted the user to be able to interact with the machine by turning it on and off with a power button, as well as control the flippers with push buttons that are placed on the sides of the pinball machine.
 +
 +
[[File:IMG_6058.JPG|350px|thumb|left]]
 +
[[File:Pinball1.jpg|350px|thumb|center]]
 +
Finished Pinball Machine
 +
<br>
  
 
== Objectives & Introduction ==
 
== Objectives & Introduction ==
Below is a high level list of the minimum functionality features our project will include.  
+
The objective of this project is to design and build a pinball machine powered by an SJ-One Board. The pinball machine will feature an audio controller that will play sounds once triggered by the playing field, a real-time score machine, servos for powering the flippers, and different LEDs that will display different color patterns throughout the entire session of the game. Below is a high level list of the minimum functionality features our project will include.  
 
# Launching Pin ball (mechanical)
 
# Launching Pin ball (mechanical)
 
# Play sound/music when sensors are triggered
 
# Play sound/music when sensors are triggered
Line 32: Line 25:
 
**  Power Accountant: Designing power circuit for power supply and tracking watt consumption
 
**  Power Accountant: Designing power circuit for power supply and tracking watt consumption
 
*  Jo-Anna Marie Reyes
 
*  Jo-Anna Marie Reyes
**  7-Segment Display Programmer: Developing the code to display outputs as the State Machine executes
+
**  Programming LED's for ramp and putting components onto the playing field
 
*  BJ Wahhab
 
*  BJ Wahhab
 
** Flipper Control/Polling MicroSwitch, State Machine and Software Flow
 
** Flipper Control/Polling MicroSwitch, State Machine and Software Flow
Line 59: Line 52:
 
| 4/10
 
| 4/10
 
| 1. Component research and initial pinball design <br> 2. Begin component purchasing  
 
| 1. Component research and initial pinball design <br> 2. Begin component purchasing  
| In-progress
+
| Completed
|  
+
| Completed. Ordering the parts was very time consuming. We recommend putting more time into planning and purchasing the components ahead of time. There was a lot of last minute purchases as well as, unnecessary purchases made. Overall, we did well splitting up the cost and making sure we had the parts in a reasonable time frame
 
|-
 
|-
 
! scope="row"| 3
 
! scope="row"| 3
Line 66: Line 59:
 
| 4/17
 
| 4/17
 
| 1. Start of the architectural design<br> 2. Program lights, sounds, and buffers<br> 3. Start mechanical aspects
 
| 1. Start of the architectural design<br> 2. Program lights, sounds, and buffers<br> 3. Start mechanical aspects
|  
+
| Completed architectural design, sounds, lights
|  
+
| Working on buffers and mechanical aspects
 
|-
 
|-
 
! scope="row"| 4
 
! scope="row"| 4
Line 73: Line 66:
 
| 4/24
 
| 4/24
 
| 1. Incorporate bumpers and LED display <br> 2. Make connections and test if certain parts are working
 
| 1. Incorporate bumpers and LED display <br> 2. Make connections and test if certain parts are working
|  
+
| Completed LED Display
|  
+
| Bumpers are still in progress as well as previous taks
 
|-
 
|-
 
! scope="row"| 5
 
! scope="row"| 5
Line 80: Line 73:
 
| 5/01
 
| 5/01
 
| 1. Incorporate all components into the designed pinball skeleton <br> 2. Begin component/unit testing <br> 3. Troubleshoot/Debug as needed
 
| 1. Incorporate all components into the designed pinball skeleton <br> 2. Begin component/unit testing <br> 3. Troubleshoot/Debug as needed
|  
+
| Completed
|  
+
| The 3D printed Bumpers and flippers were the most important components needed to finalize the pinball machine. Once theses items were ready, the overall design became more defined. The gears and buttons were testes to make sure the flippers worked synchronously
 
|-
 
|-
 
! scope="row"| 6
 
! scope="row"| 6
Line 87: Line 80:
 
| 5/08
 
| 5/08
 
| Product testing and final adjustments
 
| Product testing and final adjustments
|  
+
| Completed
|  
+
| All the components were mounted and adjustments were made to the design. The ball loaded runway needed a lot of work to make sure the ball rolled over the nails easily
 
|-
 
|-
 
! scope="row"| 7
 
! scope="row"| 7
Line 94: Line 87:
 
| 5/15
 
| 5/15
 
| Final Product Testing
 
| Final Product Testing
|  
+
| Completed
|  
+
| Unfortunately, the color LEDs did not turn ON during testing. Because this was an added feature to the project, we felt okay going into demo without them functioning
 
|-
 
|-
 
|}
 
|}
Line 106: Line 99:
 
! scope="col"| Quantity
 
! scope="col"| Quantity
 
! scope="col"| Cost
 
! scope="col"| Cost
! scope="col"| Details
 
 
|-
 
|-
 
! scope="row"| 1
 
! scope="row"| 1
Line 112: Line 104:
 
| 1
 
| 1
 
| $80.00
 
| $80.00
|
 
 
|-
 
|-
 
!scope="row"|2
 
!scope="row"|2
Line 118: Line 109:
 
|1
 
|1
 
|$50.00
 
|$50.00
|
 
 
|-
 
|-
 
!scope="row"|3
 
!scope="row"|3
Line 124: Line 114:
 
|1
 
|1
 
| Free
 
| Free
|
 
 
|-
 
|-
 
!scope="row"|4
 
!scope="row"|4
Line 130: Line 119:
 
|~9
 
|~9
 
| Free
 
| Free
|
 
 
|-
 
|-
 
!scope="row"|5
 
!scope="row"|5
Line 136: Line 124:
 
|1
 
|1
 
| $20.00
 
| $20.00
|
 
 
|-
 
|-
 
!scope="row"|6
 
!scope="row"|6
Line 142: Line 129:
 
|24
 
|24
 
| $6.00
 
| $6.00
|
 
 
|-
 
|-
 
!scope="row"|7
 
!scope="row"|7
Line 148: Line 134:
 
|~20
 
|~20
 
|$5.00
 
|$5.00
|
 
 
|-
 
|-
 
!scope="row"|8
 
!scope="row"|8
Line 154: Line 139:
 
|3
 
|3
 
| Free
 
| Free
|
 
 
|-
 
|-
 
!scope="row"|9
 
!scope="row"|9
Line 160: Line 144:
 
|2
 
|2
 
| Free
 
| Free
|
 
 
|-
 
|-
 
!scope="row"|10
 
!scope="row"|10
Line 166: Line 149:
 
|90+
 
|90+
 
| $15.00
 
| $15.00
|
 
 
|-
 
|-
 
!scope="row"|11
 
!scope="row"|11
Line 172: Line 154:
 
|1 Set
 
|1 Set
 
| Free
 
| Free
|
 
 
|-
 
|-
 
!scope="row"|12
 
!scope="row"|12
Line 178: Line 159:
 
|2
 
|2
 
| $75.13
 
| $75.13
|
 
 
|-
 
|-
 
!scope="row"|12
 
!scope="row"|12
Line 184: Line 164:
 
|2
 
|2
 
| $4.00
 
| $4.00
|
 
 
|-
 
|-
 
!scope="row"|13
 
!scope="row"|13
 
| Wood
 
| Wood
|  
+
| 6 pieces
|0
+
| $60.00
|
 
 
|-
 
|-
 
!scope="row"|14
 
!scope="row"|14
 
| Buck Converters
 
| Buck Converters
 +
| 3
 +
| $15.00
 +
|-
 +
!scope="row"|15
 +
| 74HCT138 (3-to-8 line decoder/demultiplexer; inverting)
 +
| 2
 +
| Free
 +
|-
 +
!scope="row"|16
 +
| SN74LS148 (8-line to 3-line priority encoder)
 +
| 4
 +
| $2.40
 +
|-
 +
!scope="row"|17
 +
| Micro Switches
 +
| 40
 +
| $8.00
 +
|-
 +
!scope="row"|18
 +
| Speakers
 +
| 1
 +
| Free
 +
|-
 +
!scope="row"|19
 +
| Styrofoam
 +
| 3 Pieces
 +
| $10.00
 +
|-
 +
!scope="row"|20
 +
| Balsa Wood
 +
| 4 Pieces
 +
| $30.00
 +
|-
 +
!scope="row"|Total
 +
|
 
|  
 
|  
|0
+
|$380.53
|
 
 
|}
 
|}
 +
 +
Datasheets are provided at the bottom of this page in the references section.
  
 
== Design & Implementation ==
 
== Design & Implementation ==
The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.
+
In this section, we will discuss the design and implementation of our pinball machine. This section will be broken up into subsections including hardware design, hardware interface, hardware constraints, software design, and implementation. Throughout these sections, we have added schematics and diagrams that will show the reader the specifics of our project.
  
 
=== Hardware Design ===
 
=== Hardware Design ===
 
Discuss your hardware design here.  Show detailed schematics, and the interface here.
 
Discuss your hardware design here.  Show detailed schematics, and the interface here.
  
The hardware design included a battery supply, 3 7-segment serial displays, multiple LEDs, and an audio controller.
+
In this section, we will discuss the hardware design used for our project. The hardware design included a power supply, 3 7-segment serial displays as our score board, multiple LEDs that will display patterns throughout the session of the game, and an audio controller that will display sounds throughout the game.
 +
 
 +
[[File:Power.png|450px|thumb|center|Figure 1: Power circuit schematic.]]<br>
 +
 
 +
Figure 1 shows the power circuit, which has a power supply that can provide 24 volts. The power supply's voltage is divided to the SJ-One Board, the serial 7-segment LED display, the audio controller, the LEDs around the board, and the servos, which control the push buttons for the flippers. We were able to make this power supply power the SJ One Board by connecting it directly to our circuit. In addition, by hooking up the LED circuit (Figure 2) to the SJ One board, we are able to supply 5 volts to the 3-to-8 line decode, which powers the basic colored LEDs (i.e. red, orange, yellow, etc).
 +
 
 +
[[File:New_LED.png|450px|thumb|center|Figure 2: LED circuit.]]<br>
 +
 
 +
Figure 2 shows the circuit for the basic LED lights around the playing field. This circuit shows the SJ-One Board connected to two 3-to-8 line decoders, which are both connected to 6 different colored LEDs. From the SJ-One Board, each pin is connected to the inputs of the decoders. The output pins of the decoders and connected to 220 ohm resistors, which are then connected to the different LEDs.
  
 
=== Hardware Interface ===
 
=== Hardware Interface ===
In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the '''Software Design''' section is isolated to talk about high level workings rather than inner working of your project.
+
In this section, we will discuss how the hardware is interfaced and the different types of driver implementations used to complete our project.
 +
 
 +
[[File:7seg.png|450px|thumb|center|Figure 3: Serial 7-Segment LED Display circuit.]]<br>
 +
 
 +
For the serial 7-segment LED display, Figure 3, we used a Serial Peripheral Interface (SPI). Because we chose SPI communications, the 7-segment LED display's datasheet instructed us to connect the MOSI, CSN, and SCK pins to our SJ One Board in order to successfully complete the communication. In the figure above, we have shown the display with the different pins that were connected to our SJ One Board.
 +
 
 +
[[File:audio.png|450px|thumb|center|Figure 4: Audio Controller circuit.]]<br>
 +
 
 +
Figure 3 shows the audio controller circuit, which uses the WAV Trigger WIG-13660 ROHS. We have inputted a microSD card that holds the music that will be played throughout the game. This circuit has a UART interface, which will be discussed more in the software section of this report. Because of this type of interface, we connected the SJ One Board's ground pin to the WAV Trigger's ground. In addition, one of the TX output pins on the SJ One Board was connected to the RX pin on the WAV Trigger.
  
 
====Hardware Constraints====
 
====Hardware Constraints====
Line 218: Line 248:
 
* Pinball frame height: TBD
 
* Pinball frame height: TBD
 
* Angle: ~5 degrees inclined
 
* Angle: ~5 degrees inclined
 +
* Serial 7-Segment LED Display: 2.6-5.5V
  
 
=== Software Design ===
 
=== Software Design ===
Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.
+
One of the tasks we have running is the music playing while our pinball machine is in session. Once the machine is started up, the player is able to hear the music, which plays different tunes using UART communication. Depending on what is happening on the playing field, the corresponding data is sent to the audio controller from the SJ-One Board as a command. By doing so, music for the bumpers, when the game starts and ends, and throughout the session of the game will be played.
 +
 
 +
To control the serial 7-segment LED display, our score board, we were able to utilize SPI to control the score. The pins that were connected were the MOSI, the SCK, and the CSN. The reason the MISO pin was not needed is because the the serial 7-segment LED display was not sending signals back to the master. The SJ-One board was the only module that needed to send signals for output. Each time the ball hit certain sensors and the flippers are switched, points will be added to the total score and displayed onto the 7-segment LED display. In addition, upon startup, words are displayed to prompt the user to start the game.
 +
 
 +
Once the ball is launched, there will be LEDs along the ramps path that will be lit once the ball has connected the circuit. This wires will be the input that the GPIO driver will need in order to power up the LEDs that are on the side of the ramp. By doing so, we are able to allocate points to the user and the scoreboard, and it will indicate where the ball is on the playing field.
 +
 
 +
To control the flippers, which are connected to the servos, we utilized PWM, which is Pulse Width Modulation.
  
 
=== Implementation ===
 
=== Implementation ===
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
+
In order to implement our project, we have included a state diagram that will breakdown each aspect of our pinball machine during a session. Upon startup, the system will either go, or continue waiting for the user to press the two flipper buttons to start. After the user has started the session, the launch will commence. After the user has launched, a gaming session will start. If the ball falls out, the game will end. 
 +
 
 +
[[File:pinball.png|450px|thumb|center|Figure 5: State Machine for the entire implementation of the project.]]
  
 
== Testing & Technical Challenges ==
 
== Testing & Technical Challenges ==
Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again?
+
When testing our pinball machine, we began by testing the different components that we had done and working off of that. Once we knew that each part was completed successfully, we started combining the different components together and repeating the testing process.  
Make a smooth transition to testing section and described what it took to test your project.
 
  
Include sub-sections that list out a problem and solution, such as:
+
=== Issue #1 - Servos ===
 +
We have had a few issues and a majority of these problems have been due to mechanical oversights. One of the first issues we had when starting our project was because of our servos. While trying to purchase our servos, we were researching which servo would work best for our purpose, which would be to control the flippers. Because we were limited with time, we choose the servos we thought would be the best, but they turned out to be too slow. In order to solve this issue, we had to add gears to increase the speed. One thing we would recommend in regards to key parts of a project, is that you should allocate enough time to research these parts so that fixing them does not require too much work once you have them.
  
=== Issue #1 ===
+
=== Issue #2 - Serial 7-Segment LED Display ===
We have had a few issues and a majority of these problems have been due to mechanical oversights. One of the first issues we had when starting our project was because of our servos. While trying to purchase our servos, we were researching which servo would work best for our purpose, which would be to control the flippers. Because we were limited with time, we choose the servos we thought would be the best, but they turned out to be too slow. In order to solve this issue, we had to add gears to increase the speed.
+
One of the smaller scale issues we had included the first set of 7-segment LED displays that we bought. Because of time constraints, we did not do our research well enough to purchase an LED display that fit our project. The first ones we purchased, we were unsure of how to display data on them because the datasheet did not have the information regarding which pin did what function. Because of this, we decided to consult with Preet about whether we should purchase new ones, or try to add different Gates to get them to work. He suggested we use 7-segment LED displays that could be driven by UART and SPI, which was the current ones we have now (COM-09230).
  
=== Issue #2 ===
+
=== Issue #3 - Ball===
One of the smaller scale issues we had included the first set of 7-segment LED displays that we bought. Because of time constraints, we did not do our research well enough to purchase an LED display that fit our project. The first ones we purchased, we were unsure of how to display data on them because the datasheet did not have the information regarding which pin did what function. Because of this, we decided to consult with Preet about whether we should purchase new ones, or try to add different Gates to get them to work. He suggested we use 7-segment LED displays that could be driven by UART and SPI, which was the current ones we have now (COM-09230).
+
One of the major issues we had was that the ball we initially got for the project was too light for the limit switches to be triggered once on the playing field. Because of this, we ran into other problems. The servos we had were not strong, or fast enough to withstand a ball that was heavier than the ball that we initially have, so we had to think of a different solution. The solution we found was that we should keep the ball that we currently have, and instead of using the limit switches as a detector for the ball, we should just use the 3 bumpers in the middle.
  
 
== Conclusion ==
 
== Conclusion ==
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
+
In conclusion, we completed everything we said we would add to our pinball machine. When adding the LEDs to the pinball machine, we did have complications because of the connections at the bottom of the board. One of the things we learned that was most valuable was to read the datasheets and really research the different components you want. In addition, planning ahead and knowing exactly what you want is a good indication that you will get the parts that you need for their specified purpose. Even though we ran into a few of these issues, we were able to make them work. In the case of the servos, we utilized gears to help them with controlling the flippers. Another valuable lesson we learned while conducting this project is the importance of communicating and teamwork. By doing this, we were able to successfully work with one another and create a project that we were all proud of. This project helped increase our knowledge of building a project that incorporated mechanical aspects. 
  
 
=== Project Video ===
 
=== Project Video ===
Upload a video of your project and post the link here.
+
https://youtu.be/lYu_lRx3z3U
  
 
=== Project Source Code ===
 
=== Project Source Code ===
Line 248: Line 287:
 
== References ==
 
== References ==
 
=== Acknowledgement ===
 
=== Acknowledgement ===
Any acknowledgement that you may wish to provide can be included here.
+
We would like to thank Preet for encouraging us to pursue this type of project, and for teaching us how to incorporate the labs in a real time project. In addition, we would like to thank Dr. Haluk Ozemek for teaching us the fundamentals we needed in order to complete this project.
  
 
=== References Used ===
 
=== References Used ===
 
List any references used in project.
 
List any references used in project.
  
<b>Serial 7-Segment LED Display (COM-09230) Datasheet</b>
+
<b>Serial 7-Segment LED Display (COM-09230) Datasheet </b>https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SFE-0012-DS-7segmentSerial-v41.pdf
https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SFE-0012-DS-7segmentSerial-v41.pdf
+
 
 +
<b>Serial 7-Segment LED Display (COM-09230) Power Schematic </b>https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SPI_to_4x7SD-v22.pdf
 +
 
 +
<b>Sparkfun WAV Trigger 50751 Datasheet </b>https://solarbotics.com/download.php?file=2342
 +
 
 +
<b>Sparkfun WAV Trigger 50751 Power Schematic </b>https://solarbotics.com/download.php?file=2237
 +
 
 +
<b>Servo - Hitec HS-85MG (Micro Size) ROB-11887 Datasheet </b>http://cdn.sparkfun.com/datasheets/Robotics/hs85.pdf
 +
 
 +
<b>Concave Button - White </b>https://www.sparkfun.com/products/9340
 +
 
 +
<b>8-line to 3-line Priority Encoder </b>http://www.farnell.com/datasheets/93457.pdf
  
<b>Serial 7-Segment LED Display (COM-09230) Schematic</b>
+
<b>Rainbow Colored LEDs</b> http://www.karlssonrobotics.com/datasheets/Components/LED/YSL-R596CR4G3B5W-F12.pdf
https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SPI_to_4x7SD-v22.pdf
 
  
 
=== Appendix ===
 
=== Appendix ===
You can list the references you used.
 

Latest revision as of 20:14, 26 May 2016

Pinball

Abstract

For our project, we wanted to design a pinball machine. We wanted to incorporate bumpers, a 7 segment LED display driven by a UART interface for the total points earned, a sound system that would go off after each bumper was hit, and LED's surrounding the machine. In addition, we wanted the user to be able to interact with the machine by turning it on and off with a power button, as well as control the flippers with push buttons that are placed on the sides of the pinball machine.

IMG 6058.JPG
Pinball1.jpg

Finished Pinball Machine

Objectives & Introduction

The objective of this project is to design and build a pinball machine powered by an SJ-One Board. The pinball machine will feature an audio controller that will play sounds once triggered by the playing field, a real-time score machine, servos for powering the flippers, and different LEDs that will display different color patterns throughout the entire session of the game. Below is a high level list of the minimum functionality features our project will include.

  1. Launching Pin ball (mechanical)
  2. Play sound/music when sensors are triggered
  3. Flipper Controls (mechanical)
  4. Ball detection sensor
  5. Score Incrementation as sensors are hit
  6. Display score on 7-segment display
  7. Game Over announcement

Team Members & Responsibilities

  • Yvonne Jacinto
    • Physical Component Design: Building the Pinball Machine container and Designing the layout for the playing field
  • Megumi Page
    • Power Accountant: Designing power circuit for power supply and tracking watt consumption
  • Jo-Anna Marie Reyes
    • Programming LED's for ramp and putting components onto the playing field
  • BJ Wahhab
    • Flipper Control/Polling MicroSwitch, State Machine and Software Flow

Schedule

Week# Start Date End Date Task Status Outcome
1 3/28 4/03 Project Proposal Submitted Approved
2 4/04 4/10 1. Component research and initial pinball design
2. Begin component purchasing
Completed Completed. Ordering the parts was very time consuming. We recommend putting more time into planning and purchasing the components ahead of time. There was a lot of last minute purchases as well as, unnecessary purchases made. Overall, we did well splitting up the cost and making sure we had the parts in a reasonable time frame
3 4/11 4/17 1. Start of the architectural design
2. Program lights, sounds, and buffers
3. Start mechanical aspects
Completed architectural design, sounds, lights Working on buffers and mechanical aspects
4 4/18 4/24 1. Incorporate bumpers and LED display
2. Make connections and test if certain parts are working
Completed LED Display Bumpers are still in progress as well as previous taks
5 4/25 5/01 1. Incorporate all components into the designed pinball skeleton
2. Begin component/unit testing
3. Troubleshoot/Debug as needed
Completed The 3D printed Bumpers and flippers were the most important components needed to finalize the pinball machine. Once theses items were ready, the overall design became more defined. The gears and buttons were testes to make sure the flippers worked synchronously
6 5/02 5/08 Product testing and final adjustments Completed All the components were mounted and adjustments were made to the design. The ball loaded runway needed a lot of work to make sure the ball rolled over the nails easily
7 5/09 5/15 Final Product Testing Completed Unfortunately, the color LEDs did not turn ON during testing. Because this was an added feature to the project, we felt okay going into demo without them functioning

Parts List & Cost

Part Part Name Quantity Cost
1 SJ One Board 1 $80.00
2 Audio Controller 1 $50.00
3 Power Supply 1 Free
4 Pinballs ~9 Free
5 Pinball Ball Shooter 1 $20.00
6 Rainbow LEDs 24 $6.00
7 LED Mixed Pack ~20 $5.00
8 7-Segment Serial Display (COM-09230) 3 Free
9 3-D Printed Flippers 2 Free
10 Jumper Cables 90+ $15.00
11 Speakers 1 Set Free
12 Servos 2 $75.13
12 Push Buttons 2 $4.00
13 Wood 6 pieces $60.00
14 Buck Converters 3 $15.00
15 74HCT138 (3-to-8 line decoder/demultiplexer; inverting) 2 Free
16 SN74LS148 (8-line to 3-line priority encoder) 4 $2.40
17 Micro Switches 40 $8.00
18 Speakers 1 Free
19 Styrofoam 3 Pieces $10.00
20 Balsa Wood 4 Pieces $30.00
Total $380.53

Datasheets are provided at the bottom of this page in the references section.

Design & Implementation

In this section, we will discuss the design and implementation of our pinball machine. This section will be broken up into subsections including hardware design, hardware interface, hardware constraints, software design, and implementation. Throughout these sections, we have added schematics and diagrams that will show the reader the specifics of our project.

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

In this section, we will discuss the hardware design used for our project. The hardware design included a power supply, 3 7-segment serial displays as our score board, multiple LEDs that will display patterns throughout the session of the game, and an audio controller that will display sounds throughout the game.

Figure 1: Power circuit schematic.

Figure 1 shows the power circuit, which has a power supply that can provide 24 volts. The power supply's voltage is divided to the SJ-One Board, the serial 7-segment LED display, the audio controller, the LEDs around the board, and the servos, which control the push buttons for the flippers. We were able to make this power supply power the SJ One Board by connecting it directly to our circuit. In addition, by hooking up the LED circuit (Figure 2) to the SJ One board, we are able to supply 5 volts to the 3-to-8 line decode, which powers the basic colored LEDs (i.e. red, orange, yellow, etc).

Figure 2: LED circuit.

Figure 2 shows the circuit for the basic LED lights around the playing field. This circuit shows the SJ-One Board connected to two 3-to-8 line decoders, which are both connected to 6 different colored LEDs. From the SJ-One Board, each pin is connected to the inputs of the decoders. The output pins of the decoders and connected to 220 ohm resistors, which are then connected to the different LEDs.

Hardware Interface

In this section, we will discuss how the hardware is interfaced and the different types of driver implementations used to complete our project.

Figure 3: Serial 7-Segment LED Display circuit.

For the serial 7-segment LED display, Figure 3, we used a Serial Peripheral Interface (SPI). Because we chose SPI communications, the 7-segment LED display's datasheet instructed us to connect the MOSI, CSN, and SCK pins to our SJ One Board in order to successfully complete the communication. In the figure above, we have shown the display with the different pins that were connected to our SJ One Board.

Figure 4: Audio Controller circuit.

Figure 3 shows the audio controller circuit, which uses the WAV Trigger WIG-13660 ROHS. We have inputted a microSD card that holds the music that will be played throughout the game. This circuit has a UART interface, which will be discussed more in the software section of this report. Because of this type of interface, we connected the SJ One Board's ground pin to the WAV Trigger's ground. In addition, one of the TX output pins on the SJ One Board was connected to the RX pin on the WAV Trigger.

Hardware Constraints

  • Power Supply: 24V / 2.1A
  • Pinball size: 0.5 inch diameter / 8.4-8.5 grams each
  • Pinball frame width: 1.5 feet
  • Pinball frame length: 2 feet
  • Pinball frame height: TBD
  • Angle: ~5 degrees inclined
  • Serial 7-Segment LED Display: 2.6-5.5V

Software Design

One of the tasks we have running is the music playing while our pinball machine is in session. Once the machine is started up, the player is able to hear the music, which plays different tunes using UART communication. Depending on what is happening on the playing field, the corresponding data is sent to the audio controller from the SJ-One Board as a command. By doing so, music for the bumpers, when the game starts and ends, and throughout the session of the game will be played.

To control the serial 7-segment LED display, our score board, we were able to utilize SPI to control the score. The pins that were connected were the MOSI, the SCK, and the CSN. The reason the MISO pin was not needed is because the the serial 7-segment LED display was not sending signals back to the master. The SJ-One board was the only module that needed to send signals for output. Each time the ball hit certain sensors and the flippers are switched, points will be added to the total score and displayed onto the 7-segment LED display. In addition, upon startup, words are displayed to prompt the user to start the game.

Once the ball is launched, there will be LEDs along the ramps path that will be lit once the ball has connected the circuit. This wires will be the input that the GPIO driver will need in order to power up the LEDs that are on the side of the ramp. By doing so, we are able to allocate points to the user and the scoreboard, and it will indicate where the ball is on the playing field.

To control the flippers, which are connected to the servos, we utilized PWM, which is Pulse Width Modulation.

Implementation

In order to implement our project, we have included a state diagram that will breakdown each aspect of our pinball machine during a session. Upon startup, the system will either go, or continue waiting for the user to press the two flipper buttons to start. After the user has started the session, the launch will commence. After the user has launched, a gaming session will start. If the ball falls out, the game will end.

Figure 5: State Machine for the entire implementation of the project.

Testing & Technical Challenges

When testing our pinball machine, we began by testing the different components that we had done and working off of that. Once we knew that each part was completed successfully, we started combining the different components together and repeating the testing process.

Issue #1 - Servos

We have had a few issues and a majority of these problems have been due to mechanical oversights. One of the first issues we had when starting our project was because of our servos. While trying to purchase our servos, we were researching which servo would work best for our purpose, which would be to control the flippers. Because we were limited with time, we choose the servos we thought would be the best, but they turned out to be too slow. In order to solve this issue, we had to add gears to increase the speed. One thing we would recommend in regards to key parts of a project, is that you should allocate enough time to research these parts so that fixing them does not require too much work once you have them.

Issue #2 - Serial 7-Segment LED Display

One of the smaller scale issues we had included the first set of 7-segment LED displays that we bought. Because of time constraints, we did not do our research well enough to purchase an LED display that fit our project. The first ones we purchased, we were unsure of how to display data on them because the datasheet did not have the information regarding which pin did what function. Because of this, we decided to consult with Preet about whether we should purchase new ones, or try to add different Gates to get them to work. He suggested we use 7-segment LED displays that could be driven by UART and SPI, which was the current ones we have now (COM-09230).

Issue #3 - Ball

One of the major issues we had was that the ball we initially got for the project was too light for the limit switches to be triggered once on the playing field. Because of this, we ran into other problems. The servos we had were not strong, or fast enough to withstand a ball that was heavier than the ball that we initially have, so we had to think of a different solution. The solution we found was that we should keep the ball that we currently have, and instead of using the limit switches as a detector for the ball, we should just use the 3 bumpers in the middle.

Conclusion

In conclusion, we completed everything we said we would add to our pinball machine. When adding the LEDs to the pinball machine, we did have complications because of the connections at the bottom of the board. One of the things we learned that was most valuable was to read the datasheets and really research the different components you want. In addition, planning ahead and knowing exactly what you want is a good indication that you will get the parts that you need for their specified purpose. Even though we ran into a few of these issues, we were able to make them work. In the case of the servos, we utilized gears to help them with controlling the flippers. Another valuable lesson we learned while conducting this project is the importance of communicating and teamwork. By doing this, we were able to successfully work with one another and create a project that we were all proud of. This project helped increase our knowledge of building a project that incorporated mechanical aspects.

Project Video

https://youtu.be/lYu_lRx3z3U

Project Source Code

References

Acknowledgement

We would like to thank Preet for encouraging us to pursue this type of project, and for teaching us how to incorporate the labs in a real time project. In addition, we would like to thank Dr. Haluk Ozemek for teaching us the fundamentals we needed in order to complete this project.

References Used

List any references used in project.

Serial 7-Segment LED Display (COM-09230) Datasheet https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SFE-0012-DS-7segmentSerial-v41.pdf

Serial 7-Segment LED Display (COM-09230) Power Schematic https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SPI_to_4x7SD-v22.pdf

Sparkfun WAV Trigger 50751 Datasheet https://solarbotics.com/download.php?file=2342

Sparkfun WAV Trigger 50751 Power Schematic https://solarbotics.com/download.php?file=2237

Servo - Hitec HS-85MG (Micro Size) ROB-11887 Datasheet http://cdn.sparkfun.com/datasheets/Robotics/hs85.pdf

Concave Button - White https://www.sparkfun.com/products/9340

8-line to 3-line Priority Encoder http://www.farnell.com/datasheets/93457.pdf

Rainbow Colored LEDs http://www.karlssonrobotics.com/datasheets/Components/LED/YSL-R596CR4G3B5W-F12.pdf

Appendix