I always had that problem of hitting my toes against the door or my desk so ,
I decided to make a device that wans you when you get closer to the place that you could hit your toes with and gives you alarm so i decided to use the ir sensor and to make things better i added another system that lights up when it's dark to make sure that there is light in that area all the time it's dark and when the sunlight goes into the room the led stops.
arduino ide for compiling and debugging
I used tinkercad for design
arduino uno
buzzer
IR sensor
jumper wires
led
power supply
photoresistor
I decided to make circuit to simulate the idea on tinkercad and that didn't help me so i used internet sources
as for IR sensor i used the help of this link
input components :
Infrared sensor
Photoresistor
Output components
led
Buzzer
i connected brown wire from ground to the positive side on the breadboard
and the orange fron 5v to the negative side on the breadboard
i connected the ldr sensor to A0
and the other two treminals gnd to the positive side and the vcc to the negative side of the breadboard
i connected the led to 220ohm resistor and the positive to gnd and the negative to pin 9
i connected the ir sensor to pin 13 and the ground to positive in the breadboard and vcc to the negative
lastly the buzzer was connected negatve to ground and positive to pin 12
at first i introduced my components as the led in pin 9 and ldr in pin a0
buzzer in pin 12
ir in pin 12
then i defined my components as input and output then i started the loop that if the read of ldr is less than or equal 80 make the led low
and else make it high
and i did the same with the IR sensor as if the ir is high read then we trun on the buzzer
in the video i started by moving the light next to light sensor then it sensed the we are in the morning and triggered the light to turn off the led
as i approached the other sensor ( IR sensor)
the sensor triggered the buzzer!!
i made he inclosure using a perfume box to make it simple and easy to use
I installed the components inside the box as the arduino facing the opening of the box
i opened holes in the box for the led and the 2 sensors i didn't have to make an opening for the buzzer since it will make sound that will be heared outside
then colsed the box and connected the power source
i had problems configuring the board on my pc by searching i found this youtube video that helped knowing the answer and i tried to use a flame sensor that didn't work that made me switch to my current idea i found out later that the sensor was faulty.
the configurtion of the board was a problem with my pc so i reinstalled the program and that fixed it