Professional Documents
Culture Documents
IR Remote Control Learning Dimmer or Heat Control
IR Remote Control Learning Dimmer or Heat Control
Circuit description:
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=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.
Whe the value of C is worked out from the above equation, the following is
obtained:
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.
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.
4.-SNUBBER NETWORK
This is composed of C1 and R1 and its function is to avoid false turn-on of
the TRIAC.
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
PGR
M BSF HWC
START TMR1 WITH HALF
WAVE TIME
YES
YES
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.
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