The idea of week 7 is to make a project with 2 inputs (If some one is around, The door will be opened automatically) and (If we are at night, A specific lamp will be turned on).
I `ve always liked recycling and minimalist and also liked living a fancy life.
This inspired me to make a smart building that uses electricity only when we need it or when it is after sunset.
I used an ultrasonic sensor that detects if anyone around.
And the light sensor to detect when it is at night.
Arduino UNO
which reads a signal from the (sensor).
I used the LED, resistor, servo-motor, bread board and wires.
Arduino app.
That will allow me to make the design to put all the component inside.
First, I used an Arduino Uno board to control the circuit.(brain)
I used an Ultrasonic sensor to detect the objects on a distance of 10 cm. or less (Input1)
and a light sensor so if we are at night it will turn on a specific lamp. (Input 2)
I put a servo-motor to open the door, if some one is around.(output1)
and also a Red LED that will make red illumination as an alert.(output2)
FIRST define :
trigger pin is no 6
Echo pin is number 10
Servo pin is number 9
we will use Cm as the measuring unit of distance
and the one that will calculate distance is no 10
Second Void:
We will specify the input and output
Finally Void Loop:
If the light sensor can`t detect any light (dark)
turn on the LED
If there is someone around the servo motor will move to open the door
( I used Chat-GPT for the code)
For searching in Chat-GPT (PROMPT)
I wrote: as an Arduino expert write a code for an Arduino that tern on a servo motor when somebody is near 10 cm or less and a code for a LED that will turn on at night.
then I tested the code on Arduino app.
2- Connect the Arduino to the lab-top using the USP cable.
3- Be sure you chose the right USB of Arduino and press upload.
The Arduino UNO Connection
The 5 Volts with a positive N in the bread-board
The ground with the negative N in the bread-board
The Sensor Connections
The Ultra-Sonic Sensor:
VCC to the positive on the bread-board
Triger to 6 on Arduino
Echo to 10 on Arduino
Ground to negative N in bread-board
The Light Sensor
VCC to the positive on the bread-board
D. to 7 on Arduino
Ground to negative N in bread-board
LED
The positive leg to 11 on Arduino
The negative leg to resistor to the negative N on bread-board
Servo-motor
The orange wire will be connected to 9 on Arduino
the red to the positive on bread-board
while the brown is to the negative on bread-board
Don`t worry if the LED didn`t work .
just check the codes and the wires and finally you have to be sure the sensor can detect enough light 😉
I thought that the sensor didn`t work or the code
so I checked every thing even I asked Chat-Gpt.
after I asked the instructors and everyone that may help.
I remembered that my room have yellow low light not high white light. turning on the torch of the mobile solved every thing.
For shooting while I am using the same mobile I used another torch and finally everything is O.K. AL7.
I think I am trying to ask myself questions that may help analyzing the problem.
Inst. Mahmoud told me that and it is working AL7.
I like the team of interns so much.
Happy to have them really 🤩
I bought more materials for making candles this week.
Can`t wait to make more girlish crafts🌷