Você está na página 1de 97

FINAL YEAR PROJECT

REPORT
PROJECT NAME:
Led Lamp
GROUP MEMBERS:
Summaira EE-185
Neha Naushad EE-190
Sidra EE-194
INTERNAL:
Sir Hassan-ul-Haq
1
TABLE OF CONTENTS

LIST OF FIGURES...............................................................................................................iv

LIST OF TABLES.................................................................................................................vi

ACKNOWLEDGEMENT....................................................................................................vii

ABSTRACT........................................................................................................................viii

CHAPTER 1- INTRODUCTION...........................................................................................1

1.1 LIGHT EMMITING DIODE:...........................................................................................1

CHAPTER 2- BACKGROUND.............................................................................................2

CHAPTER 3: WORKING......................................................................................................3

3.1 PROTOTYPE:..................................................................................................................3

3.1.1 PCB DESIGNING:...................................................................................................3

3.2 OPERATION OF LED LAMP VIA BLUETOOTH DEVICE:........................................5

3.2.1 EXPLANATION OF THE CODE:.........................................................................17

3.3 OPERATION OF LED LAMP VIA ESP 8266-01:.........................................................19

3.3.1 BACKGROUND OF ESP:.....................................................................................19

3.3.2 WORKING:............................................................................................................20

3.3.3 ARDUINO CODE FOR ESP 8266:........................................................................22

3.3.4 WEBPAGE CODE FOR ESP 8266:.......................................................................31

3.3.5 JQUERY:................................................................................................................36

3.3.6 OBTAINING IP ADDRESS:..................................................................................31

CHAPTER 4 -WORKING....................................................................................................38

4.1 HOUSING.......................................................................................................................38

4.2 EXPLANATION OF THE CIRCUIT.............................................................................40

4.3 FINAL COMBINED CODE:..........................................................................................46


2
4.4 WEBPAGE:.....................................................................................................................60

4.5 READINGS AND ANALYSIS:......................................................................................66

4.5.1 LUX COMPARISON.............................................................................................66

4.5.2 POWER CONSUMPTION ANALYSIS................................................................70

4.5.3 HARMONIC ANALYSIS......................................................................................73

CHAPTER5- CONCLUSION, FUTURE.............................................................................84

RECOMMENDATIONS......................................................................................................84

5.1 CONCLUSION...............................................................................................................84

5.2 FUTURE RECOMMENDATIONS................................................................................84

5.2.1 ALUMINUM PCB..................................................................................................85

5.2.2 HEAT SINKS..........................................................................................................85

5.2.3 COMPACT HOUSING..........................................................................................85

5.2.4 SELECTON OF MORE EFFICIENT LEDS.........................................................85

5.2.5 COMPACT POWER SUPPLY...............................................................................85

5.2.6 SMALL SIZED ELECTRONIC COMPONENTS.................................................86

5.2.7 CURRENT CONTROLLED DIMMING...............................................................86

REFERENCES:....................................................................................................................87

3
LIST OF FIGURES

Figure 1.1……………………………………………………………………………… 1
Figure 3.1……………………………………………………………………………….4
Figure 3.2……………………………………………………………………………….4
Figure 3.3……………………………………………………………………………….5
Figure 3.4……………………………………………………………………………….6
Figure 3.5……………………………………………………………………………….7
Figure 3.6…………………………………………………………………………….....8
Figure 3.7……………………………………………………………………………….18
Figure 3.8...………………...…………………………………………………………...18
Figure 3.9……………………………………………….………………………………19
Figure 3.10………………………………………………………………….…………..20
Figure 3.11……………………………………………………………………………...20
Figure 3.12…….………………………………………………………………………..22
Figure 3.13……………………………………………………………………………...33
Figure 3.14…….………………………………………………………………………..37
Figure 4.1……………………………………………………………………………….38
Figure 4.2……..………………………………………………………………………...39
Figure 4.3……………………………………………………………………………….44
Figure 4.4……………………………………………………………………………….41
Figure 4.5.……..………………………………………………………………………..42
Figure 4.6……………………………………………………………………………….43
Figure 4.7……………………………………………………………………………….43
Figure 4.8……………………………………………………………………………….44

4
Figure 4.9……………………………………………………………………………….45
Figure 4.10……………………………………………………………………………..46
Figure 4.11……………………………………………………………………………..65
Figure 4.12……………………………………………………………………………..66
Figure 4.13……………………………………………………………………………..73
Figure 4.14……………………………………………………………………………..74
Figure 4.15……………………………………………………………………………..74
Figure 4.16……………………………………………………………………………..75
Figure 4.17……………………………………………………………………………..76
Figure 4.18……………………………………………………………………………..77
Figure 4.19……………………………………………………………………………..77
Figure 4.20……………………………………………………………………………..78
Figure 4.21……………………………………………………………………………..79
Figure 4.22……………………………………………………………………………..79
Figure 4.23…………………………………………………………………………..…80
Figure 4.24……………………………………………………………………………..81
Figure 4.25……………………………………………………………………………..82
Figure 4.26……………………………………………………………………………..82

5
LIST OF TABLES
Table 4.1………………………………………………………………………………….68

Table 4.2………………………………………………………………………………….69

Table 4.3………………………………………………………………………………….70

Table 4.4………………………………………………………………………………….71

Table 4.5………………………………………………………………………………….71

Table 4.6………………………………………………………………………………….72

Table 4.7………………………………………………………………………………….83

6
ACKNOWLEDGEMENT
We are thankful to Almighty Allah for the successful completion of our Final Year Project.
Without His providence this project could not have been completed.

We would like to express our deepest thanks to all those who provided us with the
possibility to complete this project.

Special thanks to our FYP internal advisor, Mr. Hassan Ul Haq for his crucial role in this
project. We are highly indebted to him for his continuous coordination, suggestions and
most importantly his encouragement towards selecting this particular project since the idea
was new and we had to work from the scratch.

Furthermore, we are highly obliged to Electrical Department, NED University of


Engineering & Technology for providing us with all the necessary lab equipment. We are
also grateful to the project lab assistants and supervisors for the support they provided at
every step of the hardware of this project.

Last but not the least, many thanks go to our parents and families for facilitating us for this
project in every aspect, funding our FYP and of course for their prayers.

7
ABSTRACT
The high brightness white Light Emitting Diode (LED) as a solid-state lighting source has
become popular in general lighting application. As energy saving is a critical issue in our
society due to economic and environmental causes, LEDs can be used as they have
amazing advantages over other conventional lighting sources like high efficiency, longer
lifetime, smaller size, smooth dimming, environmental friendliness and safety
improvements.

Inspired by Philips Hue lights, we have designed a lamp in which individual LEDs can be
controlled by using Bluetooth and Wi-Fi so that the lamp can have the capability of
dimming and to change the pattern of LEDs so that the overall lumens emitted by the lamp
can be varied according to the requirement of the user.

This report also pre-defines some specific patterns of the LEDs according to the needs of
domestic user via Wi-Fi and Bluetooth modules. In this way we have designed a lamp
which is not only energy efficient, as the LEDs are known for, but also we have made it
smart enough to satisfy the users' requirements of lighting without disturbing the power
factor.

8
CHAPTER 1- INTRODUCTION

1.1 LIGHT EMMITING DIODE:


Light Emitting Diodes generates light when voltage is given on negatively charged semi-
conductors which unites the electrons and generate photons. One can refer LED as a
chemical chip, embedded in capsule made of plastic. LEDs contain wide varieties of usage
that is it can be used as outdoor lights, under cabinet lights, landscape lights etc. LEDs can
endure very high times of turns on/off. LEDs are more easy to drive as compared with the
other traditional sources, and as it is smaller in size so they can easily be installed on
Printed Circuit Board (PCB). LEDs also reduce the electric bills as they use less power per
unit of generated light. Another well-known advantage of LEDs is that it reduces
greenhouse gas emissions from power plants thus establishing environmental friendliness.

Due to the tremendous advantages of LED we have decided to design a LED bulb in which
we will control LEDS individually.

Page 1 of 97
FIGURE 1.1: LED LAMP

CHAPTER 2- BACKGROUND
With the growth of manufacturing process and materials, high brightness LED is now
attracting attention from industry and academics. LED has been acknowledged as the most
potential 4th Generation light source of 21st century. Compared with all the other commonly
used lighting sources, it has 30% efficacy. In LED’s, 15%-25% of the electric power is
emitted as visible light and the remaining portion is dissipated as heat. LEDs radiate no IR
and UV radiations and thus making it safe for human eyes. It has very long lifespan of
100,000 hours which is more than 10 times of Compact Fluorescent Lamps. Also with the
evaluation of lighting industries, lighting designers are moving towards solid state
technology by making LED products.

Looking at the prevailed technology, we got convinced and excited to design this LED
Lamp in order to enhance its range of usage by bringing LED under the control of users via
Bluetooth and Wi-Fi.

Page 2 of 97
Page 3 of 97
CHAPTER 3: WORKING

3.1 PROTOTYPE:
3.1.1 PCB DESIGNING:
Our project was to design a Lamp where the user can control individual LEDs via
Bluetooth or Wi-Fi. Before designing the actual hardware of our LED Lamp, we first tested
our experiments and codes on a prototype.

Our prototype consisted of 17 LEDs with 330 ohms resistors connected individually to
every LED on a PCB Board. With the help of a male header, we linked our LEDs with
Arduino Uno.

Our first task in making the prototype was to design the PCB layout. We first attempted to
make layout by using Eagle software as it contains all the standards, but while routing we
were facing many issues as the wires kept getting overlapped with each other because of
many LEDs and resistors that we used.

One of our attempts on Eagle Software is shown in the figure below.

Page 4 of 97
FIGURE 3.1: INCORRECT LAYOUT OF PCB DESIGN

After many attempts, we switched to Proteus software, where we finally got rid of
overlapping and our layout was ready.

FIGURE 3.2: CORRECT LAYOUT OF PCB DESIGN

Following is how PCB looked like after getting ready.

Page 5 of 97
FIGURE 3.3: PCB BOARD

Our motive of designing this prototype was to check the performance of LEDs and
experiment different LED patterns on it before implementing it on the real hardware of
Lamp.

3.2 OPERATION OF LED LAMP VIA BLUETOOTH


DEVICE:
For making our project accessible by Bluetooth and Wi-Fi, we needed two different
modules for both Bluetooth and Wi-Fi. The Bluetooth module which is used in our project
is HC-05 (Wi-Fi module’s details are coming shortly in this report.)

Page 6 of 97
FIGURE 3.4: BLUETOOTH MODULE HC-05

Following are the steps of connecting Bluetooth Module HC-05 with Arduino-Uno.
i. Connect Vcc of HC-05 with 3V of Arduino Uno.
ii. Connect ground (GND) of HC-05 with Ground of Arduino Uno.
iii. Connect Receiver (RXD) pin with the Transmitter pin of Arduino Uno.
iv. Connect Transmitter (TXD) pin with the Receiver pin of Arduino Uno.
v. The Arduino is powered by Laptop.
Furthermore, we connected the LEDs with the Arduino with the help of a header and
jumpers. Both (LEDs and header) mounted on the PCB. We connected 16 LEDs on pin
numbers, 0,2,4,5,8,9,10,11,12,13,14,15.16.17.18.19 of Arduino UNO. As shown in
following figure (made by using Proteus Software)

Page 7 of 97
FIGURE 3.5: CIRCUIT DIAGRAM OF BLUETOOTH MODULE CONNECTION WITH ARDUINO UNO

Our journey with Bluetooth module went quite smoothly except of few problems that we
faced in coding the program. But after giving many hours with complete dedication, we
achieved our goal. We needed an Android Application in order to check the performance of
our LEDs. So we used an Application by the name of ‘BlueTerm’.

Page 8 of 97
Page 9 of 97
FIGURE 3.6: BLUETERM APPLICATION

Following is the code for operating LEDs using Bluetooth:

int VAR = 0;

int led4;

int led5;

int led8;

int led9;

int led10;

int led11;

int led12;

int led13;

int led14;

int led15;

int led16;

int led17;

int led18;

int led19;

int led2;

void setup() {
Page 10 of 97
pinMode(4,OUTPUT);

digitalWrite(4,HIGH);

pinMode(5,OUTPUT);

digitalWrite(5,HIGH);

pinMode(8,OUTPUT);

digitalWrite(8,HIGH);

pinMode(9,OUTPUT);

digitalWrite(9,HIGH);

pinMode(10,OUTPUT);

digitalWrite(10,HIGH);

pinMode(11,OUTPUT);

digitalWrite(11,HIGH);

pinMode(12,OUTPUT);

digitalWrite(12,HIGH);

pinMode(13,OUTPUT);
Page 11 of 97
digitalWrite(13,HIGH);

pinMode(14,OUTPUT);

digitalWrite(14,HIGH);

pinMode(15,OUTPUT);

digitalWrite(15,HIGH);

pinMode(16,OUTPUT);

digitalWrite(16,HIGH);

pinMode(17,OUTPUT);

digitalWrite(17,HIGH);

pinMode(18,OUTPUT);

digitalWrite(18,HIGH);

pinMode(19,OUTPUT);

digitalWrite(19,HIGH);

pinMode(2,OUTPUT);

digitalWrite(2,HIGH);

Serial.begin(9600);

Page 12 of 97
}

void loop() {

if(Serial.available() > 0)

VAR = Serial.read();

led4=digitalRead(4);

led5=digitalRead(5);

led8=digitalRead(8);

led9=digitalRead(9);

led10=digitalRead(10);

led11=digitalRead(11);

led12=digitalRead(12);

led13=digitalRead(13);

led14=digitalRead(14);

led15=digitalRead(15);

led16=digitalRead(16);

led17=digitalRead(17);

led18=digitalRead(18);

Page 13 of 97
led19=digitalRead(19);

led2=digitalRead(2);

if(VAR=='1')

{ digitalWrite(4,!led4);

if(VAR=='2')

{digitalWrite(5,!led5);

if(VAR=='3')

{digitalWrite(8,!led8);

if(VAR=='4')

{digitalWrite(9,!led9);

if(VAR=='5')

{digitalWrite(10,!led10);

Page 14 of 97
if(VAR=='6')

{digitalWrite(11,!led11);

if(VAR=='7')

{digitalWrite(12,!led12);

if(VAR=='8')

{digitalWrite(13,!led13);

if(VAR=='9')

{digitalWrite(14,!led14);

if(VAR=='a')

{digitalWrite(15,!led15);

if(VAR=='b')

{digitalWrite(16,!led16);

if(VAR=='c')

{digitalWrite(17,!led17);

}
Page 15 of 97
if(VAR=='d')

{digitalWrite(18,!led18);

if(VAR=='e')

{digitalWrite(19,!led19);

if(VAR=='f')

{digitalWrite(2,!led2);

if(VAR=='h') //OUTER SQUARE

// digitalWrite(0, !p0); ***problem: pin0 of arduino is always high

digitalWrite(4, !led4);

digitalWrite(5, !led5);

digitalWrite(8, !led8);

digitalWrite(9, !led9);

digitalWrite(13, !led13);

digitalWrite(17, !led17);

Page 16 of 97
digitalWrite(18, !led18);

digitalWrite(19, !led19);

digitalWrite(2, !led2);

digitalWrite(10, !led10);

digitalWrite(14, !led14);

if(VAR=='i')//INNER SQUARE

digitalWrite(12, !led12);

digitalWrite(11, !led11);

digitalWrite(16, !led16);

digitalWrite(15, !led15);

if(VAR=='j')//LEFT DIAGONAL

digitalWrite(4, !led4);

digitalWrite(12, !led12);

digitalWrite(15, !led15);

Page 17 of 97
digitalWrite(18, !led18);

if(VAR=='k') // RIGHT diagonal

digitalWrite(9, !led9);

digitalWrite(16, !led16);

digitalWrite(11, !led11);

digitalWrite(19, !led19);

if(VAR=='l') //1st row

digitalWrite(4, !led4);

digitalWrite(5, !led5);

digitalWrite(8, !led8);

digitalWrite(9, !led9);

3.2.1 EXPLANATION OF THE CODE:


i) Firstly, we defined the integers which contained the pins numbers of Arduino on
which the LEDs were connected.
ii) We defined all integers (LEDs) as initially HIGH.

Page 18 of 97
iii) Finally, we ascribed the Alpha-Numeric keys of Application BlueTerm with the
already defined integers with which we will be controlling the LEDs. By
pressing the pre-defined Alpha-Numeric keys on BlueTerm, that particular LED
will toggle its state.

Once the coding was done, we checked whether the LEDs were performing as we desired
by using the application “BlueTerm”.

We did the coding for the following patterns of LEDs:


i) Switching ON of individual LEDs.
ii) Switching ON of all LEDs.
iii) Outer square.
iv) Inner square.
v) Right diagonal.
vi) Left diagonal.

FIGURE 3.7: PATTERN OF LED

Page 19 of 97
FIGURE 3.8: PATTERN OF LED

FIGURE 3.9: PATTERN OF LED

Page 20 of 97
All the LEDs were performing perfectly and gave us our desired results.

So now we moved on to our next mission, which was to run LEDs through Wi-Fi.

3.3 OPERATION OF LED LAMP VIA ESP 8266-01:


3.3.1 BACKGROUND OF ESP:
For past few years, ESP-8266 has been a flourishing star in the field of Wi-Fi related
projects. ESP-8266 is a Wi-Fi SOC (System on a chip) and was launched by Espressif
Systems in 2014. ESP is an integrated chip which is designed to provide maximum internet
connectivity in a small package.

It is cost effective and can be performed like any micro-controller by putting some extra
efforts. It includes a RAM, an RF front end, and usually a TCP/IP (Transmission Control
Protocol/Internet Protocol) stack which allows it to get connected with a nearby access
point in order to perform as an access point itself or both. ESP8266 modules use the
standard AT Command set firmware by connecting it to micro-controller using the serial
UART.

FIGURE 3.10: ESP 8266-01

Page 21 of 97
FIGURE 3.11: ESP 8266-01 PIN CONFIGURATION

3.3.2 WORKING:
The ESP module which is used in our project is ESP 8266-01.

For making our LED Lamp accessible by Wi-Fi, we had following work lined up:

i) Finding a fast and portable net device.


ii) Coding of the program.
iii) Creating a webpage.

As for the hardware part, following is the pin layout with which we connected ESP with
Arduino-Uno.
i) The Vcc and CH-PD pins of ESP operate at 3.3V so we powered them by an
adapter of 5V by using an IC “LM317” which steps down 5 Volts to 3.3 Volts.
ii) We connected the ground of ESP with the Ground of Arduino.
iii) The Transmitter of ESP is connected with pin number 6 of Arduino.
iv) The Receiver of ESP is connected with pin number 7 of Arduino.
v) The Arduino is powered by Laptop.
vi) The transmitter of Arduino gives 5V signal, but ESP operates at 3.3V so there was a
risk of ESP getting burned. In order to avoid that, we used a voltage divider (by
using resistors 1.2K ohms and 2.2K ohms) to step down 5V to 3.3V.

As shown in the figure below (made by using Proteus Software):

Page 22 of 97
FIGURE 3.12: CIRCUIT DIAGRAM OF CONNECTION OF ESP WITH ARDUINO UNO

Unlike our easy journey with Bluetooth Module, ESP 8266 gave us a very difficult time.
We had the idea that if we’ll be connecting the ESP to Arduino Uno through a breadboard,
then the connection will keep getting lose. So we soldered male headers on a Vero Board
and fixed our ESP on one of them, while others were used to connect the Ground,
Transmitter and Receiver pins to Arduino Uno through jumpers.

3.3.3 ARDUINO CODE FOR ESP 8266:


Following is the ESP code for controlling LEDs:

#include <SoftwareSerial.h>

#define VAR true

Page 23 of 97
SoftwareSerial wifi(6,7);

// This means that you need to connect the TX line from the
esp to the Arduino's pin 6

// and the RX line from the esp to the Arduino's pin 7

void setup()

Serial.begin(9600);

wifi.begin(9600);

pinMode(4,OUTPUT);

digitalWrite(4,HIGH);

pinMode(5,OUTPUT);

digitalWrite(5,HIGH);

pinMode(8,OUTPUT);

digitalWrite(8,HIGH);

pinMode(9,OUTPUT);

digitalWrite(9,HIGH);
Page 24 of 97
pinMode(10,OUTPUT);

digitalWrite(10,HIGH);

pinMode(11,OUTPUT);

digitalWrite(11,HIGH);

pinMode(12,OUTPUT);

digitalWrite(12,HIGH);

pinMode(13,OUTPUT);

digitalWrite(13,HIGH);

pinMode(14,OUTPUT);

digitalWrite(14,HIGH);

pinMode(15,OUTPUT);

digitalWrite(15,HIGH);

pinMode(16,OUTPUT);

Page 25 of 97
digitalWrite(16,HIGH);

pinMode(17,OUTPUT);

digitalWrite(17,HIGH);

pinMode(18,OUTPUT);

digitalWrite(18,HIGH);

pinMode(19,OUTPUT);

digitalWrite(19,HIGH);

pinMode(2,OUTPUT);

digitalWrite(2,HIGH);

sendData("AT+RST\r\n",2000,VAR); // reset module

sendData("AT+CWJAP=\"ZONG MBB-E8372-
574E\",\"69498271\"\r\n",20000,VAR);

sendData("AT+CWMODE=3\r\n",1000,VAR); // configure as access point

sendData("AT+CIFSR\r\n",1000,VAR); // get ip address

sendData("AT+CIPMUX=1\r\n",1000,VAR); // configure for multiple


connections

Page 26 of 97
sendData("AT+CIPSERVER=1,80\r\n",1000,VAR); // turn on server on port
80

void loop()

if(wifi.available())

if(wifi.find("+IPD,"))

delay(1000);

int connetionShanakht = wifi.read()-48;

wifi.find("pin=");

int LEDnumber = (wifi.read()-48)*10;

Page 27 of 97
LEDnumber += (wifi.read()-48);

if(LEDnumber<18) //individual LED on/

digitalWrite(LEDnumber, !digitalRead(LEDnumber)); // toggle pin

if(LEDnumber=18) //outer square

digitalWrite(4, !digitalRead(4));

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

digitalWrite(13, !digitalRead(13));

digitalWrite(17, !digitalRead(17));

digitalWrite(18, !digitalRead(18));

Page 28 of 97
digitalWrite(19, !digitalRead(19));

digitalWrite(2, !digitalRead(2));

digitalWrite(10, !digitalRead(10));

digitalWrite(14, !digitalRead(14));

if(LEDnumber=19) //inner square

digitalWrite(12, !digitalRead(12));

digitalWrite(11, !digitalRead(11));

digitalWrite(16, !digitalRead(16));

digitalWrite(15, !digitalRead(15));

if(LEDnumber=20) // LEFT diagonal

{ digitalWrite(4, !digitalRead(4));

digitalWrite(12, !digitalRead(12));

digitalWrite(15, !digitalRead(15));

digitalWrite(18, !digitalRead(18));

Page 29 of 97
}

if(LEDnumber=21) // RIGHT diagonal

digitalWrite(9, !digitalRead(9));

digitalWrite(16, !digitalRead(16));

digitalWrite(11, !digitalRead(11));

digitalWrite(19, !digitalRead(19));

if(LEDnumber=22) //1st row

digitalWrite(4, !digitalRead(4));

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

// make close command

String closeHukm = "AT+CIPCLOSE=";

closeHukm+=connetionShanakht;

closeHukm+="\r\n";
Page 30 of 97
sendData(closeHukm,1000,VAR);

String sendData(String command, const int timeout, boolean VAR)

String response = "";

wifi.print(command);

long int time = millis();

while( (time+timeout) > millis())

while(wifi.available())

Page 31 of 97
char c = wifi.read();

response+=c;

if(VAR)

Serial.print(response);

return response;

3.3.4 WEBPAGE CODE FOR ESP 8266:


In order to run the ESP, a webpage is required through which one can give commands to the
ESP-Arduino circuit. The webpage accepts HTML code and that code is written on
“Notepad” and saved with the extension of “.html”.

3.3.5 OBTAINING IP ADDRESS:


The biggest hurdle was to get the IP address of the net device being used. We did the coding
of the program but on running the Serial command, it wasn’t giving us the IP address of the
Net device. Every now and then, the Arduino software gave the error of port. If that got

Page 32 of 97
fixed then the Serial Monitor would show the command of “busy p” and sometimes it
won’t give us any response at all. It made us think that the problem is with the net device,
but on running the browser, it was working fine.

We needed the IP address to place it in the html code for our webpage.

When nothing seemed to work, a group mate calmly listed down all the possibilities where
we could be going wrong which are as follows:

i) The net device is not working properly.


ii) The ESP module which we were using is faulty.
iii) The ESP circuit is incorrect.

Following steps were taken series-wise to check for every possibility.

i) CHECK FOR NET DEVICE: We were initially using Zong 4G network, but
to check whether it’s responding or not we used the NEDUET Wi-Fi. The serial
monitor wasn’t giving IP address in it either. Hence one possibility was removed
and our net device was working properly.
ii) CHECK FOR ESP MODULE: For this, we ran our ESP module in someone
else’s circuit. And it was performing perfectly there. So, we got to know where
we were mistaking, that is, our circuit had some problem.

We made the circuit once again. Initially we were using Zener diode to regulate the voltage.
But this time, we used Voltage Divider from resistors 1.2K ohm and 2.2K ohm to step down
the voltage.

Upon checking, our ESP circuit worked and finally the serial monitor gave the IP.

Page 33 of 97
Page 34 of 97
FIGURE 3.13: SERIAL MONITOR RESULT

Then in a matter of few minutes, we placed the IP address (CIFSR:STAIP) in our


webpage’s code and checked the LEDs performance and it was working just as we had
desired.

(After achieving complete success in our prototype, we pondered over where in circuit we
were going wrong. We realized our blunder, that we had connected the Zener diode in
between the receiver and ground of Arduino Uno instead it should have been in between the
Transmitter of Arduino and Receiver of ESP.)

Page 35 of 97
The code of our webpage is as follows:

<!doctype html>

<html>

<head>

<title>ESP8266 LED Control</title>

</head>

<body>

<h1><center><font color="orange"> THE LED LAMP </font></center> </h1>

</br></br><center><button id="1" class="led">1</button> <!-- button for pin 11


-->&nbsp

<center><button id="9" class="led">9</button> <!-- button for pin 11 -->&nbsp

<button id="10" class="led">10</button> <!-- button for pin 12 -->&nbsp

<button id="11" class="led">11</button> <!-- button for pin 13 -->&nbsp

<button id="12" class="led">12</button> <!-- button for pin 11 -->&nbsp

Page 36 of 97
<button id="14" class="led">14</button> <!-- button for pin 12 -->&nbsp

<button id="15" class="led">15</button> <!-- button for pin 13 -->&nbsp&nbsp

<button id="16" class="led">16</button> <!-- button for pin 11 --></center>

</br>

<center><button id="18" class="led">OUTER SQUARE</button> <!-- button for


pin 11 -->&nbsp&nbsp

<button id="19" class="led">INNER SQUARE</button> <!-- button for pin 11


-->&nbsp&nbsp

<button id="20" class="led">\ DIAGONAL</button> <!-- button for pin 11


-->&nbsp&nbsp

<button id="21" class="led">/ DIAGONAL</button> <!-- button for pin 11


--></center></br>

<center><button id="26" class="led">1ST COLUMN</button> <!-- button for pin 11 -->

<button id="27" class="led">2ND COLUMN</button> <!-- button for pin 11 -->

<button id="28" class="led">3RD COLUMN</button> <!-- button for pin 11 -->

<button id="29" class="led">4TH COLUMN</button> <!-- button for pin 11


--></center></br>

<center><button id="22" class="led">1ST ROW</button> <!-- button for pin 11 -->&nbsp

<button id="23" class="led">2ND ROW</button> <!-- button for pin 11 -->&nbsp

<button id="24" class="led">3RD ROW</button> <!-- button for pin 11 -->&nbsp

<button id="25" class="led">4TH ROW</button> <!-- button for pin 11


--></center></br>

Page 37 of 97
<script src="jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$(".led").click(function(){

var p = $(this).attr('id'); // get id value (i.e. pin13, pin12,pin11


or pin10)

// send HTTP GET request to the IP address with the


parameter "pin" and value "p", then execute the function

$.get("http://192.168.1.101:80/", {pin:p}); // execute get


request

});

});

</script>

</body>

</html>

3.3.6 JQUERY:
The HTML code uses the Javascript library of JQuery. It can be obtained from the
following link:

http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js

Save this library in the same dictionary where the HTML code for webpage is saved or else
it won’t perform any function.

Page 38 of 97
The following figure shows how our webpage looked like on Chrome. (Right click the
webpage file. Go to ‘Open with’ and then select ‘Google Chrome’)

FIGURE 3.14: WEBPAGE

Page 39 of 97
CHAPTER 4 -WORKING
Once the testing of LEDs got completed, the other challenge of placing the whole circuit in
a housing, compact enough to give it an appearance of a LED lamp, was in front of us. We
performed all the tests on Arduino Uno which was too bulky to place in a small housing, so
we shifted our whole prototype on Arduino Nano. For that purpose, we needed to perform
all the tests from scratch. But with complete dedication, we were able to get perfect results
within a day.

FIGURE 4.1: CIRCUIT USING ARDUINO NANO

We used 6 LEDs of 1 Watt for our housing.

4.1 HOUSING
For housing, we bought a bulb and emptied all of its circuits such that only the body of the
bulb was all that remained. Still the housing was smaller for our circuit to get fit in it. So
we brought all of our circuit in a small Vero Board with an area of 6x6 cm2.

Page 40 of 97
It was a highly risky task as we needed to place the following components on a compact
Vero Board.

i) Arduino Nano
ii) Bluetooth HC-05
iii) ESP-8266
iv) IC LF33
v) IC ULN2003A
vi) 6, 1.5 ohms Resistors
vii) 2.2K and 1.2K Resistors
viii) Nut connector
ix) Female Header

It was a very challenging task to save it all from getting short.

For giving power to the circuit, we bought a 5Volt Adapter of 2 Amperes and opened its
housing to only take out its small circuit with wires.

The pin configurations of ULN2003A and LF33 are as follows:

FIGURE 4.2: ULN2003A PIN CONFIGURATION

Page 41 of 97
FIGURE 4.3: LF33 PIN CONFIGURATION

4.2 EXPLANATION OF THE CIRCUIT


i) POWERING ESP: We gave 5 Volts to the input pin of the IC LF33 through nut
connector. As a result, we received 3.3 Volt at the output pin of LF33 which will
be directed towards powering ESP 8266-01.
ii) POWERING ARDUINO NANO: 5 Volt from adapter is given to power
Arduino Nano.
iii) CIRCUIT FOR ESP: The transmission pin of ESP-8266 is connected with pin
number 6 of Arduino Nano and ESP’s receiver pin is connected through Voltage
Divider (using 2.2K ohms and 1.2K ohms resistors) to Nano’s pin number 7.
iv) CIRCUIT FOR LEDs: We reserved Arduino Nano’s Pin numbers 8,9,10,11,12
& 13 for LEDs. The pins “IN” of ULN2003A is connected with Nano pin
numbers 8,9,10,11,12 & 13. The 6 “OUT” pins of ULN2003A is connected
with one leg of 6 1.5 ohms resistors. The other legs of resistors are connected
with the cathode of LEDs. The anode of LED is connected with 5 Volt adapter.

The connections are shown below in the circuit made using Proteus software.

Page 42 of 97
FIGURE 4.4: FINAL COMBINED CIRCUIT WITH ARDUINO NANO, BLUETOOTH MODULE HC-05 AND
ESP8266

Page 43 of 97
Figure 4.5 FINAL CIRCUIT FOR HOUSING

Following are the images of our housing and placement of the circuit and adapter in it.

Page 44 of 97
FIGURE 4.6: BULB FOR HOUSING

Figure 4.7 HOUSING

Page 45 of 97
Figure 4.8 HOUSING CONTAINING CIRCUITS OF ADAPTER AND BLUETOOTH & ESP

Now the task of soldering LEDs on bulb was left. Like every student, we also first thought
about soldering the LEDs on a Vero Board but the problem of LEDs getting heated up
stopped us from implementing this idea. We searched on soldering LEDs and found out
about Aluminum PCBs which doesn’t let the LEDs get heated up.

But the problem was that Aluminum PCBs are not available in Pakistan and in order to
import it from other countries, we needed about one month to get it. We didn’t have that
much time so, we dropped this idea too.

In the end, we decided to paste the LEDs on the upper part of the emptied bulb with an Elfy
glue stick. Still we were scared for the LEDs getting heated up, so we used a Thermally
Conducting Gel in between the LEDs and its heat sink.

The supply was given to LEDs in the following way:

Page 46 of 97
i) All the anodes of LEDs were shorted with each other and then connected with
the 5 Volts of supply.
ii) All cathode pins are connected with OUT pins of ULN2003a.

FIGURE 4.9: PLACEMENT OF LEDs ON HOUSING

Following is a graphical image of the pattern in which LEDs are placed in our final
hardware. The numbers inside the circle represent the Arduino Nano’s pin numbers on
which they are connected.

Page 47 of 97
FIGURE 4.10: LEDs PIN NUMBERS ON ARDUINO NANO.

4.3 FINAL COMBINED CODE:


Following is our final code through which we can control the LEDs through both ESP and
Bluetooth at the same time.

#include <SoftwareSerial.h>

SoftwareSerial merawifi(6,7);

// TX of esp to the Arduino's pin 6

Page 48 of 97
// RX of esp to the Arduino's pin 7

//leaving pin 1,2 for bluetooth,6,7 for wi-fi

//*********

String toesp(String Hukm, const int timeout)

String response = "";

merawifi.print(Hukm); // send the read character to the merawifi

long int time = millis();

while( (time+timeout) > millis())

while(merawifi.available())

char c = merawifi.read(); // read the next character.

response+=c;

Page 49 of 97
}

Serial.print(response);

return response;

//******

String sendData(String Hukm, const int timeout)

String response = "";

int dataSize = Hukm.length();

char data[dataSize];

Hukm.toCharArray(data,dataSize);

merawifi.write(data,dataSize); // send the read character to the merawifi

Serial.println("\r\n====== HTTP Response From Arduino ======");

Serial.write(data,dataSize);

Serial.println("\r\n========================================");

Page 50 of 97
long int time = millis();

while( (time+timeout) > millis())

while(merawifi.available())

char c = merawifi.read(); // read the next character.

response+=c;

Serial.print(response);

return response;

//******

void setup()

Serial.begin(9600);

Page 51 of 97
merawifi.begin(9600);

pinMode(2,OUTPUT);

digitalWrite(2,HIGH);

pinMode(3,OUTPUT);

digitalWrite(3,HIGH);

pinMode(4,OUTPUT);

digitalWrite(4,HIGH);

pinMode(5,OUTPUT);

digitalWrite(5,HIGH);

pinMode(8,OUTPUT);

digitalWrite(8,HIGH);

pinMode(9,OUTPUT);

digitalWrite(9,HIGH);

Page 52 of 97
toesp("AT+RST\r\n",2000); // reset module

toesp("AT+CWMODE=1\r\n",1000); // configure as access point

toesp("AT+CWJAP=\"ZONG MBB-E8372-574E\",\"69498271\"\r\n",3000);

delay(5000);

toesp("AT+CIFSR\r\n",1000); // get ip address

toesp("AT+CIPMUX=1\r\n",1000); // configure for multiple connections

toesp("AT+CIPSERVER=1,80\r\n",1000); // turn on server on port 80

Serial.println("Server Ready");

void loop()

if(merawifi.available()) // check if the esp is sending a message

if(merawifi.find("+IPD,"))

delay(1000);

int shanaakht = merawifi.read()-48; // subtract 48 because the read() function returns

Page 53 of 97
// the ASCII decimal value and 0 (the first decimal number)
starts at 48

merawifi.find("pin="); // advance cursor to "pin="

int LEDnumber = (merawifi.read()-48); // get first number i.e. if the pin 13 then the 1st
number is 1

int secondNumber = (merawifi.read()-48);

if(secondNumber>=0 && secondNumber<=9)

LEDnumber*=10;

LEDnumber +=secondNumber; // get second number, i.e. if the pin number is 13 then
the 2nd number is 3, then add to the first number

if(LEDnumber<10)// individual control

digitalWrite(LEDnumber, !digitalRead(LEDnumber)); // toggle pin

if(LEDnumber==10) // all leds

Page 54 of 97
{

digitalWrite(2, !digitalRead(2));

digitalWrite(3, !digitalRead(3));

digitalWrite(4, !digitalRead(4));

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

if(LEDnumber==11)//upper left triangle

digitalWrite(2, !digitalRead(2));

digitalWrite(3, !digitalRead(3));

digitalWrite(9, !digitalRead(9));

if(LEDnumber==12)//upper right triangle

digitalWrite(2, !digitalRead(2));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));
Page 55 of 97
}

if(LEDnumber==13)// outer circle

digitalWrite(2, !digitalRead(2));

digitalWrite(3, !digitalRead(3));

digitalWrite(4, !digitalRead(4));

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

if(LEDnumber==14)//central LED

digitalWrite(9, !digitalRead(9));

if(LEDnumber==15)//lower left triangle

digitalWrite(3, !digitalRead(3));

digitalWrite(4, !digitalRead(4));
Page 56 of 97
digitalWrite(9, !digitalRead(9));

if(LEDnumber==16)//lower right triangle

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

// build string that is send back to device that is requesting pin toggle

String ajza;

ajza = "Pin ";

ajza += LEDnumber;

ajza += " is ";

if(digitalRead(LEDnumber))

ajza += "ON";

Page 57 of 97
}

else

ajza += "OFF";

// make close Hukm

String closingHukm = "AT+CIPCLOSE=";

closingHukm+=shanaakht; // append connection id

closingHukm+="\r\n";

sendData(closingHukm,1000); // close connection

else if(Serial.available() > 0)

int state = 0;

int led2;

int led3;

int led4;

int led5;

Page 58 of 97
int led8;

int led9;

state = Serial.read();

led2=digitalRead(2);

led3=digitalRead(3);

led4=digitalRead(4);

led5=digitalRead(5);

led8=digitalRead(8);

led9=digitalRead(9);

if(state=='1')

{ digitalWrite(2,!led2);

if(state=='2')

{digitalWrite(3,!led3);

if(state=='3')

{digitalWrite(4,!led4);

if(state=='4')

Page 59 of 97
{digitalWrite(5,!led5);

if(state=='5')

{digitalWrite(8,!led8);

if(state=='6')

{digitalWrite(9,!led9);

if(state=='o') //OUTER CIRCLE

digitalWrite(2, !led2);

digitalWrite(3, !led3);

digitalWrite(4, !led4);

digitalWrite(5, !led5);

digitalWrite(8, !led8);

if(state=='i')//INNER LED

digitalWrite(9, !led9);

Page 60 of 97
}

if(state=='a')//ALL LEDS

digitalWrite(2, !led2);

digitalWrite(3, !led3);

digitalWrite(4, !led4);

digitalWrite(5, !led5);

digitalWrite(8, !led8);

digitalWrite(9, !led9);

if(state=='w') // UPPER RIGHT TRIANGLE

digitalWrite(2, !digitalRead(2));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

if(state=='x') //UPPER LEFT TRIANGLE

digitalWrite(2, !digitalRead(2));

digitalWrite(3, !digitalRead(3));

digitalWrite(9, !digitalRead(9));
Page 61 of 97
}

if(state=='y') //LOWER LEFT TRIANGLE

digitalWrite(3, !digitalRead(3));

digitalWrite(4, !digitalRead(4));

digitalWrite(9, !digitalRead(9));

if(state=='z') //LOWER RIGHT TRIANGLE

digitalWrite(5, !digitalRead(5));

digitalWrite(8, !digitalRead(8));

digitalWrite(9, !digitalRead(9));

4.4 WEBPAGE:
Following is the Webpage code for 6 LEDs while for Bluetooth Module we used the same
BlueTerm Application.

<!doctype html>

<html>

Page 62 of 97
<head>

<title>ESP8266 LED Control</title>

</head>

<style>

button[type=circle]{

border: 20;

padding: 10px 20px;

background: yellow;

width: 30px;

border-radius: 500px;

body {

background-image: url("badal.jpg");

</style>

<body>

<h1><font color="green"><center>FINAL YEAR PROJECT</br></font>

<font color="red">BATCH 2012-13</font></br></center></h1>

Page 63 of 97
<!--video coding-->

<center>

<video autoplay>

<source src="Despicable Me Minions changing a light bulb video.-Mobile.mp4"


type="video/mp4">

Your browser does not support the video tag.

</video>

</center>

<!-- in the <button> tags below the ID attribute is the value sent to the arduino -->

<h1><center><font color="purple"> THE LED LAMP </font></center> </h1>

</br></br>

<center>

Page 64 of 97
<button type="circle" id="2" class="led">1</button> <!-- button for pin 8 -->

</br>

<center><button type="circle" id="9" class="led">6</button><!-- button for pin 9


-->&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&
nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<button type="circle" id="8" class="led">5</button> <!-- button for pin 12


-->&nbsp

</br>

<button type="circle" id="3" class="led">2</button> <!-- button for pin 13


-->&nbsp</center>

</br>

<button type="circle" id="4" class="led">3</button> <!-- button for pin 10


-->&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<button type="circle" id="5" class="led">4</button> <!-- button for pin 11


-->&nbsp </br></br></br></br></br>

</center>

</br>

<center><button id="13" class="led">PATTERN 1</button> <!-- button for pin 11


-->&nbsp&nbsp

<button id="14" class="led">PATTERN 2</button> <!-- button for pin 11


-->&nbsp&nbsp

Page 65 of 97
<button id="11" class="led">PATTERN 3</button> <!-- button for pin 11
-->&nbsp&nbsp

<button id="12" class="led">PATTERN 4</button> <!-- button for pin 11 -->


</center></br>

<center><button id="15" class="led">PATTERN 5</button> <!-- button for pin 11 -->

<button id="16" class="led">PATTERN 6</button> <!-- button for pin 11 -->

<button id="10" class="led">ALL LEDs</button> <!-- button for pin 11


--></center>

<script src="jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$(".led").click(function(){

var p = $(this).attr('id'); // get id value (i.e. pin13, pin12,pin11


or pin10)

// send HTTP GET request to the IP address with the


parameter "pin" and value "p", then execute the function

$.get("http://192.168.8.102:80/", {pin:p}); // execute get


request

});

});

</script>

</body>
Page 66 of 97
</html>

Following is how our webpage looked like on Google Chrome:

FIGURE 4.11: FINAL WEBPAGE

Following is the image of our LED lamp, ready to function perfectly.

Page 67 of 97
Figure 4.12 WORKING LED LAMP

4.5 READINGS AND ANALYSIS:


In order to check the compatibility of our Lamp, we compared its Lux, Harmonics and
Power Consumption with a standard Philips LED Lamp.

4.5.1 LUX COMPARISON

Using the two lamps following experiment has been performed.

Page 68 of 97
1. Fix the lamp in holder.
2. Turn all other lights off.
3. Turn the lamp on.
4. Measure lux exactly in front of the lamp and get readings by increasing the distance
0.5 meters at a time.
5. Repeat the experiment by moving the lux meter 1 meter away always starting at the
just below the lamp level.
6. At each point you need to take multiple readings by moving the lux meter 0.5 meter
lower.
7. L is the lamp. You need to measure at all X points and L point.
8. In a single reading, the lux meter shows both the maximum and minimum value of
lux at a point. For accuracy, take each reading twice and then average the four
maximum and minimum lux values to get a final value at that point.

TOP VIEW OF ROOM:

<--1m-->

^ X 1 X2 X 3

1m

v
X4 L X5

X6 X7 X8

Page 69 of 97
DESIGNED LAMP:
Unit = Lux

Table 4.1 LUX READING OF DESIGNED LAMP

0m 0.5m 1m 1.5m
max min avg max min avg max min avg max min avg
X1 0.55 0.4 0.4825 2.53 2.34 2.99 6.97 6.82 7.0075 7.95 7.57 7.66
0.53 0.45 3.6 3.49 7.2 7.04 7.7 7.42
11.8
X2 0.63 0.42 0.545 4.95 4.78 4.9175 4 11.42 11.645 13.81 13.45 13.535
11.9
0.66 0.47 5.21 4.73 6 11.36 13.88 13
X3 0.67 0.15 0.455 1.91 1.69 2.0375 6.02 5.48 5.9625 11.5 9.32 9.23
0.59 0.41 2.43 2.12 6.56 5.79 8.5 7.6
15.1 13.122
X4 0.28 0.25 0.3025 10.08 9.6 9.9625 1 14.41 14.795 13.31 12.86 5
15.3
0.37 0.31 10.27 9.9 8 14.28 13.33 12.99
14.5 13.677
X5 0.83 0.64 0.635 4.82 4.6 5.6275 7 13.76 14.49 13.8 13.71 5
14.9
0.59 0.48 7.15 5.94 5 14.68 13.99 13.21
X6 0.47 0.43 0.4275 3.62 3.2 3.33 5.81 5.24 5.54 8.67 8.12 8.32
0.53 0.28 3.35 3.15 5.65 5.46 8.5 7.99
12.8 13.192
X7 0.61 0.43 0.565 4.15 3.56 3.96 3 12.69 12.68 13.37 13.2 5
13.1
0.67 0.55 4.44 3.69 7 12.03 13.41 12.79
X8 0.53 0.4 0.4525 3.48 2.87 3.1175 7.01 6.63 6.875 8.59 8.11 8.1825
0.6 0.28 3.34 2.78 7.12 6.74 8.53 7.5
L 1963 1900 1738.5 219 214 213 56.5 55.6 54.625 25 24.4 24.875
1893 1198 212 207 53.5 52.9 25.1 25

Page 70 of 97
STANDARD LAMP:
Unit = Lux
Table 4.2 LUX READING OF STANDARD LAMP

0m 0.5m 1m 1.5m
max min avg max min avg max min avg max min avg
X1 1.84 1.74 1.73 9.3 9.11 9.1025 16.3 15.85 16.1625 18.5 18.1 18.42
1.87 1.47 9.34 8.66 16.4 16.1 19.18 17.9
18.267
X2 2.37 1.79 2.305 11.74 9.38 9.2475 20.7 20.1 19.95 18.89 18.59 5
2.72 2.34 8.26 7.61 20.1 18.9 18.47 17.12
13.487
X3 1.7 1.65 1.72 7.51 6.96 7.25 13.9 13.3 13.275 13.6 13.4 5
1.89 1.64 7.6 6.93 13.4 12.5 13.7 13.25
X4 4.57 4.3 4.2425 19.86 19.24 19.2575 27.6 26.5 27.175 23 21.8 22.475
4.18 3.92 19.33 18.6 28.1 26.5 22.9 22.2
X5 6.2 5.91 5.6425 18.26 17.6 17.855 22.1 21 20.85 17.5 17 17.25
5.45 5.01 18.24 17.32 20.9 19.4 17.8 16.7
X6 1.85 1.76 1.835 11.26 11.01 11.2575 12.4 12.2 12.14 15.7 15.4 15.42
1.99 1.74 11.82 10.94 12.26 11.7 15.92 14.66
X7 3.7 3.32 3.3075 20.2 20 19.475 23.4 23.1 22.625 18.82 18 18.155
3.17 3.04 19.5 18.2 22.3 21.7 18.9 16.9
X8 3.26 3.07 3.11 8.48 7.8 8.0875 16.9 16.6 16.5775 14.8 14.5 14.45
3.34 2.77 8.48 7.59 16.77 16.04 14.5 14
L 1634 1592 1513.5 316 313 316.25 74.1 73.1 73.125 38.2 37.3 38.25
1432 1396 320 316 72.9 72.4 38.9 38.6

Page 71 of 97
PERCENTAGE DIFFERENCE BETWEEN THE LUX OF DESIGNED
LAMP AND THE STANDARD LAMP:
Percentage difference=(standard lamp’s lux – designed lamp’s lux)*100/ standard lamp’s
lux

Note: Values in the following table are percentages.

Table 4.3 PERCENTAGE DIFFERENCE OF LUX OF TWO LAMPS

0m 0.5m 1m 1.5m
X1 72.10983 67.15188 56.64346 58.41477

X2 76.35575 46.82347 41.62907 25.90666

X3 73.54651 71.89655 55.08475 31.56627

X4 92.86977 48.26691 45.55658 41.6129

X5 88.74612 68.48222 30.5036 20.71014

X6 76.703 70.41972 54.36573 46.0441

X7 82.91761 79.66624 43.9558 27.33407

X8 85.45016 61.45286 58.52813 43.3737

L -14.8662 32.64822 25.29915 34.96732

4.5.2 POWER CONSUMPTION ANALYSIS


With the help of Non-Intrusive Load Monitoring, we have done the power consumption
and harmonics analysis of standard Philips LED Lamp and designed lamp.

The power consumption of Philips LED Lamp at ten different instants are given below

Page 72 of 97
Table 4.4 POWER CONSUMTION OF STANDARD LED LAMP

S.N Voltage(V) Current(A) Power(Watts)


O
1 241.26 0.067000 6.6390
2 265.89 0.062000 7.2160
3 265.39 0.056000 7.1600
4 265.91 0.055000 7.1170
5 265.94 0.055000 7.2820
6 265.39 0.055000 7.3710
7 265.81 0.055000 7.3330
8 265.23 0.055000 7.2310
9 265.36 0.055000 7.4220
10 265.45 0.055000 7.3010

The following table shows the power consumption of designed lamp at ten different
instants (when all LEDs are on):

Table 4.5 POWER CONSUMPTION OF DESIGNED LAMP

S.N Voltage (V) Current (A) Power(watts


O )
1 242.19 0.10300 10.148
2 266.38 0.10900 11.458
3 266.38 0.10700 11.407
4 265.97 0.10400 11.146
5 266.11 0.10600 11.302
6 265.51 0.10700 11.467
7 266.00 0.10800 11.357
8 265.91 0.10900 11.369
9 265.62 0.10600 11.172
10 266.10 0.10800 11.404

When three LEDs of designed lamp are on so the power consumption at ten different
instants are given in table format.

Page 73 of 97
Table 4.6 POWER CONSUMPTION OF DESIGNED LAMP HAVING 3 LEDs ON

S.N Voltage (V) Current (A) Power(watts


O )
1 240.05 0.083000 5.5570
2 265.27 0.080000 6.3120
3 264.78 0.077000 5.9210
4 265.81 0.077000 6.1560
5 265.33 0.077000 5.9500
6 265.85 0.077000 6.1410
7 264.92 0.076000 6.1800
8 264.44 0.079000 6.0920
9 264.89 0.078000 5.9070
10 266.10 0.078000 6.2190

COMPARISON OF POWER COMPARISON OF LED LAMPS


14
power cons umption
POWER CONSUMPTION(wats)

12 of phi l ips

10

8 power cons umption


of des igned
6 l a mp(when al l l eds
a re on)
4

0
1 2 3 4 5 6 7 8 9 10
NO OF INSTANTS

From power consumption analysis we conclude that the power rating of designed bulb is 11
watt and when three LEDs are on, the power rating is half of the total power rating. The
power rating of Philips LED Lamp is 7 watt.

4.5.3 HARMONIC ANALYSIS


As per the standards of IEC 61000-3-2, the lamp that gives Active Input Power less than or
equal to 25 Watt must abide one of the two following conditions at least.

Page 74 of 97
i) The 3rd harmonic current should not exceed 86% of the fundamental harmonic
current.

ii) The 5th harmonic current should not exceed 61% of the fundamental harmonic
current.

The individual harmonic spectrums of both lamps at seven different instants are given
below:

Figure 4.13 HARMONIC ANALYSIS OF STANDARD LAMP

Page 75 of 97
Figure 4.14 HARMONIC ANALYSIS OF STANDARD LAMP

Figure 4.15 HARMONIC ANALYSIS OF STANDARD LAMP

Page 76 of 97
Figure 4.16 HARMONIC ANALYSIS OF STANDARD LAMP

Page 77 of 97
Figure 4.17 HARMONIC ANALYSIS OF STANDARD LAMP

Page 78 of 97
Figure 4.18 HARMONIC ANALYSIS OF STANDARD LAMP

Figure 4.19 HARMONIC ANALYSIS OF STANDARD LAMP

Page 79 of 97
Figure 4.20 HARMONIC ANALYSIS OF DESIGNED LAMP

Page 80 of 97
Figure 4.21 HARMONIC ANALYSIS OF DESIGNED LAMP

Figure 4.22 HARMONIC ANALYSIS OF DESIGNED LAMP

Page 81 of 97
Figure 4.23 HARMONIC ANALYSIS OF DESIGNED LAMP

Page 82 of 97
Figure 4.24 HARMONIC ANALYSIS OF DESIGNED LAMP

Page 83 of 97
Figure 4.25 HARMONIC ANALYSIS OF DESIGNED LAMP

Figure 4.26 HARMONIC ANALYSIS OF DESIGNED LAMP

Page 84 of 97
Table 4.7 HARMONIC COMPARISON OF STANDARD AND DESIGNED LAMP [%]

TESTED HARMONIC[%]
FUNDAMENTAL 3rd 5th 7th THDI
LED
LAMP
PHILIPS 7 100 82.214 51.95 28.676 105.914
W
DESIGNED 100 102.257 90.222 76.884 173.4024
LAMP 11 W

From the above table and individual harmonic spectrum we conclude that in Philips led
lamp the 3rd harmonic is 82.21% of the fundamental and 5th harmonic is 51.95% of the
fundamental, Hence its satisfy the IEC standard Whereas in designed led lamp the 3rd
harmonic is 102.214% of the fundamental and 5th harmonic is 90.22% of the fundamental
so it is not satisfying the IEC standard. According to IEC standard the value of THDI is
approximately equal to 105%.The designed lamp have 173.40 value of THDI which exceed
the maximum limit, Hence the generated harmonics issued from designed LED lamp will
be reduced by adding the harmonic filter at the input of the LED lamp.

Page 85 of 97
CHAPTER5- CONCLUSION, FUTURE

RECOMMENDATIONS

5.1 CONCLUSION
Remote controlled LED lamps open a door to a new era of more efficient and energy saving
LED lighting systems. LED lamps have been proved to be very flexible in controlling
almost all the features of light and hence by combining them with the digital control
domain, their efficiency can be taken to new heights.

With the already developed sector of Power Line Communication, several operating
conditions of the LED lighting fixtures can be sensed and controlled like temperature and
current leading the LED lamps to operate at their maximum efficiency. This can lead to the
design of more energy saving LEDs.

With the use of microcontroller, it is possible to program the LED lighting system in
accordance with the natural cycle of domestic users as well as the industrial needs. This can
lead to considerable reduction in the energy consumption of the LED lighting systems.

By controlling the LEDs in two different ways i.e. via Bluetooth as well as Wi-Fi, makes
the wireless connection more reliable and gives more options to the users to make wireless
connection as per their convenience.

In conclusion, a new era of intelligent lighting systems is coming which will make our life
more comfortable and convenient and our project is a contribution towards it.

5.2 FUTURE RECOMMENDATIONS


Following are the future recommendations to make further developments in the project
which have not been made due to several reasons including shortage of time, unavailability
of components etc.

Page 86 of 97
5.2.1 ALUMINUM PCB
Since we have used 1 watt LEDS therefore, considerable amount of heat dissipation occurs.
The best solution to cool down the LEDs is the use of Aluminum Printed Circuited Board
(PCB) though we have used individual heat sinks for each LED which would compensate
the need of using Aluminum PCB but for better designs of the lamp we recommend the
circuit should be drawn on an Aluminum PCB.

It should be noted that Aluminum PCBs are not locally available in Pakistan and the nearest
port to make their shipment is China.

5.2.2 HEAT SINKS


If the lamp is to be produced on commercial scale for long time use, we recommend that
heat sinks should be used for all the electronic components involved in the circuit i.e.
Arduino Nano, ESP8266 module, ULN2003a IC and HC-05 Bluetooth module. However, if
the lamp is to be produced for testing purpose for short time usage only then the use of heat
sinks is not necessary.

Please note that these heat sinks are not locally available in Pakistan.

5.2.3 COMPACT HOUSING


For commercial production of the project, we recommend a compact housing should be
designed for the placement of the lamp circuit. Since in this project our main focus has
been the design of circuitry and programming, therefore, to save time we have used the
outer body of another lamp to serve as the housing of our lamp.

5.2.4 SELECTON OF MORE EFFICIENT LEDS


To make the project more competitive in the LED lamps’ market, it is recommended to
select LEDs with better lumens and CRI (color rendering index) in future. Since a large
number of LEDs is present in the market, so the selection of LEDs is an area where
betterment can always be made.

5.2.5 COMPACT POWER SUPPLY


To make the circuit of the lamp more compact therefore more compact housing, it is
recommended that a compact power supply should be designed for the lamp which can

Page 87 of 97
convert 220 volts AC to 5 volts DC with a current of 2 Ampere. We have used a standard
5volts, 2 Ampere power supply commonly available in the market.

5.2.6 SMALL SIZED ELECTRONIC COMPONENTS


Reductions in the size of electronic components have been made since ever specially IC
design is a domain becoming continuously compact. This is one of the reasons we have
used Arduino Nano instead of Arduino UNO in our project.

It is therefore recommended to use the latest electronic components available in future


including Arduino microcontroller.

5.2.7 CURRENT CONTROLLED DIMMING


Conventionally, dimming of LED lamps is done by voltage controlling which severely
affects the power factor of the LED lamp, hence leading to a penalty from the power supply
company for industrial consumers. To solve this issue industries have to make special
arrangements for the betterment of power factor due to increasing use of LED lighting in
industries.

A far better way to dim the LED lamps without affecting the power factor is dimming
through current controlling.

It is recommended to use the pulse width modulation (PWM) output of the Arduino
microcontroller for current controlled dimming.

Page 88 of 97
REFERENCES:
i) Digital LED Lighting Solution by A.W. Louw and C. Neethling.

ii) Design of a Transformerless High Power factor Low frequency LED driver
applied to street lights by Fernando J. Nogueira, Edmar S. Silva, Thales S.
Gomide, Mateus F. Braga and Henrique A. C. Braga.
iii) Intelligent LED Lighting System and Sensor Technology by Xiaobing
Cao,Daishun Zheng
iv) High Precision Indoor Positioning Using Lighting LED and Image Sensor by
Mohammad Shaifur Rahmant, Md. Mejbaul Haquet, Ki-Doo Kim
v) Harmonics and Thermal Characteristics of Low Wattage LED Lamps by Sohel
Uddin, Hussain Shareef, Azah Mohamed, Muhammad A Hannan.

Page 89 of 97

Você também pode gostar