Automatic Lighting Control System - Electronic Engineering Guide
1. Introduction
An Automatic Lighting Control System controls the operation of lighting systems based on ambient light levels or human presence. Such systems are used to conserve energy and improve convenience by automating lighting in homes, offices, and public spaces.
2. Objectives
• To automatically turn lights ON/OFF based on motion or
ambient light.
• To reduce energy consumption.
• To enhance user convenience and automation.
• To implement a reliable and scalable system.
3. Components Required
• Arduino Uno / ESP32 / NodeMCU
• PIR Sensor (Motion Detection)
• LDR (Light Dependent Resistor)
• Relay Module
• LED / Light Bulb
• Power Supply (5V DC)
• Resistors, capacitors, jumper wires, breadboard
4. System Overview
The system uses an LDR to measure ambient light levels and a PIR sensor to detect motion. When motion is detected and the light level is below a certain threshold, the light is turned on automatically via a relay. After a predefined delay or when no motion is detected, the light is turned off.
5. Sensor Operation and Placement
• LDR is positioned to face ambient light without
interference from the light it controls.
• PIR sensor is placed to detect human movement in the desired area.
• Sensitivity and delay time for PIR can be adjusted using onboard
potentiometers.
6. Microcontroller and Circuit Integration
• LDR connected to an analog input pin to measure voltage
drop based on light.
• PIR sensor connected to a digital input pin to detect motion (HIGH/LOW
signal).
• Relay module connected to a digital output pin to switch the lighting load.
• Use opto-isolation on the relay for safety.
7. Power Management and Relay Control
• Relay is used to control high-voltage lighting (AC) using
low-voltage (DC) microcontroller logic.
• A flyback diode across the relay coil is necessary if using a mechanical
relay.
• Ensure isolated and regulated power supply to microcontroller for stable
operation.
8. Circuit Design and Working
• The LDR and a fixed resistor form a voltage divider.
• The PIR sensor provides digital HIGH when motion is detected.
• Logic checks motion and ambient light to control the relay.
• Output pin activates relay when both conditions (dark + motion) are
satisfied.
9. Software and Code Explanation
Arduino Example Code:
#define PIR 2
#define RELAY 3
int ldrPin = A0;
void setup() {
pinMode(PIR, INPUT);
pinMode(RELAY, OUTPUT);
Serial.begin(9600);
}
void loop() {
int ldrValue = analogRead(ldrPin);
int motion = digitalRead(PIR);
Serial.print("LDR: ");
Serial.print(ldrValue);
Serial.print(" PIR: ");
Serial.println(motion);
if (ldrValue < 500 && motion
== HIGH) {
digitalWrite(RELAY, HIGH);
} else {
digitalWrite(RELAY, LOW);
}
delay(1000);
}
10. Applications
• Residential lighting automation
• Office and commercial buildings
• Streetlights and parking areas
• Public restrooms and corridors
11. Challenges and Enhancements
• False triggering in noisy environments.
• Delay tuning for user comfort.
• Use of IR or ultrasonic sensors for enhanced detection.
• Integration with IoT for remote control and monitoring.
12. Conclusion
Automatic Lighting Control Systems enhance convenience and reduce energy consumption by intelligently responding to environmental conditions. This project provides a foundation for scalable smart lighting solutions using sensors and microcontrollers.