• Home
  • Courses
  • Machines
    • Transformer
    • AC Motors
      • Induction Motor
      • Synchronous Motor
    • DC Motor
    • DC Generator
  • Power System
    • Circuit Breaker
    • Switchgear
    • Substation
    • Control System
    • Measurement
  • Electronics
  • Blog
  • Contact
    • Contact Us
    • Privacy Policy
Have any question?
[email protected]
RegisterLogin
StudyElectrical.Com
  • Home
  • Courses
  • Machines
    • Transformer
    • AC Motors
      • Induction Motor
      • Synchronous Motor
    • DC Motor
    • DC Generator
  • Power System
    • Circuit Breaker
    • Switchgear
    • Substation
    • Control System
    • Measurement
  • Electronics
  • Blog
  • Contact
    • Contact Us
    • Privacy Policy

Projects

Arduino based Automatic Light Controller

  • Categories Projects, Arduino, Microcontroller
Automatic Light Controller arduino

The automatic light controller offers energy saving and convenience in the areas with a photosensor (LDR). LDR senses the ambient light conditions in the surrounding area and switches ON-OFF the lighting load. The darkness level in the surrounding is settable.

It is in-built with an additional PIR Sensor which TURNS ON Light in the presence of human and switches OFF after 10 seconds if no human detected for energy saving operation.

Thus it provides artificial light only when it is needed. This reduces a large amount of energy wastage and helps in making the most energy-efficient lighting.

Table of Contents

  • Components Needed
  • Circuit Diagram of Automatic Light Controller
    • Program Code
    • Related Articles

Components Needed

The following components are required for making an automatic light bulb controller.
  1.  Arduino Uno
  2. PIR Sensor.
  3. LDR Sensor.
  4. 1k & 10k Resistors
  5. 12V Relay
  6. BC548 Transistor
  7. Switches.

Circuit Diagram of Automatic Light Controller

The circuit is constructed with PIR sensor, LDR and Arduino. Light Load is connected to Relay. Manual on off is possible with given switches.
Automatic Light Controller Circuit Diagram
Automatic Light Controller Circuit Diagram

Program Code

Day night Switch with Occupancy Sensor (Automatic Light Controller)

const int RELAY =12;   //Lock Relay or motor
//Key connections with arduino
const int on_key =3;
const int off_key =2;
int counter =0, manual =0;
//Sensor Connections
const int LDR = A5 ;
const int PIR =4;
//=================================================================
// SETUP
//=================================================================
void setup (){
pinMode ( RELAY , OUTPUT );
pinMode ( on_key , INPUT );
pinMode ( off_key , INPUT );
pinMode ( PIR , INPUT );
//Pull up for setpoint keys
digitalWrite ( on_key , HIGH );
digitalWrite ( off_key , HIGH );
digitalWrite ( PIR , HIGH );
digitalWrite ( RELAY , LOW );        //Turn off Relay
}   //
=================================================================
// LOOP
//=================================================================
void loop (){
//Turn on Lights if Motion is detected and Light intensity is low
if( digitalRead ( PIR )== HIGH )
{
counter =1000; //Set 10 Seconds time out counter
if( counter >15) //Motion detected for 1.5 Seconds
{
if( analogRead ( LDR )>512) //Light intensity is low
{
digitalWrite ( RELAY , HIGH ); //Turn on Lights
}
}
} counter –;
if( counter ==0)
{
if( manual ==0) //Check that it is not manually turned on
{
digitalWrite ( RELAY , LOW );
}
}
//Get user input for setpointsif( digitalRead ( on_key )== LOW )
{
digitalWrite ( RELAY , HIGH ); //Turn on Lights
manual =1; //Manually it is turned on
}     if(digitalRead ( off_key )== LOW )
{
digitalWrite ( RELAY , LOW ); //Turn off Lights
manual =0;
} delay (10); //Update at every 10mSeconds
}//
=================================================================

Related Articles

  • Automatic Irrigation System Using Arduino
    Automatic Irrigation System Using Arduino

    In this project, we will make an automatic irrigation system using Arduino microcontroller. Automatic Irrigation…

  • Controlling a Servo Motor with Arduino
    Controlling a Servo Motor with Arduino

    A servomotor is also defined as a rotary actuator that allows for very fine control…

  • Arduino Digital Voltmeter
    Arduino DC Digital Voltmeter

    A voltmeter is an instrument used for measuring electrical potential difference between two points in…

  • maxresdefault
    An Introduction to the Arduino for Beginners

    What is Arduino? Arduino is an open-source platform used for building electronics projects. Arduino consists…

  • arduino program structure
    How to Structure an Arduino Program?

    If you are new to programming and want to understand how Arduino programs work, read…

  • working led
    Working of Light Emitting Diode (LED)

    A light-emitting diode (LED) is a diode that gives off visible light when forward biased.Light-emitting…

  • Share:
author avatar
Electrical Engineer

Previous post

Difference b/w Microprocessor and Microcontroller
November 27, 2016

Next post

Different Types of Capacitors and their Uses
December 17, 2016

You may also like

Arduino Weather station
Simple Weather Station using Arduino [Explained]
9 September, 2022
arduino program structure
How to Structure an Arduino Program?
16 September, 2021
newbie electronics kits
Beginner Friendly Kits That Most Newbie Used In Electronics
16 March, 2020

Leave A Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search Here

From Blog

adcmotor
Armature Reaction in DC Motors
30Dec2014
dc motor characteristics
Characteristics of DC Series Motor
20Sep2016
Help with Engineering Online
How to Get Help with Engineering Online Free: Web Resources to Hire Assignment Helper
14Feb2022
Sag in Transmission lines
Sag in Overhead Transmission Lines
13Jan2016

Categories

  • Alternator
  • Arduino
  • Basic Electrical
  • Battery
  • Books
  • Cables
  • Capacitor
  • Career
  • Circuit Breaker
  • Control System
  • DC Generator
  • DC Motor
  • Drives
  • Electric Vehicles
  • Electrical Circuits
  • Electrical Machines
  • Electrical Relays
  • Electrical Safety
  • Electronics
  • Embedded System
  • Exams
  • Generation
  • Guest Post
  • HVDC
  • Instrumentation
  • Interview Questions
  • Locomotives
  • Measurement
  • Microcontroller
  • Objective Questions
  • PCB
  • PLC
  • Power System
  • Problems and Solution
  • Projects
  • Resistor
  • Signals and Systems
  • Single Phase Motors
  • Substation
  • Switchgear
  • Synchronous Motor
  • Three Phase Induction Motor
  • Transformer
  • Transmission Line
  • Uncategorized

Copyright © 2021 Study Electrical, Inc.

© StudyElectrical.Com 2021

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now