enerygy saving project, home automation, energy save, fyp energyprojectHello friends, hope you all are fine and having fun with your lives. Today, I am going to share a complete project with you guys. Its an Intelligent Energy Saving System which I designed around two years ago. So, today I thought to share it so that others could also get benefit. In this project, I have used Arduino UNO board for programming purposes. Its not much complicated project but is the basic for many complex projects.

Energy, is a small word, but is the problem of whole world. Particularly when we are talking about electrical energy. IF you consume more electrical energy then you will get quite huge bill at the end of the month. ๐Ÿ˜› So, there’s always work done on reducing the consumption of electrical energy and also we compare energy costs from different providers. As a human, suppose you turn ON your room fan, then normally you forget to turn it OFF and thus your bill keeps on increasing. So in order to avoid this, automation is the only tool which comes in handy. Like there must be such system which automatically detects whether someone is still in the room or not and if there’s no one then lights got OFF automatically. In this way, you can quite easily reduce your electricity cost. This same concept is presented in this project, let’s have a complete look over it. ๐Ÿ™‚

Overview of Intelligent Energy Saving System

  • In this project, we have designed a complete room and used two inductive loads i.e. bulbs and one fan.
  • Now the purpose of this project was to save the energy so we used two IR sensors for counting.
  • Now, if there’s no one present in the room then the loads will automatically turn OFF and when someone will enter in the room then the loads will automatically turn ON.
  • Moreover, we have also added a counter functionality in it i.e. the project will also count the number of people present in the room.
  • All these parameters will also display on the LCD attached with Arduino.
Components Used

I am mentioning here the components used in designing this project. I am not giving the exact values as you will get them in the circuit diagrams. Here’s the list:

  • Arduino UNO
  • IR Sensors
  • 16 x 2 LCD
  • 100W Bulbs
  • 12V Fan
  • 2 Relay Board
  • 7805 (IC Regulator)
  • LED (Indication)
  • Resistance
  • Capacitors

Circuit Diagrams of Intelligent Energy Saving System

Suppose you are designing this project then the first thing you are gonna need is the circuit diagrams for the project so here I am gonna show you all the circuit diagrams step by step so let’s start:

1: Interfacing of Arduino with LCD
  • First thing we are gonna need is the interfacing of Arduino with LCD. LCD used in this project is 16 x 2.
  • I have first designed the simulation in Proteus as its always better to design the simulation before going into real hardware.

Circuit Designing of LCD with Arduino in Proteus ISIS, LCD simulation with Arduino in proteus, lcd arduino in proteus, lcd with arduino in proteus isis

  • Now upload the below code into it, just to test that whether its working fine or not:
    #include <LiquidCrystal.h>
    LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

    void setup()

    lcd.begin(16, 2);
    void loop() {}
  • Now run it and if everything’s gone fine then you will get something as shown in below figure:

Circuit Designing of LCD with Arduino in Proteus ISIS


2: Circuit diagram of 2 Relay Board
  • Next thing we are gonna need is the two relay board. Using these relays we are gonna turn ON or OFF our loads.
  • Here’s the circuit diagram for 2 relay board.

enerygy saving project, home automation, energy save, fyp energyproject

  • As you can see in the above figure, I have used two relay board, where both the relays are controlled bt simple logic operators.
  • Now instead of these logic operators, you need to give Arduino Pins here.
  • I have made the first relay ON while the second relay is OFF.
  • In the above figure, relay outputs are open so you can place anything here as its gonna act as switch. So, in our case the loads will be placed after this relay.
3: Circuit Design of Buzzer
  • Next circuit design which we need to understand is the buzzer circuit design.
  • Its quite simple and similar to 2 relay board. I have also published a detailed post on How to Design a Buzzer in Proteus ISIS, which will be quite helpful.
  • Here’ I am gonna explain it lightly, so let’s have a look at the circuit diagram of buzzer:

buzzer proteus, proteus buzzer, buzzer in proteus,proteus buzzer design

  • You can quite easily understand the above figure, where I have shown both the ON and OFF states of buzzer.
4: Circuit Diagram of IR Sensor:
  • In this project, I have used two IR sensors, both are placed on the door one after another. You can read more about the designing of IR Sensor on my post Circuit Diagram of IR Sensor using 555 Timer.
  • I have named them Entering IR Sensor and Leaving IR Sensor.
  • The logic behind these two sensors is that, when someone enters in the room then he will first pass the Entering IR Sensor and then will hit the Leaving IR Sensor and if someone is leaving the room then he will first pass the Leaving IR Sensor and then will cut the Entering.
  • So, in this way I am counting the persons if someone entering in the room I simply increment and if someone’s leaving then I decrement.
  • Now, if number of people in the room becomes zero then I turn OFF all the lights and the fan, and if there even one person in the room then I turn ON the lights and fan.
  • Here’s the circuit diagram of IR Sensor:

enerygy saving project, home automation, energy save, fyp energyproject

  • IR transmitter and Receiver are not available in Proteus so that’s why I have used the button so when you press the button, its like someone cut the beam of IR sensor, and you will get below result:

enerygy saving project, home automation, energy save, fyp energyproject


5: Complete Circuit Diagram of Intelligent Energy Saving System
  • Now that we have designed the individual circuit diagrams, next thing we are gonna do is the assembly of complete project.
  • So, here’s the complete circuit diagram of this project:

enerygy saving project, home automation, energy save, fyp energyproject

  • As you can see in the above figure, I have used two IR Sensors. The first IR Sensor is for entering in the room while the IR sensor is for leaving the room.
  • Next is the buzzer circuit which is also quite simple and I have explain in detail above.
  • LCD will display the no of people in a room and will also display either the bulb is ON or OFF, and also about Fan status.
  • I haven’t shown the relay circuit in above figure as it will not fit in the space and I think you guys can place it easily.

Programming Code for Intelligent Energy Saving System

  • The code designed for this project is developed in Arduino software.
  • Code is as follows:
#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 8
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

float celsius, fahrenheit;

int Sensor1 = A0;
int Sensor2 = A1;

int Bulb = A5;
int Fan = A4;
int Buzzer = A3;

int Counter = 0;
int Sen1Check = 0;
int Sen2Check = 0;

void setup(void) 
    digitalWrite(Bulb, HIGH);
    digitalWrite(Fan, HIGH);
    digitalWrite(Buzzer, HIGH);
    pinMode(Sensor1, INPUT);
    pinMode(Sensor2, INPUT);
    pinMode(Bulb, OUTPUT);
    pinMode(Fan, OUTPUT);
    pinMode(Buzzer, OUTPUT);
    lcd.begin(20, 4);
    lcd.setCursor(0, 1);
    lcd.print("Temp = ");
    lcd.setCursor(0, 0);
    lcd.print("Counter = ");
    lcd.setCursor(12, 0);

void loop() 
  lcd.setCursor(7, 1);
  lcd.setCursor(12, 1);
  lcd.print(" degC");
  lcd.setCursor(10, 0);
  if(Counter >= 0){lcd.print(Counter);}
  if(Counter < 0){Counter = 0;}
  if(Counter > 0)
      digitalWrite(Bulb, LOW);
      digitalWrite(Fan, LOW);
      digitalWrite(Buzzer, HIGH);
      lcd.setCursor(0, 2);
      lcd.print("Fan : ON ");
      lcd.setCursor(0, 3);
      lcd.print("Bulb : ON ");
  if(Counter < 1)
      digitalWrite(Bulb, HIGH);
      digitalWrite(Fan, HIGH);
      digitalWrite(Buzzer, HIGH);
      lcd.setCursor(0, 2);
      lcd.print("Fan : OFF");
      lcd.setCursor(0, 3);
      lcd.print("Bulb : OFF");


void CheckEntry()
    if(((digitalRead(Sensor1) == LOW) || (Sen1Check == 1)) && (Sen2Check == 0))
        while(digitalRead(Sensor1) == LOW);
        Sen1Check = 1;
        if(digitalRead(Sensor2) == LOW)
            Sen1Check = 0;
            while(digitalRead(Sensor2) == LOW);

void CheckLeaving()
    if(((digitalRead(Sensor2) == LOW) || (Sen2Check == 1)) && (Sen1Check == 0))
        while(digitalRead(Sensor2) == LOW);
        Sen2Check = 1;
        if(digitalRead(Sensor1) == LOW)
            Counter = Counter - 1;
            Sen2Check = 0;
            while(digitalRead(Sensor1) == LOW);
  • Coding isn’t much difficult for this project, but still if you get into some trouble ask in comments and I will check it out.
  • Here’s the complete video for this Intelligent Energy Saving System, which will explain all about the project.

That’s all for today. I hope I have helped you guys in some way. Till next tutorial, take care ALLAH HAFIZ ๐Ÿ™‚


  1. Hello Msr. Syed Zain Nasir.You have done great work.Congratulation!!!
    I want to make a question.Can i replace IR sensors (transmitter + reciever circuits) with IR Obstacle avoidance sensors,which i can buy easily.It will be compatible with other part of the system or not?If it doesn’t work,what type of IR sensors,do you advice me to buy?Please,i need your help.Thank you.

    • Hi,

      The IR sensor I have used in this project is digital, which gives either 1 or 0, so you can use any digital IR sensor here but if you have analog type then you need to do some changes in it. IF you are having problem with your project, then add me on Skype and we will discuss it in detail.


    • Thanks a lot Msr. Syed.I have sent and request in Skype.Can you accept it,and speak about this project?
      One question:Is your adress on skype Syed Zain Nasir,or not?Because i just add this name.Thanks a lot

  2. Hello.What Circuit is inside IR RX?At first,i thought that was the circuit that is shown below (in the photo that is here) but i am not sure.My question is:If it is the circuit that you have design to replace IR Rx,which terminal can i connect to Arduino?From the terminal of LED?
    Thank you.

    • Hi,

      It’s not that difficult, simple commands. ๐Ÿ˜›

      If you are having any issues, let me know and I will explain that.


  3. Hey can you help me with some error messages I got when I uploaded my Arduino code. I got the error message as it follows:

    fatal error: DallasTemperature.h: No such file or directory



    compilation terminated.

    Using library LiquidCrystal at version 1.0.7 in folder: C:\Program Files (x86)\Arduino\libraries\LiquidCrystal
    exit status 1
    Error compiling for board Arduino/Genuino Uno.

    Thank you in advance ๐Ÿ™‚

    • Hi,

      You haven’t added the Dallas Temperature Library for Arduino. You need to download this library from above tutorial or from Arduino’s official site and then place it in the Library folder of your Arduino software. Now restart your software & compile the code. This time, it won’t behave ugly. ๐Ÿ˜›

      Thanks. ๐Ÿ™‚

      • Also can you please tell me which Arduino pins you connect for the relay board??? and at the end where do you connect those pin 8 and pin 9 like where do you connect to the above circuit?

  4. Mostly people leave the public place without turning off lights or fans which are the wastage of energy, in this era of energy crises we need some latest technology to save energy. What system or technology we have to follow in our daily routine for energy saving at public places? How can we utilize this project at public place?

  5. In energy saving project you have also used buzzer, I want to ask why did you use it in circuit ,whatโ€™s its purpose in such kind of project, also clear one thing more how electricity will make it to work?, I want to ask will it give its beep as a signal of warning?

  6. Hello! The given codes are not working ,please help me out. Will be thankful for your quick response. Kindly clear it too do some specific fans with specific voltage are required for this system when it comes to automatically turn on or off ,either they are AC or DC? Whatโ€˜s the limit of people you had set for turning on and turning off the lights and fans automatically? If there are 4 to 5 persons at room and its sleeping time means its night then will the lights turn off automatically or we have to turn them off by ourselves?

  7. Brilliant job! Your project is so good for energy saving at home as well as at public areas but there may be some cases which can trigger the system. Suppose if two persons enter into the room or leave the room at same time without any gap then will the sensors detect them one person or two ?One more confusion if any pet enters or leaves the room then will it be detected or not?

  8. Hey man! Help me to find out What are the programs I can use in designing
    energy saving system in public library, should I follow the same procedure or
    there will be some modifications? And also tell meย how can I assess the energy is
    saving? How can I calculate that how much it is saving?

Leave a Reply

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

Post comment