Final Project Journal

Project Ideation

1- Tell us about the idea of your project. Why do you care about this? What were you inspired by? Include images and videos of similar projects

Hi, First I want to make a quick game to avoid boredom. So, I inspired by my childhood in which I used to buy a laser and begin to play with it. But after a specified hours, I begin to be bored.
So, I decided to make a laser shooter game. So, I can Bring back childhood memories but never bored.

In This game, Player must shot the right LDR quickly to win it or the player score will decrease.

I decided to make this game because it creates a spirit of competition to win the game.

Project Construction

2- Explain the CAD process of your project. How did you use the software to design your project? (List the softwares/tools/materials...etc that you used)

Fusion 360

I used Fusion 360 Software to design sketches of game and assembly 3D design of Laser Shooter Game.

Inkscape

I used Inkscape Software to add texts on the body to make it as speed cut.

Grab Cad

I used Grab Cad Website to insert components like LCD, Joystick and Switches to project it.

Fusion 360

  • First, I begin to sketch up:

  1. Front View.

  2. Back View.

  3. Side 1 View.

  4. Side 2 View.

  5. Top View.

  6. Bottom View.

  • Front View

  1. I Start to sketch front view in fusion 360. I used rectangle tool and begin to calculate dimensions that my project will be in.

  2. I measured diameter of LEDs and LDRs and begin to calculate distance between them and begin to make its holes in my front view design.

  3. Finally, Finish sketching and extrude it with 3.2 mm and Extrude cut holes of LEDs and LDRs.

  4. I used some components from Grab Cad and insert it into my design to make project.

  • Side View:

Then, I Start to sketch Side view. So, I begin to sketch rectangle with dimensions of side 20 cm * 40 cm. Then, I begin to sketch T-Slots in the corners of design.


1- Finish sketching and extrude it with 3.2 mm.

2- In Side View With Power Sources I import an arduino design from Grab Cad and make project from it into side sketch and Then Extrude it Cut.

  • Top & Bottom View:

Then, I Start to sketch Side view. So, I begin to sketch rectangle with dimensions of side 20 cm * 40 cm. Then, I begin to sketch T-Slots in the corners of design.


1- Finish sketching and extrude it with 3.2 mm.

2- In Side View With Power Sources I import an arduino design from Grab Cad and make project from it into side sketch and Then Extrude it Cut.

  • Back View

  1. I Start to sketch front view in fusion 360. I used rectangle tool and begin to calculate dimensions that my project will be in.

  2. Then, I begin to sketch T-Slots in the corners of design.

  3. Finish sketching and extrude it with 3.2 mm.


Final.mp4

3- Explain the fabrication process of your project. How did you use the machine to fabricate your project? (List the softwares/tools/materials...etc that you used)

Laser Cutter machine to cut the wood or the Acrylic Sheet

Laser Cad Software to give parameters of cut and engrave and speed cut to parts of the 2D Design

MDF

I used MDF Sheets as a material of my project.

Acrylic Sheet

I used Acrylic sheet as a material of front view to give the project a beautiful look

At First, I Started to Save Fusion Sketches into DXF Format.

Then, I Started to import it in laser cad to edit parameters of cut and speed cut, And give it a text of LASER SHOOTER GAME and the other text FOCUS..SHOT...WIN.

  • Parameters "ِAcrylic" :

  1. For Cutting speed of 20 , Power 70.

  2. For Speed Cut speed of 300, power 45.


  • Parameters "ِMDF" :

For Cutting speed of 20 , Power 70.

Side View Cutting on laser Cutter

At First, I downloaded dxf file into laser cutter machine

put sheet of MDF wood into laser cutter machine and started to set origin and check Box. Then, I press start button to give the machine to cut the wood.

Top & Bottom Cutting on laser Cutter
Acrylic Cutting on laser Cutter
Acrylic Sheet
Sides
Project Box
Top && Bottom

Project Electronics & Power Management

4- Describe your electronic circuit. What are the input and action components? What is the function of each? How do the components integrate together to form your smart system? (List the softwares/tools/components...etc that you used)

Arduino IDE for uploading the code on the board.

LCD 2*16 to display and interactive with gamer

Resistor 330 ohm to limit the current.

Buzzer to make a sound of loose or winning or getting a point

Breadboard for wiring all the components.

5 LEDS For determining which goal must shot

Arduino uno will act as the brain of my project. Taking input and perform actions

5 LDRs to sense the laser beam which is being shot by player

Joystick to interactive with welcome screen at the begining of the game

I/O In Project

  • The project has Two inputs:

  1. The first input is from joystick in the beginning of the game to check if the player are ready for the game or not.

And Then this input will not be taken again until the game was restarted.

  1. The second input was from the player and it's considered that laser beam will be the input creator.

  • The project has 5 Actions:

  1. The first action is in the beginning of the game, A short initial Animation will be displayed by LEDs and LCD will display "Hello,, Hello".

  2. Then, 2 Screens Displayed in LCD to Check if the player is ready to play or not.

  3. While playing, Random LEDs will Be lighten, If the player shots the right LDR, Buzzer tone will be made and another LED will be lighten, And Score will increased by one.

  4. If the Player shots right Quickly, Win animation will displayed and Winner Sentence will displayed in LCD in addition to Score.

  5. If the Player didn't shots right Quickly, lose animation will displayed and Game Over Sentence will displayed in LCD in addition to Score.

Project Functionality

  • At First, when the power delivered to arduino and circuit. A short initial Animation will be displayed by LEDs and LCD will display "Hello,, Hello".

  • Then, Screen will display a sentence that asks if the player are ready or not, You are holding the laser beam or not, And it tells him if he is ready please press the button of joystick.

  • when he pressed the button, Another screen will displayed to check if he totally ready or not and asks him to press button again if he totally ready.

  • Then , The game will start and a random LED will be lighten and the player must use laser beam to shot the LDR which under the lightened LED and he must do that very fast.

  • While the game is running and the player shots the goals very fast many times, He/She will win and LCD will display a screen told the player that he is a winner and displayed his/her Score.

  • If the player take a long time until he shots the right LDR, He/She will lose and LCD will display a screen told the player that he is a looser and Game Over and displayed his/her Score.

I Used Tinker Cad to show circuit wiring of my project because there is many jumbers in real :(

I Also replaced LDR module by PIR Sensor to act as the input receiver of laser beam.

I also unfortunately didn't find joystick on tinker cad. So, I replaced it by using a simple push Button.


  • Wiring Description:

  1. I Connect LEDs (from pin 2 to pin 7 except pin 6).

  2. I Connect LDRs from pin 9 to pin 13.

  3. Buzzer on Pin 6.

  4. Push Button on pin 8.

  5. LCD SDlL/SCL on Analog pins A4, A5.

5- What is your power source? How did you select the suitable power source for your project? (List the softwares/tools/components...etc that you used)

At First, I got the power from my laptop and thought the arduino cable to get 5v from arduino to my circuit, That's because all my circuit works on 5 volt.


Then when I integrate the project with each other, I prefer to power my circuit with adapter 9v to the arduino to give all sensors the right power without any leakage or voltage drop.

Note:

I Used 9v Adapter because I Powered Arduino board first and Get 5v From Arduino, So to take 5v from arduino board, we must connect more than 5 v to the arduino board.

Project Programming

6- Describe the code of your project. How did you program each function of the project?

Coding Time

Here, I started to include libraries that I will use like LCD library (I2C).

Then, I begin to define an array of variables for LEDs (from pin 2 to pin 7 except pin 6) and another array for LDRs from pin 9 to pin 13, And I defined buzzer variable on pin 6 And finally I defined a variable for Joystick Button on pin 8.

I also make boolean variables to act as a flag for me to detect wheather the player win or lose


Then, I started to define my Input / Output pins and initalize Lcd display light using lcd.init(), lcd.backlight() functions

I made an inimation in the begininng of the game with buzzer and LEDs using init animation() function.

In Void Loop Function, First I called LCD() function which displays the welcome screens to the player and check if he is ready or not.

Then, When player exits LCD() function, gameRunning variable will be true and the game will started using calling of game() function.

In LCD() Function, At First, it checked that screen changed or not, and begin to go into a switch case which is responsible for switching between 2 screens.

The Change of Screens is depend on Button Pin of Joystick which controls Screens.

Finally, If Screen Numbers == 2 (The num of screens), The gameRunning Boolean variable == true which is responsible for beginning the game. So, After That, The game will Start.


Game function will call LEDS() function which is responsible for creating and generating a random sequence of lightening LEDs.

Then I called CheckShot() function which is responsible for Check if the player shots the right LDR or not.

In CheckShot() function, It checked if the player shot the right LDR or not using its index.
On it, It also make Counter increased by one if the player shots the right LDR and if he didn't it make the counter reduced by 2 points.

Secondly, It Checked if the player's score is greater than 3 points in series and quickly, The player will win and The Win Game() function Wil be called.

But, If the player hasn't shot the right LDR quickly, his/ her score will reduced by 2 and If the Score of the player reached == -5, The Player will Loose and endGame() Function will be called.

In parallel of these function LCD Displayed "Focus" When the Player begin to shot on the goals, And it also displayed "Game Over" if the player lose.
And It Also displayed Winner when the player win the game.

In end Game() function, If the player didn't shot the right LDR, The LCD displayed "Game Over" and the player lose the game and finally Displayed the player's Score.

But, In win Game() function, If the player shot the right LDR, The LCD displayed "Winner" and the player win the game and finally Displayed the player's Score.

Project Integration & Testing

7- Demonstrate with text and visuals how did you integrate the project’s modules together? What are the testing results? (Include a Demo video separately, showing a proof of functionality)

At First, I wired circuit together with Full LDRs and LEDs and begin to test it in Acrylic Front View after putting LCD and LEDs.

Then, I Started to assemble wooden parts with each others to make the body of the game.

Then, I Integrate Parts with each others using screws and nuts only, And then I started to do the first Test to check all features of the game.

Sharing & Collaboration

8- Did you ask for feedback? What are the ideas that others have contributed or suggested? What was someone else’s idea that you built upon? How did you help your peers? How did your peers help you?

When I was Testing the Circuit in lab, Ibrahim asks me if there is a condition that allows to the player to win.


So, I liked the idea and begin to make a function that allows to the player to win if he /she shots many goals quickly.


Also the beginning screen of the game was an idea of my friend who told me to make this cool idea.

Overcoming Challenges

9- When you got stuck, what/who did you turn to? At what point did you have to pause to research or learn more before moving on? What are some mistakes, pitfalls, or challenges that others can avoid if they were doing this project?

I Faced many problems in this project, And all of them are in Coding:

  • The first problem in code that code was difficult to understand and order it as a code. But after many time of concentration I begin to write what I want into a white Paper and do it step by step.

  • The Second Technical problem I faced that I wanted to make a Welcome Screens to greet the player before playing, But I didn't know how to make it.
    But, I searched on YouTube and this
    tutorial helped me a lot.

One of the problems which I faced and I didn't know how to fix it that jumbers are so short to connect it into arduino and breadboard.


But I asked
megoo, He Told me to use the cables of the internet to make the wires tall enough to reach Arduino board and the Bread Board

Future Work

10- If you had more time, what is one thing you would change/ Do next in your project?

If I had enough time, I will make a second game to allow to the player to play 2 games if he want that.
So, If have time, I will make memory game using LDRs and LEDs instead of bush buttons.
I also will add a sub feature that there will be a menu to the player which make him choose which game he want to play.

Final Project Design Files