My assignment's idea for this week is creating a smart lighting system, when someone approaches the room, the led will light up.
I personally care about this idea because i believe it's an energy saving feature and it also saves the hassle of turning on the lights.
I was inspired from some smart lighting systems in the TV-shows where it shows that it only lighten up when someone is near.
1-Software :
TinkerCad
Arduino Coding
2-Tools & materials:
Arduino UNO
Microwave Sensor
LED (White)
220 ohm Resistor
Mini breadboard
Female Jumpers
USB Cable
First, I planned my circuit and tested it on tinkercad:
First, I picked the components, and I used the PIR Sensor instead of the Microwave sensor as it doesn't exist on the tinkercad.
I connected the led to the resistor.
I connected the led's end to digital pin 7 and the resister to the ground
I connected the PIR Sensor to (Digital Pin 8 - Voltage - Ground).
Then, I worked on the blocks.
I compared digital pin 8 to High using the math comparing feature.
Then I added an If condition, stating that if it's indeed high (meaning, if the sensor is sensing someone moving around), Pin 7 (LED) would be set to High, and after waiting for 5 seconds, it'll be turned off.
If Digital Pin 8 doesn't read high, the led won't turn on.
Finally, I tested the functionality of it by simulating the circuit as shown in the video.
I tested my connection on the arduino:
First, I converted the blocks code to block and text, and I copied the text to the Arduino coding program.
I connected the female jumpers to the breadboard following exactly what I did on tinkercad.
I connected the USB to the arduino, and I uploaded the code to it.
I hovered around the microwave sensor and it did sense my movement and the led got turned on.
I wanted to use the microwave sensor as it wasn'y used combined with the led before to test it out but it didn't exist on the tinkercad, so Amany told me to use the PIR instead.
Coding with blocks and using arduino to act like the brain of the project.
Coding using arduino blocks and then converting it to text, it felt like actually coding.
The Waving hand.