================================================================================
  Experiment 2: ESP32 LDR Light Intensity Monitoring (Serial Monitor)
================================================================================

FULL QUESTION:
Develop an ESP32 program to read light intensity using an LDR module and display the readings using serial communication.

SHORT QUESTION:
ESP32 LDR Light Intensity Monitoring using Serial Communication.

================================================================================
README & SETUP INSTRUCTIONS:
================================================================================
# Experiment 2: ESP32 LDR Light Intensity Monitoring

## Objective
Read digital ambient light levels using an LDR sensor module and display the status via Serial Communication.

## Hardware Wiring
- LDR VCC -> ESP32 3V3
- LDR GND -> ESP32 GND
- LDR DO (Digital Output) -> ESP32 GPIO 34

## How to Run in Wokwi
1. Load `sketch.ino` and `diagram.json` into Wokwi.
2. Click **Start Simulation**.
3. View the **Serial Monitor** (115200 baud).
4. Click on the LDR sensor in Wokwi and adjust the Lux slider to toggle between BRIGHT and DARK.

================================================================================
SOURCE CODE FILES:
================================================================================

1. sketch.ino
--------------------------------------------------------------------------------
#define LDR_PIN 34

void setup() {
  Serial.begin(115200);
  delay(1000);
  pinMode(LDR_PIN, INPUT);
  Serial.println("LDR Monitoring Initialized.");
}

void loop() {
  int lightStatus = digitalRead(LDR_PIN);

  Serial.print("Light Status: ");
  if (lightStatus == LOW) {
    Serial.println("BRIGHT (Light Detected)");
  } else {
    Serial.println("DARK (No Light)");
  }

  delay(1000);
}
--------------------------------------------------------------------------------

2. diagram.json
--------------------------------------------------------------------------------
{
  "version": 1,
  "author": "IoT Lab",
  "editor": "wokwi",
  "parts": [
    { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} },
    { "type": "wokwi-photoresistor-sensor", "id": "ldr1", "top": 0.3, "left": -159, "attrs": {} }
  ],
  "connections": [
    [ "esp:TX", "$serialMonitor:RX", "", [] ],
    [ "esp:RX", "$serialMonitor:TX", "", [] ],
    [ "ldr1:GND", "esp:GND.2", "black", [ "v0" ] ],
    [ "ldr1:VCC", "esp:3V3", "red", [ "v0" ] ],
    [ "ldr1:DO", "esp:34", "green", [ "v0" ] ]
  ],
  "dependencies": {}
}
--------------------------------------------------------------------------------
