Week 7

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)

I was inspired by smart Home Systems, when the room gets dark the lights go on & the alarm goes beep beep, so I tried to create a system that gives a warning & turns the lights on when it gets dark. 

Tool Chain

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

Software

Arduino IDE

TinkerCad

Tools

Glue Gun

Scissor

Tape 

Cutter

Materials

Wires

LDR Sensor

BreadBoard

green LED

Resistor 330/220 Ohm

ON/OFF Switch

Buzzer

USB Cable

Arduino UNO

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?

Designing 

1- install all materials we are going to use 

2- Connect all components on the breadboard (Parallel).

3- start the  STIMULATION .feature to make sure every component is working.

I connect the

n& GND connected to a GND of Arduino & DO connect To digital pin 5.

Circuit on Tinkercad

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?

1- Connect all components on the breadboard and Arduino Uno in tinkercad.

2- Connect all components on the breadboard and Arduino Uno.

3- Writing the code on Arduino IDE.

4- Uploading the code to the Arduino UNO.

5- Testing the circuit


Circuit Before Connection

Circuit after connecting it

// HERE IS THE EXPLANATION OF EACH PIN 

int LDRInput = 5;  

int LED = 2;

int BUZZER = 3;

int BUTTON = 4;

void setup() {

// HERE IS DECLARING OF INPUT & OUTPUT

  Serial.begin(9600);

  pinMode(LDRInput, INPUT);

  pinMode(BUTTON, INPUT_PULLUP);


  pinMode(LED, OUTPUT);

  pinMode(BUZZER, OUTPUT);

}


void loop() {

  // int value = analogRead(LDRInput);  //Reads the Value of LDR(light).

  Serial.println("LDR value is :");  //Prints the value of LDR to Serial Monitor.

  Serial.println(digitalRead(5));

  Serial.println("BUTTON VAlue is :");  //Prints the value of LDR to Serial Monitor.

  Serial.println(digitalRead(4));

  delay(1000);

  if (digitalRead(BUTTON) == LOW) { // HERE IS THE LOOP START WITH CHECKING IF THE BUTTON IS WORKING OR NOT


    if (digitalRead(5) == HIGH) { // IF THE BUTTON IS ON SYSTEM START WITH THE LDR SENSOR IF IT SENSE DARKNESS 


      digitalWrite(LED, HIGH);     //The LED turns ON in Dark.

      digitalWrite(BUZZER, HIGH);  //The LED turns ON in Dark.

      delay(100);


      digitalWrite(BUZZER, LOW);  //The BUZZER turns OFF in Dark.


    } else {// IF THE BUTTON IS OFF SYSTEM EVERTHING WILL STOP

      digitalWrite(LED, LOW);     //The LED turns OFF in Light.

      digitalWrite(BUZZER, LOW);  //The LED turns ON in Dark.

    }

  }

}


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)

I got a nice problem I thought when I connected both the Analog pin & Digital pin in LDR and then set Analog Read only in Coding it going to help me to turn the lights on/off 

so I Consider only the Analog Read but when I Start verifying everything going good then I uploaded the code on Arduino here comes the problem I could light the LED 

    if (analogRead(5) == HIGH) {

Then Ibrahim and Menna, Helped me with understanding how the LDR Sensor works then we change the code and consider only Digital Read, then it works nice.

    if (digitalRead(5) == HIGH) {

I Wish I had pics of the whole situation but unfortunately  

Final Project

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

I Learned how to design a circuit and code it with tinker cad to know how to design & code electrical circuits by using Arduino IDE, it is going to help me to code my final project.

WOW!

What is the coolest thing that you've learned this week? What is something that you will never forget from this week?

Assignment Design Files