• Home
  • Courses
  • Machines
    • Transformer
    • AC Motors
      • Induction Motor
      • Synchronous Motor
    • DC Motor
    • DC Generator
  • Power System
    • Circuit Breaker
    • Switchgear
    • Substation
    • Control System
    • Measurement
  • Electronics
  • Books
  • Blog
  • Forums
  • Contact
    • Contact Us
    • About
    • Privacy Policy
RegisterLogin
StudyElectrical.ComStudyElectrical.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
  • Books
  • Blog
  • Forums
  • Contact
    • Contact Us
    • About
    • Privacy Policy

Projects

  • Home
  • Blog
  • Projects
  • Arduino based Automatic Light Controller

Arduino based Automatic Light Controller

  • Categories Projects, Arduino, Microcontroller
ard

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.

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
}//
=================================================================

  • Share:
author avatar

Previous post

Difference b/w Microprocessor and Microcontroller

Next post

Different Types of Capacitors and their Uses

Leave A Reply Cancel reply

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

Login with your site account

Connect with

FacebookGoogleLinkedIn

logo


Lost your password?

Not a member yet? Register now

Recent Articles

  • The 6 Flow Meter Types that Your Business Needs to Know About
  • Going Beyond Theory And Books: High-performance Liquid Chromatography
  • How to Select an Electronic Contract Manufacturing Partner
  • 7 FE Electrical and Computer Practice Problems with Solutions
  • Sinusoids and Phasors
For Advertisements Contact
[email protected]

Copyright © 2020 Study Electrical, Inc.

© StudyElectrical.Com 2020

Connect with

Login with Facebook Login with Google Login with LinkedIn

logo

Login with your site account

Connect with

FacebookGoogleLinkedIn

logo


Lost your password?

Not a member yet? Register now

Register a new account

Connect with

FacebookGoogleLinkedIn

logo


Are you a member? Login now