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)

This week's assignment was to build and program a smart circuit using the Arduino UNO which reads a signal from an input component to control an action component using Code Blocks

I started to think of an Idea that can depend on multiple sensors to control output components of light, sound and movement, and I came up with an Idea of making a closed box with a gift inside which starts to make beep sound when the light goes off, so that you follow the sound until you get near enough to the box and only then the beep sound will stop, and the box will be opened with flashing light inside and you can find the gift!
This time I didn't try to search for similar ideas, I just started to create my own

Tool Chain

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

Software Used for design and simulate the electrical circuit: TinkerCAD

Software Used for downloading the code to the Arduino UNO: Arduino IDE

Modeling Material:

Card Board

Tools:

Tape - cutter - double face

List of Components Used:

  • 1 Servo Motor

  • Ultrasonic Sensor

  • 4pin Photoresistor, LDR Module

  • Ultrasonic Sensor Module HC-SR04

  • 2 LED 5mm (Red & White)

  • 2 Resistors 220 ohm

  • Breadboards

  • Plug wires

  • Piezo Buzzer

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?

I started with designing the circuit on the Tinker Cad first to make sure that the components are fully functional and the desired outputs from the components are achieved, then I can go with the actual wiring and connections on the bread board, and finally I can model the final device and test

Circuit Design

I started the design by adding and wiring all the components first, I used the "light Sensor" to trigger on the "Piezo" to start beeping, then I used the "Ultrasonic" sensor to stop the beep sound, turn on the 2 LEDs, and start the servo motor to open the box

Coding using code blocks

The next step, I started to build the code block that will control all the components to the desired outcome

since the Idea include an action that depends on an input, and this input will also be depending on another input, so I started with 2 IF/ELSE blocks one inside another,

the first condition will require a comparison between the value returned from the "Light Sensor" and the "High" value which means the room light is turned on

If the condition is true the result will be that the servo stays at 0 degree and the 2 LED are OFF (the box remains closed) and also no beep sound will start

Else, if the condition is wrong which means that room light is turned off, then the second condition will be checked between the value returned from the ultrasonic sensor and the required distance of the standing person in front of it, which I set at 30 cm

If the condition is true which means that the standing person is more than 30 cm away from the box, then only the beep sound will start

Else, if the condition is false which means that the standing person is near to the box, then the "Speaker" will be turned off , the servo will rotate to 175 degree to open the box and the the 2 LEDs will be turned and off in an alternate sequence with delay of .5 seconds

Simulation on Tinker CAD

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?

Circuit prototyping

I Started to make the connections on the real bread board according to the design on Tinker CAD except for the connection to the photoresistor, I connected according to the real sensor with 3 pins (positive, ground, signal)

Downloading the Code to the Arduino & Simulation

Finally I copied the code to the Arduino IDE software and downloaded it to the Arduino, I only had to make one final adjustment of changing the first condition of the photoresistor from "High" to "Low" because the real sensor is different from the one on the Tinker CAD

The Final The Final Outcome

Finally, using some cardboard I made a box with a cover that can be opened, I fixed the bread board inside the box, and fixed the Arduino with some screws and nuts, and made openings for the ultrasonic sensor on the front, and another for the light sensor on the side, then I fixed the servo motor in place using double face tape, and made a hinge connection with a piece of metal and an old pin tube

Community of Learning

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?

Overcoming Challenges

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 assignment?

I faced some challenge with the photoresistor sensor, as it was different on Tinker CAD than the reality, it has only 2 terminals on Tinker CAD and after some search I found that it requires a resistor on the ground terminal and also to be connected to the input pin on the same terminal, while the other terminal to be connected to the positive 5V

Final Project

How can you use the skills and knowledge that you've acquired this week in your 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