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 week's assignment is to Design and program a smart device that performs a certain function or solves a problem: program Arduino UNO to read signals from multiple input components (Sensor, Switch, or variable resistor) to control multiple action components (Motor, Buzzer, LED...etc) using Arduino C (Text Code). 

I care about this idea because I consider this like a step to testing and imagining the idea of the final project.

 inspired by the kid I know who loves dinosaurs and wants to convert everything to games related to dinosaurs.


Tool Chain

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

Cardboard

GLUE GUN

Arduino Uno

Arduino IDE

Fritzing Software

H Bridge - l298-module

LDR sensor

jumper wires

12v lamps

Crocodile Clips

9v Adaptor

Cuter

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?

The Circuit design

as shown in this circuit, I am controlling two lamps in manual mode with on/off switch controls and in automatic mode with an LDR sensor. 

the LDR sensor sends the light state to control two different lamps.

When the Two lamps light reciprocally with fade.

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?

Cicuit Test.mp4

The Circuit




as shown in the video when the light is off and the switch is on the lamps start to light reciprocally.

VID_20230316_222743.mp4

The LDR sensor on the top of the cardboard to it a bigger chance to sense the lights state.


The main circuit place 


the lamp is place in the top of mouth


covering the components in the back of the Head

the place of the on/off switch on the back side  

the wires of another head

The main circuit place in the head 


The Code



I started by identifying the pins (9-11)

with the H bridge 


 then the on/off switch with pin 4


I set the function of every pin I connected (9-8-7-12-11) for the Tow lamps from the H Bridge and 2 as input from the LRD sensor.



and for pin4 made it as input pull-up to make sure the state stays HIGH. When we press the button, the states become LOW. 



I added the if condition to control the effect of the on/off switch.



to make a variable value use a value range from 255 - 5 to make the fade effect reciprocally between the two lamps.


when the LDR sensor takes an input ( the room light is on ) it turned the Lamps off and when the LDR sensor takes an input ( the room light is off ) it turned the Lamps on.  










I added the else condition to Complete the If condition, so when the button is off else started 











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)

The main challenge this week is how to adjust the code to control the Two lamps' to light reciprocally with fade.

 I solved this problem by using the  H bridge - and I asked for help many times in the coding process The answer was to duplicate the last part of the code and use else in two different positions to control the state of the on/off Switch 

Circuit.mp4

Final Project

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

the sketch with the reel dimensions






this week was a big step toward the final project because I Changed the final project idea - this week I draw the model with the reel dimensions and build the circuit and the code


Assignment Design Files