Well this week assignment idea was inspired from my sisters as they always come and take my clothes without my permission and even without me noticing it🙄, so I decided to make an alarm system for my wardrobe to let me notice that they opened my wardrobe and this will make them runaway before I come and catch them red-handed.😁
Tinkercad
Tinkercad is a free, web-based application that allows users to create 3D models, electronic circuits, and code blocks in an easy-to-use, beginner-friendly interface. Used for simulation also.
Arduino IDE
Arduino software system used to check and write the code for arduino then upload it on arduino board.
Arduino project hub
used for getting the assignment idea from it
Tools for the circuit on Tinkercad
I used Arduino uno, breadboard, LCD i2c, IR sensor and photoresistor sensor
(Used the same tools for the physical circuit + jumber wires for connections.)
Started by adding the components I need in my workspace and also available in my electronic kit.
Then connected each component to the breadboard and to specific pins on Arduino.
Using photoresistor sensor as an input. (ldr to analog pin A0)
Using IR sensor as 2nd input. (IR to digital pin 6)
Buzzer (pin 9) and LCD i2c screen (SDA to A4 & SCL to A5) as two outputs.
The device is programmed as when the photoresistor sensor feels high level of light (when the wardrobe is opened) and when the IR sensor feels movement or difference in the Wardrobe environment, the buzzer will make sound and the LCD will show " Don't touch my clothes" message.
Used the Liquidcrstal i2c library for the screen.
used the threshold value that serves as a reference point to determine when an action should be triggered based on the input from the LDR sensor. , it helps decide whether the light level is considered "dark" or "light."
Trigger Condition:
If the sensor value (light level) is below the threshold and the IRvalue = High, it indicates that the environment is more bright than the set threshold, and the program will perform a specific action (sound the buzzer and display a message on).
I added the components to the breadboard.
Connected each component to the Arduino as I designed in tinkercad.
Uploaded the code and tested the components.
Then added wire extension the the comment so I can mount it on the cardboard.
Used cardboard, cutter and glue gun to make the device closure.
Then tested the whole device and it worked.
Challenges:
After uploading the code to the Arduino the buzzer was triggered even though I did cover the sensor with my hand and I asked my instructor Ahmed Sami and he told me to try to use the sensor alone and see the outcome value on the serial monitor and I used this code from Arduino project hub to test my Photoresistor sensor.
After testing it I found out that when the sensor is in the dark it get the high values such as 1019 but when it sense high light is gets lower values such as 722 and that was odd cause normally in the dark the values should be from 0 to 400, but this helped me to adjust the condition for the device as I got the average value for my room light which was approximately 750 so in the code I said when the sensor feels light bellow 750 (room light) the buzzer will make sound but above that (Dark) the buzzer and the screen won't work.
Will in this week I learned more about electronics and coding based on texting and more importantly I learned how to use and code the LCD screen cause its one of my project components.
Title of Media
Title of Media