1. light intensity based on room occupancy Simulation
This project is a smart lighting system that automatically adjusts light intensity based on room occupancy using a PIR motion sensor. When someone enters the room, the lights gradually brighten, and when the room is empty, the lights dim down smoothly or turn OFF. The system can also use a relay module to control high-power bulbs. I used WokWI to simulate this and also provided the code for it as well and a link of the simulation at the bottom. Code: #define PIR_SENSOR 2 // PIR Sensor connected to Digital Pin 2 #define LED_PIN 9 // PWM LED pin #define RELAY_PIN 8 // Relay pin for full light ON/OFF int brightness = 0; // Initial LED brightness bool motionDetected = false; void setup() { pinMode(PIR_SENSOR, INPUT); pinMode(LED_PIN, OUTPUT); pinMode(RELAY_PIN, OUTPUT); Serial .begin(9600); } void loop() { int motion = digital...