Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

IR Remote Control Learning Dimmer or Heat Control

This circuit has the following features:


1.- It works with main frequencies of 50 or 60 Hertz.
2.- It works with main voltages of 117 or 220 VAC.
3.- It is connected in series with the load and can replace any conventional
switch without any modifications.
4.- It works with only one switch.
5.- It can control the brightness level of any heat element, incandescent or
alogen lamp.
6.- It has the ability to learn up to four control codes of a common infrared
control.

Circuit description:

As it can be seen in figure 1 the circuit is very simple. To better understand


the operation of the circuit, it is divided in the following sections:
1.- SUPPLY SOURCE

Design Conditions
Vcc = 5 Volts
Iload = 4 mA

When a power source is needed for a microcontroler, the first thing that
comes to mind is the option of using a combined transformer with a rectifier
bridge, a power regulator and the classic filter capacitors, as shown on picture 2
(A). This guarantees the power source to be isolated from the line as well as a
good power availability. There are two main disadvantages: the cost and the space
that the transformer occupies. This type of power source wouldn’t be useful for
the circuit presented, since it needs a power source in series with the Load.
The next option is using a resistance to lower the voltage (see figure 2 (B)).
But because we have to lower the voltage form 117 volts to 5 volts, with a
minimum power current of 4 mA, the current of the Load has to be duplicated.

This is due to the fact of only rectifying half wave. The following calculi
was worked out as follows:

R = (VLINE - Vcc )/ 2Iload

R=112Volts/8mA.

R=14 Kohms.

This disipates:

P=I2R

P=0.896W.

This answer seems adequate, but because the circuit is connected in series
with the Load when the lamp being controlled is at its brightest, the available
voltage is 20 VRMS. The available current is I=15 V/14 K I=1.071mA , which
leaves the circuit unfed.

Of course this could be recalculated for the worst case and get a resistance
of R=15 V/8 mA R=1.875 K, but the disadvantage is that when the lamp is turned
off the current is I=112 V/1.875 K I=59.76 mA. Besides, the excess current has to
be disipated by the Zener. And the resistence has to disipate 6.69 W. This will
cause the circuit to become hot. This is why this option is discarded. Another
reason why it is discarded is that the option of feeding the circuit with 220 Volts
would duplicate what has been calculated up to now.

The third option is a combination of a resistance, a capacitor and a clamp-


diode (see figure 2 (C)). These are calculated when we have the lowest voltage. In
this combination the capacitor phases out the current 90 degrees as shown in figure
3:
Figure 3:

Thus the resultant impedance of the combination is given by:

The current is:

Whe the value of C is worked out from the above equation, the following is
obtained:

The circuit requirements are:


minimum V = 20 V
VCC = 5 Volts
I = 4 mA
f = 60 Hertz
R = 5 Ohms

The calculated value of the capacitor is 0.7073 uF.

The nearest standard value capacitors are 0.68uF and 0.82uF. To operate the circuit
the value of 0.68uF is used. The reason for this is that the 4mA is needed only
when the TRIAC is triggered. This trigger lasts only a few microseconds.

Below is a brief description of the used components in the power source


circuit.
It is composed of C4, R3, R4, R7, D3, D1, C2 and C5, and its operation is truly
simple:

The reactance Xc of the condenser C4 limits the current aplied to the Zener,
and because C4 removes the direct current, D3 rectifier form a clamp circuit for the
voltage aplied to the Zener which sustains the supply at 5.1 Volts. C5 removes the
voltage variations to keep it stable, and C2 filters the high frequencies.
It can be noticed that the power source is connected in parallel with the
TRIAC and that the lamp to be controlled is connected in series with such power
source; this limits the maximun brightness of the load approximately at 97%, which
is practically imperceptible as seen in the next chart.

2.- ZERO CROSSING DETECTOR


Composed of D2, R5 and R6. Actually it is not a crossing detector, but a
half-wave rectifier, therefore only one crossing is detected and the microcontroller
software calculates the trigger of the second half cycle.

3.- TRIGGER CIRCUIT


Both the pin MT1 of the TRIAC and the microcontroller power source
(+5V) are tied to the line. The pin of the microcontroller is held in a high Z.
To trigger the TRIAC, the gate is driven to ground via the current limiting
resistor R2.
This combination takes advantage of the fact that the microcontroller has
more capacity of sink than source current and triggers the TRIAC with the negative
current in its gate, which is where most of these elements need less current to
operate.

4.-SNUBBER NETWORK
This is composed of C1 and R1 and its function is to avoid false turn-on of
the TRIAC.

5.- IR RECEPTOR MODULE


The receptor module decodifies the signal of any common remote control
transmitter. When the microcontroler is in its programming routine, which will
later be explained, it receives the code and it stores it in its EEPROM memory.
When the dimmer is normally operating and receives the same code, it acts as if it
were pressing the control switch. This will allow us to operate the dimmer from a
distance.

6.- FILTERS
The circuit has a filter to avoid radiation and disturbances in the line due to
the TRIAC operation. This filter is composed by the inductance L1 that can be
built wrapping it 10 turns with a 22 AWG wire in a a 25 mm. toroide core.
Seeing that the circuit is fed with a voltage that has severe variations, the
voltages that feed the microcontroller and the infrared receptor need to be filtered.
For the microcontroller this is done by R3, C3 and C7. Module IR is done by R10,
C8, and C9.

7.- SOFTWARE
The functioning of the software is explained graphically in figure 4.
When the supply is applied, the following happens:
The microcontroller calculates the main frequency and completely turns off
the lamp. It waits for the control switch to be pressed.
If the control switch is pressed and released immediately, the brigthness will
increase slowly until it reaches the maximum level.
If the control switch is pressed and remains pressed, the brightness will
increase until it is released.
If the control switch is pressed and released, and the lamp is totally or
partially on, it will decrease its brightness until it is off.
If the control switch is pressed and remains pressed, and the lamp is totally
or partially on, it will decrease its brightness until it is released.
START
INTERRUPT

USING TMR1
MEASURE THE LINE FREQUENCY
CALCULATE HALF WAVE TIME GP2 TM
INT. R1
INT.
YES FIRE TRIAC

ENABLES INTERRUPTS YES

START TMR1 WITH


HW
DELAY TIME
C
DISABLE GP2 INT.
=0
ENABLE TMR1 INT. BCF HWS
ENABLE
YES
GP2 INT.

PGR
M BSF HWC
START TMR1 WITH HALF
WAVE TIME
YES

YES

INITIALIZE EEPROM INITIALIZE


CODES = 0 SW MOMENTARY STO
TURN OFF LAMP OR PUSH TIMER P
IR (MPT) =1

YES

STOP DIMMING
CHANGE UP/DOWN BUS
RECEIVE CODE BSF STOP Y
RECORD CODE IN EEPROM YES = 1
BCF BUSY
BLINK LAMP

BCF STOP
DEC MPT

INCREASE YES UP
CODE
BRIGHTNESS = 1
S=4

YES DECREASE
BRIGHTNESS

TURN LAMP ON
MPT YES BSF
= 0 BUSY

RETURN FROM
INTERRUPT

Figure 4
8.- CODE PROGRAMMING
It is very simple to program the dimmer. To start programming it is
advisable but not necessary that the lamp is at its brightest. To program follow the
next steps :

Step 1. Press the programming switch. This will turn the lamp off, which shows
that the circuit has started the programming routine.
Step 2. Using the remote control transmitter, press the button chosen to store at a
distance of 3 feet. When the dimmer receives and stores the code, it will start and
turn the lamp off as a comfirmation that the code has been programmed.
Step 3. Repeat Step 2 three more times. Once the 4 codes have been stored the
lamp will turn on and stay on to show the end of the programming.

The code can be the same for the four available positions. Also different
remote control transmitters can be used. Once the dimmer is programmed, the
programmed buttons to control will have the same function as the control switch.

For the construction of the circuit a point to point construction on a perforated


board or files for the consturction of a PCB can be used and are provided.

Note:
Since line voltages are used and can be dangerous or even fatal, they must be
handled with caution.

Finally to conclude, we can build a simple dimmer with available parts that
is easy to construct with a software that is of public availability for private use.

PART LIST          
Designator Part Type Description Mfr Part Number Mouser stock no.
Polyester Capacitor
C1 .1UF 250V Panasonic ECW-F2104JAQ 667-ECW-F2104JAQ
Polyester Capacitor 667-ECW-
FOR 220 VOLTS USE 450V Panasonic ECW-F2W104JAQ F2W104JAQ
C2,C3 and Multilayer Capacitors
C7 .1UF 50V AVX SR215C104KAR 581-SR215C104KAR
Polyester Capacitor
C4 .68uf 250V Panasonic ECW-F2684JAQ 667-ECW-F2684JAQ
Polyester Capacitor 667-ECW-
FOR 220 VOLTS USE 450V Panasonic ECW-F2W684JAQ F2W684JAQ
140-HTRL16V470-
C5 470UF Electrolitic Capacitor 16V Xicon RC 140-HTRL16V470-RC
C6 10UF Electrolitic Capacitor 16V Panasonic EEA-GA1C100 667-EEA-GA1C100
C8 47UF Electrolitic Capacitor 16V Panasonic EEA-GA1C470 667-EEA-GA1C470
D1 1N4734A Zener Diode Fairchild 1N4734A 512-1N4734A
D2 and D3 1N4007 Rectifiers 1000V 1A Fairchild 1N4007 512-1N4007
IR1 TSOP48XX IR MODULO Vishay TSOP4838 782-TSOP4838
J1 TP2 Terminal Block KOBICONN P02ELK508V2 158-P02ELK508V2
L1 68UH Inductor (see text) Murata 18R683C 580-18R683C
Q1 MAC223 Triac 20A 400V NXP MAC223A6 771-MAC223A6127
660-
R1 120 Ohms 1/4 Watt Resistor KOA Speer CFS1/4CT52R121J CFS1/4CT52R121J
660-
R2 22 Ohms 1/4 Watt Resistor KOA Speer CFS1/4CT52R220J CFS1/4CT52R220J
R3,R4 and 660-
R8 10 Ohms 1/4 Watt Resistor KOA Speer CFP1/4CT52R100J CFP1/4CT52R100J
660-
R5 470K 1/4 Watt Resistor KOA Speer CFS1/4CT52R474J CFS1/4CT52R474J
660-
R6 39K 1/4 Watt Resistor KOA Speer CFS1/4CT52R393J CFS1/4CT52R393J
660-
R7 1MEG 1/4 Watt Resistor KOA Speer CFS1/4CT52R105J CFS1/4CT52R105J
660-
R9 100 Ohms 1/4 Watt Resistor KOA Speer CFS1/4CT52R101J CFS1/4CT52R101J
S1 CONTROL Tactile switch 12mm Omron B3F-4050 653-B3F-4050
S1 CAP CAP Keycap 9X9 Omron B32-1280 653-B32-1280
S2 PROGRAM Tactile switch 6mm Omron B3F-1020 653-B3F-1020
U1 PIC12F675 Microcontroler Microchip PIC12F675-I/P 579-PIC12F675-I/P

Juan canton

You might also like