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 wanted to do something related to my final project
Is to rotate the part responsible for turning on the shading with a servo motor according to the sunlight and I add a led light to indicate the turning on. so I chose to make the input with an (LDR ) and the output from the servomotor
Tinkercad used to simulate electrical circuits and components, so I can calibrate circuit calculations,
Arduino IDE is used for downloading the code to the Arduino UNO
Arduino Uno
LDR senor
Red led
220-ohm resistor
servo
breadboard
jumper male-male & female male
first connecting Arduino to beard board
connecting servo to pin 10
connecting the + of the servo with the breadboard and Arduino 5V
connecting the _ of the servo in the breadboard and Arduino GND
Input: Read pin 5 (Pir )
-Output: Pin 10 (Servomotor )
I used if condition as if the pin 5 is high ( there is sun light )turn on the led and rotate servo to 180
if there is no sun light turn off the led and rotate servo 0
The led and servo work when exposed to sunlight
coding
Downloading the code to the Arduino UNO using Arduino ide
I started to make the connections on the real breadboard according to the design on Tinker CAD but by using LDR with 3 pins to GND, 5V , and PIN 5 ( DO)
I had a problem using LDR in tinker cad as it doesn't work so I asked Alaa Wahba, my teammate t wasn't accurate to simulate it on tinker cad
The solution is using PIR to just simulate it and in real simulation i used LDR and it worked or search for LDR with led tinker cad
The manual mechanism of my final project
How the mechanism works using electronics and responding to sunlight