Week 6

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 inspire by Home Security Systems, where for every unusual movement the alarm goes beep beep, so I tried to create a system that gives light when someone gets in the zone of the sensor. (like a singer stage)

Tool Chain

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

Software

Arduino IDE

TinkerCad

Materials

Wires

Ultrasonic Sensor

BreadBoard

green LED

Resistor 330/220 Ohm

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 (Tinker CAD)

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.

Coding by blocks in (Tinker CAD)

1- from variables create  a new block named it with Ultrasonic_sensor, then i choosed set Ultrasonic_sensor to.

from input, we choose read the ultrasonic sensor on trigger pin & echo pin 

2- from output I choose print to serial monitor to know if the code working well.

3- from control I choose if - else. 

4- then I set from math 1 < 10 then I put from variables ultrasonic_ sensor.

5- from output I choose set pin to HIGH to put the pin I connect in the circuit that is responsible for LED.

6- then I set it to LOW to let the LED stop if the condition isn't occurred ultrasonic_ sensor didn't receive any movement

circuit after connecting it

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.

2- Make the block code on tinker cad.

3- Test the block code on tinker cad by starting the STIMULATION .

4- open blocks & text then Copy the text of the code I made on tinker cad, then paste it on Arduino IDE.

5- Uploading the code to the Arduino UNO.

6- Testing the circuit


// C++ code

//

int ultrasonic_sensor = 0;


long readUltrasonicDistance(int triggerPin, int echoPin)

{

  pinMode(triggerPin, OUTPUT);  // Clear the trigger

  digitalWrite(triggerPin, LOW);

  delayMicroseconds(2);

  // Sets the trigger pin to HIGH state for 10 microseconds

  digitalWrite(triggerPin, HIGH);

  delayMicroseconds(10);

  digitalWrite(triggerPin, LOW);

  pinMode(echoPin, INPUT);

  // Reads the echo pin, and returns the sound wave travel time in microseconds

  return pulseIn(echoPin, HIGH);

}


void setup()

{

  Serial.begin(9600);

  pinMode(11, OUTPUT);

}


void loop()

{

  ultrasonic_sensor = 0.01723 * readUltrasonicDistance(13, 12);

  Serial.println("hello world");

  if (ultrasonic_sensor < 10) {

    digitalWrite(11, HIGH);

  } else {

    digitalWrite(11, LOW);

  }

  delay(10); // Delay a little bit to improve simulation performance

}

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 couldn't know how to stimulate the ultrasonic sensor on tinker cad

I googled it, so I knew that I should click on the sensor to make the action (if condition i made on the code).

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 tinker cad, it is going to help me to design & 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