Imagine a building that breathes with the rhythm of day and night! During the sunny hours, our facade elegantly opens up, inviting warm rays of sunlight to fill the interior with natural light.
As dusk falls, our facade gracefully transitions to a closed position, wrapping the structure in a protective embrace.
This dynamic interplay between openness and closure transforms the facade into a living component of the architecture, attuned to the environmental conditions and the needs of its inhabitants.
Arduino Light Detector Magic
- Light Sensing Action :
- At the core, we have a Photoresistor Sensor. It’s like an eye for the Arduino, reading the ambient light level .
- The sensor is connected to *A0, powered by **5V, and grounded with a *10kΩ resistor. Think of it as the eyes detecting whether it’s light or dark outside!
- Making a Decision :
- Once the sensor reads the light (called lightLevel), it checks if the light level is below a certain lightThreshold. This is the light vs dark check!
- It’s like asking: “Is it dark enough out there?”
- The Choices :
- If YES (It’s dark):
- The Servo Motor (connected to Pin 9) spins Clockwise to position 0!
- At the same time, 6 LEDs (connected to Pins 2-7) light up to brighten the space!
- If NO (It’s light):
- The Servo Motor spins Counter-Clockwise to position 180!
- The 6 LEDs turn OFF, keeping the energy for when it’s needed!