Idea:
when infrared sensor is on "detects moving object"
LED lights up
Servo motor moves a flower with a welcome message.
When a person enters a space a welcome message moves and light is on
Software :
Tinker CAD:
for circuit simulation and connection of items
Arduino IDE:
For coding and uploading code on real Arduino board
Components:
Arduino UNO board
slider switch
breadboard
jumpers
IR sensor
Servo motor
Resistance for LED
LED
connecting cable (from Arduino board to laptop)
Tinker cad components
Real circuit components
Breadboard
yellow LED
IR sensor
slider switch
Jumpers
Servo motor
Arduino UNO
connection cable
Enclosure Material:
plastic box with sliding cover for components mounting
flower and cardboard for welcome message
Tinker cad Connection
Code blocks "as an initial guide "
Design Phase:The design of the circuit is so simple:
IR sensor ,Servo motor, LED on a breadboard connected with Arduino UNO board
Input component:
Slide switch
IR sensor
Action component:
Servo motor
LED
PSEDOCODE Phase:
الصورة بتاعة الكود
CODEBLOCKS Phase:
As a guide for the required code, I started with code blocks:
Slider switch on pin 8 "input"
Connected servo motor to Pin 9"output"
connected IR sensor to pin 2"input"
LED on pin 4 "output"
IF .. Else condition to control slider switch (on and off), when on:
Servo moves
the LED lights up
Implementing Circuit on breadboard
After making the required connections on tinker cad and simulating the circuit. I built connection on breadboard.
Implementing The Code:
After making the required connections on tinker cad and simulating the circuit. i copied the text code to Arduino IDE
I completed the code by adding extra movement for servo
I changed a bit in code as the IR sensor different from PIR sensor on tinker cad
I changed LED code as didn't work as required when i connected the circuit
after running the code , the slider switch worked then the LED and servo worked as required.
The Enclosure:
After checking the connection i arranged the Arduino, sensors and wires on a plastic box
The IR sensor sensitivity increase and decrease using the screw
This is my second trial project, the project didn't work from third time, but I keep on trying.
Instructors told us its all about try and error so never give up when code didn't work from first time.
I had some problems with coding so i went back to check the videos.
Amani helped me in debugging understanding "Divide and conquer".
pitfalls:
check the sensitivity of sensor before connecting the circuit
Good trial as in final project i will replace the IR sensor with LDR sensor and servo movement will be dependent on sensor reading
be patient while coding.
debugging the code
smart home methodology