Week 7 - Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

The assignment for this week is to build and program a smart circuit using an Arduino UNO to read signals from multiple input components to control multiple action components using Arduino C (Text Code) .

Inspiration

The Memory Game is a great idea for improving your memory and your ability to focus.

It is thr lighting of LEDs in a random sequence, then you should remember the sequence to win the game.

here I found my inspiration.



Tool Chain

Which software/machines/materials did you use in the assignment? Why?

Software

TinkerCad To simulate and test the circuit before connecting the hardware.

Arduino IDE to upload code to arduino boards.

Components

Arduino Uno to control the circuit.

Breadboard to connect all components.

Jumper wires for connection.

Buttons to connect two points in a circuit when you press them.

Leds to produce light.

Buzzer to produce audio signal.

330ohm Resistors to limit the current.


LCD & I2C Module to display text messages on the screen.


potentiometer to get variable inputs.


Materials & Tools

Cardboard for enclosure of the electronic components.

Scissors to cut cardboard.

Glue gun for assembly.

Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

Circuit Diagram

Inputs & Outputs

  • First, The player chooses the difficult level value from 3 to 30 using the potentiometer.

  • The player presses the start button when he is ready.

  • The game starts to light on a number of LEDs equal to the difficulty level in a random sequence.

  • The player should remember the sequence as possible as he can remember.

  • Then the player enters the buttons in the same sequence as the LEDs sequence.

  • The Arduino checks if the inputs are correct or not.

Designing Process

  1. Wiring the circuit as the diagram above.

  2. Connect LEDs serious to resistors 330ohm to limit the current.

  3. Divide code into parts like function to initialize the game, function to generate the sequence, function to read inputs, function to check the inputs then print if win or lost the game.

  4. Here is the logic of the code.

  • To print welcome message for first time.

  • Wait until the player is ready, read the difficulty level.

  • To initiate the variables before playing.

  • To generate the random sequence of the leds and light them.

  • To check when the player push the button then read it.

  • To compare the inputs values and check if they are right or wrong.

  • To print if player win the game or not.

  • The final sequence of the code after dividing them into parts.

  • Global variables and libraries for the game.

  • The setup of the code to give the pins its direction mode.

Memory Game testing

record_000004.asf

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

Design Implementation

  • Test the components { led, Resistors, potentiometer, buzzer, LCD, Push button, Jumpers } before starting.

  • Connect the components together in the diagram above.

  • Connect led to resistor 330ohm series.

  • Connect buttons to Arduino and ground as we use input pull-up mode.

  • Digging suitable vacuums in the carton to enter the components.

  • Fix the Arduino and mini breadboard in the base to be stable all time.

  • Digging a suitable vacuum to enter the adaptor 5v cable.

  • Test the integration of the circuit after each step.

Final Result

VID_20220918_003753.mp4

Overcoming Challenges

What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)

Software problems

  • I forgot the random function syntax so I search for it on google and I found the implementation here.

  • The library for LCD in tinker is not available in Arduino ide so I asked my instructor for help and he tell me to download "LiquidCrystal_I2C.h" instead of it by the link here.

Final Project

How can you use the skills and knowledge that you've acquired this week in your final project?

  • I learned how to build an organized, logical and smooth Arduino code.

  • The prototype is not very different from the Design, as it needs to measure dimensions first and determine its plan and a logical and arranged path before starting.

Assignment Design Files