Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Light-Activated LED with LDR Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Light-Activated LED with LDR Sensor

Circuit Documentation

Summary

This circuit is designed to read the light intensity using an LDR (Light Dependent Resistor) module and control an LED based on the light intensity. The circuit uses an Arduino UNO microcontroller to read the analog value from the LDR module and turn the LED on or off depending on the light intensity.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0, +, -
  2. LDR Module 3 pin

    • Description: A module with a Light Dependent Resistor to measure light intensity.
    • Pins: VCC, GND, DO
  3. Resistor

    • Description: A 220 Ohm resistor.
    • Pins: pin1, pin2
    • Properties:
      • Resistance: 220 Ohms
  4. LED: Two Pin (red)

    • Description: A red LED with two pins.
    • Pins: cathode, anode

Wiring Details

Arduino UNO

LDR Module 3 pin

Resistor

LED: Two Pin (red)

Code Documentation

Arduino UNO Code

void setup() {
  // put your setup code here, to run once:
  pinMode(A0, INPUT);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int ldr = analogRead(A0);
  Serial.println(ldr);

  if (ldr < 500) {
    digitalWrite(13, HIGH);
  } else {
    digitalWrite(13, LOW);
  }

  delay(300);
}

LDR Module 3 pin Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontrollers.