Grup 1 P04-Touch Sensitive Dimmer

23
İYTE – Department of Electrical and Electronics Engineering EE 316 – Electronic Project Design EE 316 - Electronic Design Project Project: P04 Touch Sensitive Dimmer Final Project Report 2 May 2010 Objective Main objective of this project is designing a dimmer that is controlled by touching anywhere on a conductive enclosure. The dimmer that is required runs under 220 V AC and it reaches its maximum power (100 Watts) by 8-steps. These steps should be adjusted for human perception of light intensity. The controlling algorithm of lamp should be like that initially lamp is off and it opens with a touch, steps are increased by a touch (<0.25 sec), long or continuous touches increases the power at a rate of 4-steps, when the power reaches the maximum or minimum level, steps run reverse direction and lamp shuts down with double click. Group Members Marvis MİLE: “Touch Sensitive Circuit” İsmail YILDIZ : “Control Part of Circuit” Göksenin BOZDAĞ: “Dimmer Circuit”

Transcript of Grup 1 P04-Touch Sensitive Dimmer

Page 1: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

EE 316 - Electronic Design Project

Project: P04

Touch Sensitive Dimmer

Final Project Report 2 May 2010

Objective Main objective of this project is designing a dimmer that is controlled by

touching anywhere on a conductive enclosure. The dimmer that is required runs under 220 V AC and it reaches its maximum power (100 Watts) by 8-steps. These steps should be adjusted for human perception of light intensity. The controlling algorithm of lamp should be like that initially lamp is off and it opens with a touch, steps are increased by a touch (<0.25 sec), long or continuous touches increases the power at a rate of 4-steps, when the power reaches the maximum or minimum level, steps run reverse direction and lamp shuts down with double click.

Group Members Marvis MİLE: “Touch Sensitive Circuit” İsmail YILDIZ : “Control Part of Circuit” Göksenin BOZDAĞ: “Dimmer Circuit”

Page 2: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

Revision History Week 4: We decided to use 2051 processor instead of 8051 processor. Although both of them are in the same family , 8051 has too many pins and 8051 enclosures too much place on the board but we do not need all pins of 8051.On the other hand, 2051 has a less memory than 8051 but its’ memory is enough for our project. Week 8: We decided to change the flow chart of control part design. When we design the project as the old flow chart, lamp is on at start and we solved this problem by changing step0s’ timer value from D8EFH to DAE3H because only problem at step0 not other steps. The reason of the problem caused from passing next pulse because D8EFH equals to exactly 10ms but also we use triac drive value that is 150µs. Another problem was that when we make double click, lamp go off then increase one step. We thought that double clicks’ second click is read by the program and cause to increase one step. We solved it by adding some flags to flow chart. Week 9: We decided to use a circuit including three transistors instead of a IC (Atmel QT100X series) and its’ application for touch sensitive circuit part of our project.

Page 3: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

1. Introduction To make a “8-Step Touch Sensitive Dimmer”, we have to solve three main

problems written below.

1. Touch Sensitive Circuit : We must detect the human touch on a conductive enclosure to activate the pins of microcontroller. Activation of pins is made by supplying logical 0 or 1. JFETs and BJTs can help us for touch detection.

2. Control Part of Circuit : A microcontroller can detect the types of touch (single, double or continuous) and drive the dimmer circuit. If we use well synchronized signal for microcontroller, we can easily use it to determine the time delays for 8 steps. 2051 microcontroller can be used for this part of the project.

3. Dimmer Circuit : Lamps usually runs under 220V AC. A 100W lamp have to dim in 8-steps as the our project requirements. A triac can be used for dimming the lamp. Triggering pulses of triac can be supllied by the microcontroller. Using an optoisolator between microcontroller and triac had better isolate the other part of circuit from the dimmer part of circuit. 1.a JFETs Electrons are pass through the only N type or P type substrates in JFETs and they work only with the majority carriers. Their input resistance are very high (100MΩ) so they do not load the connected circuit. Additionally, they are preferred as a component for input circuits because they produce very low noise. There are two types of JFETS. [1] N-Channel JFET: P-Channel JFET:

Page 4: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

As seen from the figure above, a JFET has three pins (Source, Gate and Drain). While VGS decreasing from 0, channel between substrates narrows and in this duration ID flows from drain to source. When VGS is smaller than VP (pinch-off voltage) this current does not flow. This working principle is valid for N-Channel JFETs. 1.b BJTs There are two types of transistor, one of them is NPN and another one is PNP. They have three layers that are base, collector and emitter. In general, these transistors consist of two diodes. If positive layers of diodes are combined, the transistor is called NPN, If negative layers of diodes are combined, it is called PNP.

The transistor runs under some modes such as active, saturation, inverted and cut off. We can understand the transistor mode according to biasing polarity. The table which is shown below tells us biasing mode polarity.[1] BIASING MODE BIASING POLARITY EB BIASING POLARITY CB SATURATION FORWARD FORWARD ACTIVE FORWARD REVERSE INVERTED REVERSE FORWARD CUT OFF REVERSE REVERSE To operate a transistor, we need to supply minimum 0.7V to base layer. Minimum biasing voltage can be change according to type of diodes such as for germanium diodes, its’ value is 0.3V. After supplying VB voltage, there will be a base current(IB). When IB flows from EB diode, carriers occurs between collector and emitter. By the help of these carriers, an collector current (IC) flows from collector to emitter. We called emitter current (IE) which is seen on emitter layer. Between these currents, we can write these main equations: IE = IC+ IB β= IC / IB α= IC / IE

Page 5: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

N-TYPE BJT: P-TYPE BJT:

2.a 2051 2051 is a member of 8051’s family. Also, 2051 is a low-voltage and high performance CMOS 8-bit microcomputer with 2K bytes of programmable flash memory, 15 programmable I/O lines, six interrupt sources, two 16-bit timer or counter and 128 bytes of RAM. These specifications makes 2051 ideal for many applications in which cost and space are critical. In the 2051, the stack dept is limited to 128 bytes, amount of available RAM. On the other hand, it is not possible to add an external data memory to the controller.2051 has 20 pins and 2 I/O ports: P1(P1.0…P1.7) and P3(P3.0…P3.7). Pin configuration of 2051 is shown below.[2]

[2] Reset Operation: We need to make reset operation. It can be done easily by using a capacitor that is connected between reset pin and 5V DC and using a resistor that is connected between reset pin and GND. Oscillation Operation: An oscillator produces square waves periodically and this waves are generally used for timers. This operation can be done easily by using a crystal between XTAL1 and XTAL2 pins and using capacitors between XTAL pins and GND.

Page 6: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

(Oscillation Circuit)

3.a Triac A triac generally is used for controlling AC power and AC switching applications.The triac has a pnpn structure and it includes two inverse parallel configurated SCRs (Thyristors) in its inner structure. A thyristor can be used for only one cycle of AC voltage but triac can be used for both positive and negative cycles of AC voltage thanks to its inner structure. The device has three layers: Anode1, Anode2 and Gate [3]

Triac Operation Principle: When a current flows through the gate, a current flows from the high potentional anode to low potentional anode. This idea can explained as below: Let we supply AC current between A1 and A2 (assume that A1 is positive and A2 is negative) and also a positive pulse is supplied to gate. Then a current flows from A1 to A2 until supplied AC current equals to zero between A1 and A2. Now let assume that A1 is negative and A2 is positive and a negative pulse is supplied to gate, a current flows from A2 to A1 until supplied AC current equal to zero between A1 and A2. As as result, when we supply positive pulse to gate, current flows

Page 7: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

negative to positive and when we supply negative pulse to gate, current flows positive to negative. AC Power Control: When trigger angle equals to phase angle, we get maximum output. However, when trigger angle is greater than the phase angle, triac will block some portion of the input voltage until it is retriggered. If trigger angle is less than phase angle, output in one direction will not have fallen back to zero.at the time that the device is retriggered in the opposite direction.

3.b Optoisolator Optoisolators contains two main components. One of them is Light emitter part and the other one is Light detector. Light emitter part places at the input and it converts the coming signal to light signal. A Led can be used as a light emitter. Light detector part places at the output and it detects the light signal and converts this signal again to electrical signal. Phototransistors and photodiodes can be used as a light detector.[3]

Page 8: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

2. Design Summary .

We have 220V AC voltage. This voltage is used for 100W lamp and operation of zero crossing part. Output of the zero crossing part is periodic square wave. In addition to 220 V AC, we also need 5V DC for microcontroller and touch sensitive circuit. We get 5V DC from 220V AC. The lamp power in the dimmer part of circuit should be adjusted in 8-steps according to touch types that are single, double and continuous touches. Touch sensitive circuit detects the touch on a conductive enclosure, then generates square weves and controller decides the type of touch. After determining the touch type, controller produces a triggering pulse for the triac gate. By this triggering pulses, lamp power is adjusted.

Initially, we tried to use a another touch sensitive circuit . This circuit included an IC called 555 that produces pulses periodically. Although, this ICs’ frequency can be adjusted by changing the values of resistors, we could not detect double touches with this circuit .Additionally, response time of the circuit to single touch and continuous touch was not in a acceptable range so we decided to work another type of touch sensitive circuits.

Block diagram of the 8-steps touch sensitive dimme

Page 9: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

3. Design Blocks 3.a. Zero-Cross Detector (Göksenin BOZDAĞ)

To generate the zero-cross signal, we designed the circuit shown in above.

When positive cycle comes first diode is on second diode is off and the Light Emitting Diode (LED) in the TLP-521 is on. When negative cycle comes all diodes are off. When LED is on, IB currents flows and phototransistor works. When LED is off, IB currents does not flow and phototransistor does not work. In our design, output is VCE voltage of phototransistor. When phototransistor works: 5V= Rc×IC + VCE If IB current flows, IC current flows so VCE equals to almost 0. When phototransistor does not work: 5V= Rc×IC + VCE IB does not flow so VCE equals to 5V.

U2

TLP521-12

1

3

41N4007

1

1

22kΩ

220 Vrms

50 Hz

XSC1

A B

Ext Trig+

+

_

_ + _

R1

4.7kΩ

V1

5 V

1N4007

2

Page 10: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

TLP-521 This component is a photocuplor (optocuplor). It has 4 pins , includes a LED and a phototransistor. It is manufactured by Toshiba. When LED is on, phototransistor works. When LED is off, phototransistor does not work. It is used generally for isolation and switching. The critical values of the component are: [4] VCC 5V - 24V (max) IF 16mA - 25 mA (max) IF 70 mA (for LED) IC 110mA Isolation voltage is 2500 V Current Transfer Ratir (IC/IF) 50 – 600 (max)

.

3.b. Dimmer Circuit (Göksenin BOZDAĞ) In this project, we use a 100W incandescent lamp and we want to dim this lamp in 8-steps. Dimming operation can be done by a triac with phase control. Triggering pulse for each phase generates by microcontroller. An optocuplor detects this pulse and transmits it to triac.

TRIAC: As seen from the figure above, triac gate is driven by the MOC 3021. Triac is a bidirectional component so when a current flows on the gate, we get response both positive and negative cycles of line voltages. The triac used in this design is BTA06-400C and it is manufactured by ST.[5] BT means that this component is a Triac. A means that this component is isolated. 06 means that the maximum current of this component is 6 A. 400 means that the maximum voltage of this component is 400 V. C means that the sensitivity of this component is 0.25 mA.

Page 11: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

In addition to triggering pulse amplitude on the gate of triac is 1.65 V and VGT =1.3 V. Trigger times are calculated by the formula written below: [6] The Formula of Linearization: V=(V/ √2)√(((1/pi)(pi-α+(sin2α/2))

I used 8 instead of

√ as a constant and I plotted the figure with MatLab to dermine

the phase angle sensitively.

I calculated the phase angles by using the figure seen in above. Then I did a basic calculation to determine time delays. In our country, supplied line voltage is 50 Hz .

T=1/f T=1/50 T=20 msec T/2= 10 msec If π degree angle passes in 10 msec, what is the duration of x degree angle? Using this key idea I calculated the delay times. The power of each steps are calculated by using the formula written in below. Vrms and Irms are measured from the circuit. P=(VPIP/2π)((π-θ+(sin2 θ)/2)=(VRMSIRMS/π)(π-θ+(sin2θ)/2)

Page 12: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

OPTOCUPLOR: In this design, we use a optocuplor ,called MOC 3021 and manufactured by Texas Instruments, for isolating from high voltage part of circuit to low voltage part of circuit. IFT (Input trigger current) is typically 8 mA. [7]To drive this component with the microcontroller, the anode of the photodiode is connected to 5V DC and its’ cathode is connected to output pin of microcontroller . By this way we get the enough current to drive the moc 3021. Critical specifications of MOC 3021 are: IFT= 8mA (typ) and 15 mA (max) Output on-state current, total rms value (50-60 Hz, full sine wave 100 mA [7] For this critical values, microcontroller can drive the optocuplor and also optocuplor can drive the triac. (MOC 3021 works during the negative cycles of 50 Hz line voltage because it has a phototriac and I explained the the working principle of triacs . In the second project report, we had to use phototransistor instead of phtotriac to express the optocuplor because our spice program did not have the moc 3021 symbol.)

3.c 5V DC Supply (Göksenin BOZDAĞ)

Steps Lamp Power (W)

AC Voltage (Vrms)

AC Current (mArms)

Trigger Angle (degree)

Trigger Delay (msec)

1 0.25 2 65 156 8.67

2 0.37 2.4 80 140.45 7.8

3 0.76 3.2 120 127.3 7.07

4 11.04 34.5 160 114.1 6.38

5 34 86 200 99.75 5.54

6 55 116.5 240 83.7 4.65

7 89 154 290 64.2 3.57

8 117 218.5 310 11.5 0.65

Page 13: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

In this part of circuit, we get 5V DC from 220 V AC by using some special components and circuits: Transformator, full wave rectifier, filter and a regulator (7805). We need this voltage to supply touch sensitive circuit and microcontroller. -Line voltage (220 V AC 50 Hz ) directly connects to inputs of the transformator (2× 9V, 2 Watts).Transformator decreases the amplitude of line voltage from 220 V AC to 9V AC. The component has three output pins, mid-pin is ground and the others are 9V AC.

-Full wave rectifier is done by using 2 diodes. One of these diodes works always, when the positive cycle comes one of them is on, when the negative cycle is come, the other one is on. Rectified signal shown in below.

-We filter this rectified signal by using a capacitor to get a closer DC voltage signal. 7805 We use a regulator called 7805 and manufactured by Fairchild semiconductor. This components provides us required 5V DC signal. 7805 has three pins and mid-pin connects to ground.You need to feed it between 8 volts and maximum 35 Volts [8] We connected two capacitors CI and CO. Connection of these capacitors does not necessary but the CI is required if regulator is located an appreciable distance from power supply filter and CO improves stability and transient response.

Page 14: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

3.d Touch Sensitive Circuit (Marvis MILE)

Human touch is detected by a conductive copper enclosure. I thought that it is a good choice to use a JFET to detect human touch because JFET’s are used as a component for input circuits elements. They produce very low noise and have very high input resistance (100MΩ) ,so they do not load the connected circuit. Actually I would use 2N5458 N-Channel field effect transistor but I couldn’t find this element so I used BF245A JFET [8] . They are from the same family just their layer was different place. On the other hand, we couldn’t obtain high enough current in the output of BF245A so we used two transistors that are connected in cascade to amplify the current. The transistors used are 2N2222 NPN and 2N3906 PNP.

According to our design, our microcontroller detects the touch types and calculate its delay time. Therefore we just need to obtain logic 0 or 1 from the output. As a result I used JFET and BJT’s instead of buffers.

Figure: Touch Sensitive Circuit

When we touch to conductive enclosure , approximately 50mV voltage come out from our finger. After that , between gate and source a VGS voltage will occur. That voltage is higher than VP (pinch off voltage), so ID current flow from drain to source. It means that 2N2222 transistor is off and the 2N3906’s base current flow from 120KΩ to 470 Ω resistor. Then 2N3906 is on and IC current flow from emitter to collector and a voltage will appear on RLoad. However, we don’t know the value of RLoad so I used randomly a small valued 390Ω resistor(not to effect to empedance) to measure output voltage.

VCC=(120K+470Ω)*IB

5V=120.47KΩ * IB so IB=0.042mA = 42µA According to datasheet I choose β=300 IC=IB * β=42µA*300=12.6mA

5V=12.6mA * 390Ω + VCE VCE=5V-4.9=0.1V so VOut = 4.9V

Output

Page 15: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

When we don’t touch to conductive enclosure, we cannot drive the JFET it means that 2N2222’s IB current flow from 47KΩ to base and this transistor is on. Therefore, 2N2222’s IC current flow from 120 KΩ to ground. After that, 2N3906 is off so it means that there is no IC current and O V from output.

We draw and calculate the AC analyze of touch circuit in order to find the gain Vo=Vin as we see below.

Vi=Vgs

ID=gm1Vgs+Ib1 ise ID=gm1Vi+IB1

IB1=IC1/β1

ID=gm1V1+IC1/ β1 ise IC1=(ID-gm1Vi)/ β1=IC1

IB2=IB1+I1

IB2=(ID-gm1Vi)/ β1+I1 ise IB2=IC2/ β2 and (ID-gm1Vi)/ β1+I1=IC2/ β2

Vo=IC2 * RLoad

Vo=(((ID-gm1V1) β2)/ β1+I1 β2)RLoad

Now we also drive to find some some value to replace I1.

ID*RD= - VB= - Vrπ1

IC1=gm2 * Vrπ1 so IC1=gm2 * IDRD

Again from IC1+I1=IB2 - gm2 * IDRD +I1=IB2

So I1=IB2+gm2 *IDRD Finally,when we drive I1 into Vo we get :

Vo=(((ID-gm1V1)β2)/ β1 + (IB2 + gm2 * IDRD)β2)RLoad

The small signal drain current is related to the small signal gate to source voltage by the transconductance gm. The relationship is:

gm= ID/Vgs=2Kn(VgsQ-VTN)

The β1and β2 are constant and we found them from datasheet

Page 16: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

.

3.e.Control Part of Circuit (İsmail YILDIZ)

In this part of project, only a 2051 microcontroller and its required connections is used such as reset and OSC circuits. For the reset operation I used 470nF capacitor and 4.7KΩ resistor. These values are not critical so we can choose nearest values. All I/O pins are reset to 1s as soon as RST goes high. However, it is not valid for OSC circuit because components are used is very critical especially crystal. According to datasheet, I decided to use 22pF capacitors whose range is between 20pF and 40pF and 12MHz crystal whose range is between 0 and 24MHz. The train square waves’ period generated by OSC can be change by changing the value of crystal. It means that crystal is very significant for timer delay or loop calculations. Actually, in this part, software is used more than hardware. [2]

I used 12MHz crystal so in original 2051, one machine cycle lasts 12 oscillator periods. Finding the period of the machine cycle for 12MHz crystal frequency is like that for one machine cycle[9]: 12MHz/12=1MHz T=1/f=1/1MHz=1µs It means that each codes has different machine cycle and according to these machine cycle, delay time can be calculated by multiplying total machine cycle with 1µs. For example; Codes Machine cycle DELAY: MOV R3,#200 1 HERE: DJNZ R3,HERE 2 RET 2 Therefore, [(200x2)+1+2]x1µs = 403µs.

We see same important assembly codes that I used often to program our project: JZ ;Jump if A=0 SETB bit ;bit=1

Page 17: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

JNZ ;Jump if A!=0 CLR bit ;bit=0 DJNZ ;Decrease and jump A!=0 CJNZ ;Compare and jump A!=0 JB bit, target ;Jump to target if bit = 1 MOV A,R2 ;A=R2 JMP target ;Jump to target INC A ;A=A+1 DEC A ;A=A-1 TR BIT P3.1 ;TR=P3.1[9] These are the important DC parameters for 2051 microcontroller: -The pulses that enters to the 2051s input pins must be between 3.5V and 5.5V for input high voltage. -For input low voltage, the range is -0.5V and 0.9V. -For output low voltage, when IOL = 20 mA, VCC = 5V is maximum 0.5V. -We have to supply max -50µA for logic 0 input current. -We have to supply max -750µA for logic 1 input current. [2] Software of the microcontroller is processed according to synchronized signal and types of touch. We get 5V 50Hz(f=1/T=20ms) DC square wave which is negative edge according to line voltage from zero cross detector circuit. It is very critical to detect the zero crossing points by microcontroller. We can do it by a infinite loop that always finds zero crosses. The flow chart seen blow is a zero cross finder by microcontroller.

When program detect the zero cross point ,it has to set timer to 10ms because one cycle is 20ms. It will be enough to make operation for one half cycle because we control the lamp by triac that let the pass current for both positive and negative cycle of line voltage(220V AC). 10ms means at assembly language D8EFH. For example, if we want timer to count 5 µs, we have to set timer FFFBH(65531D). The calculation is like that the timer counts until FFFFH (65535D). We set timer to FFFBH(65531D) due to the fact that FFFFH(65535D)- FFFBH(65531D)=4+1(from overflow)=5. 5 means 5µs if 1 machine cycle equals to 1µs. For our project, we have to set timer D8EFH because 65535D (FFFFH)-10000= =55535(D8EFH). After we set the timer, program has to control whether a pulse come from touch circuit. By activating the interrupt vectors, we can control the touch circuit whether somebody pressed to conductive envelope or not.

Page 18: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

When we get a pulse from touch circuit, first program will call the interrupt vector. Then determine whether interrupt comes between 10ms or not. In other words, program determine at which state(state0 that is positive cycle of 220V or state1that is negative cycle of 220V). If interrupt comes at state0 or between 10ms, again we have to set timer to 10ms for negative cycle of line voltage. After that program calls switch read to determine type of touch. According to types of touch requirement, accumulator is loaded with a value that shows step level of lamp. Then program will call the look up tables where eight steps timer values are found for loading timer to determine the delay. There are two look up tables, look up table low and look up table high. The reason is to load timer low and timer high because timer consists of two parts. For 2051 or 8051family, the wide of addresses is max 8-bits but we have to load 16-bits so timer low and timer high are used for in general. After loading the timer from tables, we have to use a short delay such as 150µs because we cannot drive the triac with a drac so it must be a bit wide. At below, we see pulse forms for explanation of program.

Page 19: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

We see above a flowchart that determines the types of touch. It is a bit different from the old one that I used second report. The yellows are added to old one because there was some problems. By adding them we solved those problems that I explained revision part.

Page 20: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

4. Conclusion

“This design works properly and satisfies all project requirements”

4.a. Zero-Cross Detector Test Results We can get 0V when positive cycles, and we can also get 5 V signals in 50 Hz from our zero-crossing circuit. We could not detect and determined any faulty or timing error for this part of circuit.

4.b. Dimmer Circuit Test Results The response time of our dimmer circuit is shorter when we used a switch instead of touch sensitive circuit. This delay can be caused from the conductive enclosure and the natural responses of the touch sensitive circuits. On the other hand; triac gets its triggering pulses on time and gives its response in a acceptable duration. Measured and expected voltages and currents almost equals each other. The measured voltages and currents listed as below.

AC Voltage (Vrms) AC Current (mArms) 2 65

2.4 80

3.2 120 34.5 160

86 200 116.5 240

154 290

220 310

Page 21: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

4.c. 5V DC Supply Test Results I measured 4.98V between the third pin of 7805 and ground, signal is regulated and stable but we expected 5V . This is not really important faulty because we can use this signal both in touch sensitive circuit and feeding the microcontroller without any problem.

4.d. Touch Sensitive Circuit Test Results

As is it shown in the figure above I measure and test the DC current, DC voltage, AC current and AC voltage in main nodes of the touch sensitive circuit. We approximately did get the same measure value with calculated values in all nodes . We calculated Vout= 4.9 V and we measure from the 4.17V from the multimeter. The main reasons why we couldn’t get the same results are: We used a 390Ω resistor to measure the output voltage and current. Although we choose it small value resistor it also effect the impedance. Another reason is β, we choose its max value(β=300) from datasheet while it varies from 25-300.On the other hand multimeter may be not so stable,in this way all these may affect the Vout and we cannot get the exactly 5V voltage.

Page 22: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

4.e. Control Circuit Test Results Actually, from the beginning to success of the assembly code, we loaded different assembly codes to microcontroller many times because it was not working on board correctly although the simulations were correct. However , at the end we were able to load correct assembly code. It is important thing that our microcontroller output is activated at logic0. It means that for no operation, output must be loaded with logic1. Therefore, our project combination between MOC 3021and 2051s output must be according to logic0 because 2051 output high current is maximum 12µA and output low current is maximum 20mA. Because of this reason, we activate MOC3021 with logic0 whose typical drive current is 15mA. We measured 0.13mA that is enough to drive the MOC. Our combination is like that

instead of

Page 23: Grup 1 P04-Touch Sensitive Dimmer

İYTE – Department of Electrical and Electronics Engineering

EE 316 – Electronic Project Design

References 1. Donald A. Neamen “Microelectronics Circuit and Analysis” New York,

McGraw-Hill International Edition, 2007 2. ATMEL 89C2051 Datasheet 3.Robert Boylestad – Louis Nashelsky “Elektronik Elemanlar ve Devre Teorisi” Ankara, MEB Yayınları, 1994 4. TOSHIBA Photocuplors TLP 521-1 Datasheet 5. ST (SGS- THOMSON Microelectronics) BTA06 B/C Datasheet 6. An Article on “Thryistors and Triacs Power” Semiconductor Applications Philips Semiconductors Chapter 6 “Thyristors and Triacs Power” 7. FAIRCHILD KA78XX/KA78XXA Datasheet 8. PHILIPS BF245A (N-Channel Silicon Field-Effect Transistors) Datasheet 9. Muhammad Ali Mazidi – Janice Gillispie Mazidi - Rolin D. McKinlayTHE’’ 8051 Microcontroller and Embedded Systems’’