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, the idea was inspired by the "Ramadan Lantern", which is the closest application to what will be implemented in the final project. The goal is to make an electronic unit that is sensitive to light. When the light is low, a LED and DC-Motor are turned on in parallel with the possibility of controlling the intensity of the light.

Tool Chain

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

Software:

  1. Tinkercad: To design the electrical circuit, make sure that all parts are working and simulate what will happen in reality, and make the code using blocks.

  2. Arduino IDE: to check and upload the code to the Arduino Board.

Components:

  • Arduino UNO to control all the components.

  • USB Cable to connect Arduino Board with Laptop.

  • DC motor for the movement. 5 VDC - 0.65 A

  • L298N Driver Module to control the power and speed of DC-motor.

  • RED LED 1.8 VDC - 20 mA

  • Resistors - 220 Ohm for LED

  • LDR Module To sense the intensity of light and give the signal to the Arduino board

  • 1K Potentiometer for LED intensity control

  • Breadboard to connect the components.

  • 9V Power-supply

  • Jumper wires + Crocodile wires

Tools:

  • screwdriver to assemble the components.

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?

I used the Tinkercad to design the electrical circuit and make sure that all parts are working and simulate what will happen in reality. and I used the previously mentioned components.

This process was divided into two stages.

In the first stage: I connected the potentiometer with the LED and the PIR sensor instead of the LDR module, but it will do the same function and the code can be generated using it.

Mode: off

Mode: On without using potentiometer

Mode: On while using potentiometer

This code enabled me to turn on the LED using a potentiometer only, and the LED did not turn on automatically when the sensor sensed low light.

This code is completely wrong as it gave two commands to turn the LED on. Which made it light on and off quickly and Consecutive.

In the end, I reached the correct code that makes the LED turn on at low light intensity, and then we can control it through a potentiometer.

Wrong Code Test

The Right Code Test

In the second stage: I connected the Dc-motor, L293D IC, and the power supply to the previous circuit. and edited the code to run the motor also when the LDR sensor senses the low light intensity.

Note: L293D IC = L298N driver module.

Mode: off

Mode: On

Mode: On

when LDR Sensor senses high light

Then I added commands to run the motor to the previous code

Code Test

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?

I started assembling the circuit with the following steps:

  • I connected the positive and negative from the breadboard to the Arduino

  • I connected the LED to the breadboard and the resistor and make the anode of the LED connected to the digital pin number 9 to read the analog voltage.

  • I connected the potentiometer to the breadboard and make its middle-end connected to the Analog pin A0 to control the led light intensity

  • I connected the LDR Sensor module to the breadboard and make its DO Pin connected to the digital pin number 2 to sense the light intensity

  • I connected the DC-Motor to the L298N driver module based on the attached circuit diagram, and the module to the Arduino board using the digital pins 3,4 and 6

  • I uploaded the code using Arduino IDE

  • Test Full circuit. and finally, it works well.

Final Result

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?

Ahmed Abdel Nasser helped me choose the appropriate code to run the circuit, and pointed out several points that help me in programming in general, such as the flow chart, and this will be very useful in the work of the final project.

EO Week Session Exercise

In this week's activity, I learned about the Ultrasonic sensor and writing its code in cooperation with Magdy. We have done more than one experiment using the Potentiometer and Ultrasonic using two servo motors.

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 a problem when uploading the code to the Arduino board, and by searching on YouTube and the Arduino website I found the solution, I followed the steps and tried to discover the error, then I re-uploaded the code and the problem was solved.

Final Project

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

This time I got very close to the idea of the final project, I used almost the same pieces that I will use and generated the code that is similar to what will be implemented in the 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?

I never imagined that I would write code someday, and make it a bit complicated, at least for me!

Weekly Digest [OPTIONAL]

Tell us about any other cool things that you've made this week: in the Hands-on activity, tutorial examples, exercises, or any other cool mini-project that you tried out aside from the assignment.


Assignment Design Files