Bluetooth - Based Lamp Controller
Bluetooth - Based Lamp Controller
Bluetooth - Based Lamp Controller
3.11 TRIAC 30
VR : VARIABLE RESISTOR
MEMORY
PC : PROGRAM COUNTER
D : DIODE
L : INDUCTANCE
R : RESISTANCE
C : CAPACITANCE
V : VOLTAGE
I : CURRENT
L : LOAD
AC : ALTERNATE CURRENT
DC : DIRECT CURRENT
IC : INTEGRATED CIRCUITS
RL : LOAD RESISTANCE
INTRODUCTION
decreasing lamp intensity as required with simple touch. As the world gets more
and deeper into our personal lives even at home. Home automation is becoming
more and more popular around the world and is becoming a common practice.
I
ABSTRACT
The aim of this project is to build a Touch Screen based application
interface for high voltage electrical lamp dimming operation over wireless. The
and a control panel. The status of lamp intensity can be viewed on mobile
buttons for this operation. Users can control the lamp intensity with gentle
finger touch.
II
CHAPTER 1
BLOCK DIAGRAM
1
1.1. BLOCK DIAGRAM
TRANSMITTER
POWER SUPPLY
PIC 16F877A
TOUCHPAD BLUETOOTH
2
RECEIVER
POWER
SUPPLY
BLUETOOTH
PIC 16F877A
ZCD
TRIAC
DRIVER
SOURCE
LAMP
3
1.2 BLOCK DIAGRAM DESCRIPTION
A system is designed to increasing or decreasing lamp intensity as
required with the help of simple touch pad unit is main concept of our project.
Home automation is becoming more and more popular around the world and is
becoming a common practice.
The process of home automation works by making everything in the
house automatically controlled using technology to control and do the jobs that
we would normally do manually.
In our project we are using Mobile App and Bluetooth technology for
light dim and bright control. The program running inside pic-controller can
develop a virtual on screen keypad and a control panel. The status of lamp
intensity can be viewed on touch pad.
No need to have mechanical rotational based control system or push
buttons for this operation. Users can control the lamp intensity with gentle
finger touch. The light intensity ratio with switch position is given below in
table. In future we add more number switches depending on this we may
increase or decrease the lamp brightness.
% OF DATA
SL.NO SWITCH NO BRIGHTNESS OF KEY
1 1 90 *150#
2 2 70 *120#
3 3 50 *090#
4 4 30 *070#
5 5 10 *010#
6 ON 100 *000#
7 OFF 0 *200#
4
CHAPTER 2
CIRCUIT DIAGRAM
5
2.1. CIRCUIT DIAGRAM
The main drawback of the TRIAC is, it does not switch proportionally
and frequently it will have an offset, switching at various gate voltages for each
half of the cycle. This makes extra harmonics which is not worthy for the
performance of EMC and also offers a difference in the system.
7
Light Dimmer Circuit Using Triac
This light dimmer circuit is built with various electrical and electronic
components like resistors R1=68 kilo ohms, R2=280 kilo ohms and R3=10 kilo
ohms, variable resistors VR1=100 kilo ohms and VR2=200 kilo ohms,
capacitors C1, C2 and C3=0.33 uF/400V, TRIAC is BT136 and DIAC is
ER900.
The basic circuit of light dimmer using TRIAC is shown below and this
circuit depends on phase control. The variable resistor VR1 plays as a main
controller in the light dimmer circuit. The capacitor ‘C2’ in the circuit below
gets charge from the main supply. In the circuit, variable resistor VR1 and
D1 DIAC are used to control the brightness of the lower level. To overcome the
interface problem, R2 & C3 are used.
Here in this light dimmer circuit, without any change DIAC can be
replaced by the BC148 transistor. When the transistor is used instead of DIAC,
then the base terminal of the transistor not connected and remaining terminals
like emitter and collector are connected without the help of polarity. In this
circuit, diode is used as a DIAC.
CHAPTER 3
8
HARDWARE DESCRIPTIONS
HARDWARE DESCRIPTIONS
9
PIC MICROCONTROLLER
POWER SUPPLY
SOFTWARE
10
3.1.1 Introduction
The microcontroller that has been used for this project is from PIC series.
PIC microcontroller is the first RISC based microcontroller fabricated in CMOS
(complementary metal oxide semiconductor) that uses separate bus for
instruction and data allowing simultaneous access of program and data memory.
• All single cycle instructions except for program branches which are two
cycle
11
• Pin out compatible to the PIC16C73/74/76/77
• Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable
operation.
• Programmable code-protection
• Low-power consumption:
12
< 2mA typical @ 5V, 4 MHz
DATA DATA
DEVICE PROGRAM FLASH
MEMORY EEPROM
PIC
8K 368 Bytes 256 Bytes
16F877A
14
Fig: 3.2 Architecture Diagram of PIC 16F877A
15
Tab: 3.2(a) Pin Out Description
16
Tab: 3.2(b) Pin Out Description
A touch screen is an electronic visual display that the user can control
through simple or multi-touch gestures by touching the screen with one or more
fingers. Some touch screens can also detect objects such as a stylus or ordinary
or specially coated gloves. The user can use the touch screen to react to what is
displayed and to control how it is displayed (for example by zooming the text
size).
The touch screen enables the user to interact directly with what is
displayed, rather than using a mouse, touchpad, or any other intermediate device
(other than a stylus, which is optional for most modern touch screens). Touch
screens are common in devices such as game consoles, all-in-one computers,
tablet computers, and smart phones. They can also be attached to computers or,
as terminals, to networks. They also play a prominent role in the design of
digital appliances such as personal digital assistants (PDAs), satellite navigation
devices, mobile phones, and video games.
17
Historically, the touch screen sensor and its accompanying controller-based
firmware have been made available by a wide array of after-market system
integrators, and not by display, chip, or motherboard manufacturers. Display
manufacturers and chip manufacturers worldwide have acknowledged the trend
toward acceptance of touch screens as a highly desirable user interface
component and have begun to integrate touch screens into the fundamental
design of their products.
18
3.4.2 Surface acoustic wave
Surface acoustic wave (SAW) technology uses ultrasonic waves that pass
over the touch screen panel. When the panel is touched, a portion of the wave is
absorbed. This change in the ultrasonic waves registers the position of the touch
event and sends this information to the controller for processing. Surface wave
touch screen panels can be damaged by outside elements. Contaminants on the
surface can also interfere with the functionality of the touch screen.
19
Fig 3.3 Using UA 741 op-amp IC
As shown in the waveform, for a reference voltage 0V, when the input
sine wave passes through zero and goes in positive direction, the output voltage
Vout is driven into negative saturation. Similarly, when the input voltage passes
through zero and goes in the negative direction, the output voltage is driven to
positive saturation. The diodes D1 and D2 are also called clamp diodes. They
are used to protect the op-amp from damage due to increase in input voltage.
They clamp the differential input voltages to either +0.7V or -0.7V.
20
In certain applications, the input voltage may be a low frequency
waveform. This means that the waveform only changes slowly. This causes a
delay in time for the input voltage to cross the zero-level. This causes further
delay for the output voltage to switch between the upper and lower saturation
levels. At the same time, the input noises in the op-amp may cause the output
voltage to switch between the saturation levels. Thus zero crossing are detected
for noise voltages in addition to the input voltage. These difficulties can be
removed by using a regenerative feedback circuit with a positive feedback that
causes the output voltage to change faster thereby eliminating the possibility of
any false zero crossing due to noise voltages at the op-amp input.
For an input sine wave, the output of the zero-crossing detector being a
square wave, is further passed through an RC series circuit. This is shown in the
figure below.
21
Fig 3.5 Using Timing Marker Generator
If the time constant RC is very small compared to the period T of the input sine
wave, then the voltage across R of the RC circuit network called Vr will be a
series of positive and negative pulses. If the voltage Vr is applied to a clipper
circuit using a diode D, the load voltage Vload will have only positive pulses
and will clip away the negative pulses. Thus, a zero-crossing detector whose
input is a sign wave has been converted into a train of positive pulses at interval
T by adding a RC network and a clipping circuit.
22
Fig 3.6 Timing Marker Generator Waveform
23
3.5.3 Zero-crossing Detector Using IC 311 and Transistor
For a positive input signal, that is, for an input sine wave above 0 volt,
the output of the op-amp sets the transistor OFF, and the output of the transistor
goes HIGH. The low condition resembles a -10 volt in the circuit and a HIGH
condition resembles -10 volt in the circuit.
The output of the transistor indicates whether the input is more than or
less than 0 volt. In short, if the input signal is a positive voltage, the output of
the transistor will be LOW. If the input signal is a negative voltage, the output
of the transistor will be HIGH.
24
3.6. POWER SUPPLY DESCRIPTION
3.6.1. Introduction
A regulator circuit removes the ripples and also remains the same dc
value even if the input dc voltage varies, or the load connected to the output dc
voltage changes. This voltage regulation is usually obtained using one of the
popular voltage regulator IC units.
Transformer
The transformer will step down the power supply voltage (0-230V) to
(0-6V) level. Then the secondary of the potential transformer will be connected
to the precision rectifier, which is constructed with the help of op–amp. The
advantages of using precision rectifier are it will give peak voltage output as
DC; rest of the circuits will give only RMS output.
25
Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite
corners of the network, and the output is taken from the remaining two corners.
The negative potential at point B will forward bias D1 and reverse D2. At
this time D3 and D1 are forward biased and will allow current flow to pass
through them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path
is indicated by the solid arrows. Waveforms (1) and (2) can be observed across
D1 and D3.
One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3. Current
flow will now be from point A through D4, up through RL, through D2, through
the secondary of T1, and back to point A. This path is indicated by the broken
arrows. Waveforms (3) and (4) can be observed across D2 and D4. The current
flow through RL is always in the same direction. In flowing through RL this
current develops a voltage corresponding to that shown waveform (5). Since
current flows through the load (RL) during both half cycles of the applied
voltage, this bridge rectifier is a full-wave rectifier.
26
This may be shown by assigning values to some of the components
shown in views A and B. assume that the same transformer is used in both
circuits. The peak voltage developed between points X and y is 1000 volts in
both circuits. In the conventional full-wave circuit shown—in view A, the peak
voltage from the center tap to either X or Y is 500 volts. Since only one diode
can conduct at any instant, the maximum voltage that can be rectified at any
instant is 500 volts.
The maximum voltage that appears across the load resistor is nearly-but
never exceeds-500 v0lts, as result of the small voltage drop across the diode. In
the bridge rectifier shown in view B, the maximum voltage that can be rectified
is the full secondary voltage, which is 1000 volts. Therefore, the peak output
voltage across the load resistor is nearly 1000 volts. With both circuits using the
same transformer, the bridge rectifier circuit produces a higher output voltage
than the conventional full-wave rectifier circuit.
IC voltage regulators
27
The series 78 regulators provide fixed positive regulated voltages from 5
to 24 volts. Similarly, the series 79 regulators provide fixed negative regulated
voltages from 5 to 24 volts.
TRIAC
Once triggered, the device continues to conduct until the current through
it drops below a certain threshold value, such as at the end of a half-cycle of
alternating current (AC) mains power. This makes the TRIAC a very convenient
switch for AC circuits, allowing the control of very large power flows with mill
ampere-scale control currents. In addition, applying a trigger pulse at a
controllable point in an AC cycle allows one to
29
Fig: 3.11 Triac
control the percentage of current that flows through the TRIAC to the load (so-
called phase control).
Assemble, compile and link source code using various language tools. An
assembler, linker and librarian come with MPLAB IDE. C compilers are
available from Microchip and other third party vendors.
Debug the executable logic by watching program flow with a simulator,
such as MPLAB SIM, or in real time with an emulator, such as MPLAB
ICE. Third party emulators that work with MPLAB IDE are also
available.
30
Make timing measurements.
View variables in Watch windows.
Program firmware into devices with programmers such as PICSTART
Plus or PRO MATE II.
Find quick answers to questions from the MPLAB IDE on-line Help
MPLAB SIMULATOR
IC PROGRAMMER
PRO MATE II may be used with MPLAB IDE running under supported
Windows OS's (see Read me for PRO MATE II.txt for support list), with the
command-line controller PROCMD or as a stand-alone programmer
COMPILER-HIGH TECH C
31
suitable for use by a PIC micro MCU or Microchip development system product
like MPLAB IDE.
The PIC start plus programmer gives the product developer ability to
program user software in to any of the supported microcontrollers. The PIC start
plus software running under MPLAB provides for full interactive control over
the programmer.
CHAPTER 4
32
PCB DESIGN
PCB DESIGN
33
CONTROLLER DESIGN
34
Fig 4.1 Controller design
35
Fig 4.2 Power supply design
BLUETOOTH DESIGN
36
CHAPTER 5
37
COMPONENTS LIST
COMPONENTS LIST
38
CHAPTER 6
39
ADVANTAGES AND APPLICATIONS
ADVANTAGES AND APPLICATIONS
ADVANTAGES
APPLICATIONS
40
CHAPTER 7
41
PROGRAM CODING
PROGRAM CODING
#include<pic.h>
int j=0,sel=0,val,ang=45,adh=0,adl=0;
void main()
{
ADCON1=0X82;
TRISA=0XFF;
TRISC=0X80;
TRISB=0X0F;
TRISD=0X01;
RB4=0;
val=34.5*ang;
adh=0XFF-(val/0X100);
adl=0XFF-(val%0X100);
GIE=1;
PEIE=1;
INTE=1;
INTEDG=0;
INTF=0;
TMR1IE=1;
42
TMR1IF=0;
T1CON=0x30;
TMR1L=0XDB;
TMR1H=0XF3;
TMR1ON=0;
while(1)
{
}
}
void interrupt isr(void)
{
if(TMR1IF==1)
{
TMR1ON=0;
RB4=1;
for(j=0;j<200;j++);
RB4=0;
TMR1L=adl;
TMR1H=adh;
TMR1IF=0;
}
if(INTF==1)
{
if(sel==0)
{
sel=1;
43
INTEDG=1;
}
else if(sel==1)
{
sel=0;
INTEDG=0;
}
RB4=0;
TMR1ON=1;
INTF=0;
}
}
44
CHAPTER 8
45
COST ESTIMATION
COST ESTIMATION
46
CHAPTER 9
47
CONCLUSION
CONCLUSION
phones and mobile devices are each time more powerful, using them as robot
for building robot with advanced feature such as voice recognition. Android
tooth devices. It is concluded that smart living will gradually turn into reality
FUTURE WORK:
The knowledge is ever expanding and so are the problems which the
mankind strive to solve. In this spirit, it is hoped that the current activity will
48
CHAPTER 10
49
BIBLIOGRAPHY
BIBLIOGRAPHY
REFERRED WEBSITES
https://en.wikipedia.org
http://electronicsforu.com/newelectronics
http://pic-microcontroller.com
50
CHAPTER 11
51
PHOTO COPY
PHOTO COPY
52