Header Ads Widget

Responsive Advertisement

Automatic-Street-Light-System-using-LDR-Sensor-and-16x2-I2C-LCD-main

 


Automatic Street Light System

HCI Architecture & System Documentation

👁️ Operational Overview System Logic

This project optimizes infrastructure energy consumption through responsive ambient environment sensory scanning. Using an analog Light Dependent Resistor (LDR) sensor grid, real-time light thresholds automatically determine high-efficiency power output to the street lighting arrays while routing critical metrics to a centralized 16x2 I2C LCD character visualization module.

Light Condition Detected
🌙 Ambient Dark Enclosure
Target Driver Output
⚡ Power Relays Enabled (Light ON)
Light Condition Detected
☀️ Ambient Bright Illuminance
Target Driver Output
🛑 System Power Suspended (Light OFF)
🛠️ Structural BOM Requirements Hardware List

Procure the following components to execute the core prototyping phase layout configurations:

Target Component Label Structural Allocation Quantity Functional Deployment Purpose
Arduino UNO R3 Processing Core1 UnitCentral processing execution loop matrix.
LDR Sensor Transducer Module1 UnitReal-time light intensity observation.
High-Efficiency LED Array1 UnitSimulated smart municipal light element.
220Ω Current Limiting Resistor1 UnitProtective LED inline current barrier.
16x2 Character I2C LCD Display1 UnitHCI visualization terminal for metrics tracking.
Solderless Prototyping Breadboard1 UnitTemporary component interface matrix platform.
🔌 Device Interface Pin Maps I/O Infrastructure

Wire the physical subsystem communication buses in accordance with the following structured bus reference maps:

LDR Sensor Block Wiring Matrix:
Sensor Transducer Node PinArduino Host Mapping Node Pin
VCC (+5V Power Rail)5V Power Output Bus Pin
GND (Ground Return Plane)GND Common Ground Pin Reference
AO (Analog Signal Output Bus)A0 Analog Input Intercept Node
16x2 Character I2C LCD Module Map:
Character Display I2C Board NodeArduino Master Mapping Pin Interface
VCC (Module Power)5V Shared Positive Voltage Rail
GND (Module Ground)GND Shared Reference Ground Plane
SDA (I2C Serial Data Line)A4 Hardware Dedicated Communication Node
SCL (I2C Serial Clock Line)A5 Hardware Dedicated Communication Node
LED Load Signaling Line:

Route the physical Anode (+) lead pin structural channel into Arduino digital node pin D9 through an inline protective 220Ω resistor. Wire the remaining Cathode (-) structural return path directly back into the GND Common Ground terminal node.

💻 Optimized Production Code Engine Firmware Source

Copy and integrate this production-ready code directly into your local desktop Arduino IDE environment:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Initialize character I2C interface address matrix channel profile
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int ldrPin = A0;  // Signal interface line capture channel map
const int ledPin = 9;   // Output system actuation driver route channel

int ldrValue = 0;       // Register placeholder to collect execution metrics

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);      // Setup physical system serial debug stream loop

  // Initialize display window matrix layers
  lcd.init();
  lcd.backlight();

  // Output responsive HCI splash panel confirmation array
  lcd.setCursor(0, 0);
  lcd.print("Street Light");
  lcd.setCursor(0, 1);
  lcd.print("System Ready");
  delay(2000);
  lcd.clear();
}

void loop() {
  // Capture instantaneous telemetry dataset profile
  ldrValue = analogRead(ldrPin);

  // Push telemetry tracking dataset down the active console pipe
  Serial.print("LDR Value: ");
  Serial.println(ldrValue);

  // Dynamic panel refresh cycle to eliminate character ghosting
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("LDR:");
  lcd.print(ldrValue);

  lcd.setCursor(0, 1);

  // Threshold comparator decision matrix logic block
  if (ldrValue > 500) {
    digitalWrite(ledPin, HIGH);  // Activate lighting load
    lcd.print("Light: ON ");
  }
  else {
    digitalWrite(ledPin, LOW);   // Disable lighting load
    lcd.print("Light: OFF");
  }

  delay(500); // 500ms stabilization interval between scan cycles
}
HCI Ergonomic Tip: Depending on specific lighting variables in your test environment, adjust the if (ldrValue > 500) value conditional barrier limit setting to tweak system light sensitivity to match structural expectations.

Post a Comment

0 Comments