Hamradio.in

Remote Controlled Fan Regulator with Timer

Niras - VU3CNS

Mar 5, 2011

This is an electronic fan regulator with a timer to turn off the fan after a predefined time. You can control the whole functionality, such as changing fan speed, timer settings. from your couch or bed. Infrared receiver module TSOP1738 is used to receive the infrared signal transmitted by remote control.

Features

  1. Phase angle speed control for AC fans with 9 speeds.
  2. Timer (up to a max of 8 hours) with LED indication.
  3. Remote control with NEC format cheap remote.
  4. Microcontroller based design with minimum external components.
  5. Transformer-less power supply.
  6. Surge protection.

Fig. 1. Remote Controlled Fan Regulator With Timer - Assembled
Fig. 1. Remote Controlled Fan Regulator With Timer - Assembled

Hardware

PIC12F675 is a fully functional 8-bit microcontroller in an eight-pin package. The PIC12F family is very similar to microchip popular PIC16F devices and with the same instruction sets. The PIC12F675 is featured with an internal 4 MHz oscillator factory calibrated within ±1%, six i/o pins and other peripherals like timers, ADC modules etc.

PIC12F675 and few more components are used to make this project. BT136 – 600D is a logic level triac from NXP semiconductors®, intended for general purpose bidirectional switching and phase control applications. These devices are designed to be directly interfaced with a microcontroller or low power gate trigger circuits. The device can be triggered in all four quadrants but it is better to avoid the fourth quadrant which has higher gate trigger and latch currents. This circuit used quadrants two and three to trigger the triac which can handle a load current up to a maximum of 4A.

Fig. 2. Definition of operating quadrants of triac (All polarities are referenced with MT1)
Fig. 2. Definition of operating quadrants of triac (All polarities are referenced with MT1)

The power supply for the circuit is derived from a 230V, 50Hz ac line using a capacitor (C6) and a zener diode (D1). The 5.6V zener diode combined with the forward voltage drop of the rectifier diode produces an IC supply close to 5V. This arrangement is used to draw a full-wave current from the mains supply.

Fig. 3. Zero cross detection - PIC12F675 input structure
Fig. 3. Zero cross detection - PIC12F675 input structure

The zero-cross is detected by R8 which is connected to the microcontroller input pin (GP4) and ac line. The ESD protection diodes at the input pin (GP4) allows this connection without damage. The voltage is clamped between Vdd + 0.7 and Vss – 0.7 Volts for positive and negative half-cycles respectively. The “interrupt on change” at this pin is enabled for generating an interrupt at every zero cross. The triac is triggered with different phase angles (phase angle control) to make different fan speeds.

Two push-button switches SW1 and SW2 are used to increase/decrease speed. The microcontroller has an EEPROM which is used to save the changes after 4 seconds, therefore at power-up, the microcontroller remembers the last selected fan speed. When you turn on the fan, the microcontroller completely turns the triac on for the first two seconds as it helps to gain the speed rapidly, then it is switched to the selected speed.

Fig. 4. Remote controller (actual size 85 x 39 x 6 mm)
Fig. 4. Remote controller (actual size 85 x 39 x 6 mm)

Finally, a remote controller is used to control fan speed, on, off and timer operations. Cheap Chinese remotes used in car-audios, which operates with CR2025 lithium battery, is used here as it is available in plenty from the local market. It doesn't have a manufactures name and data sheet, but found that it uses the popular NEC remote control protocol. You can find more details about this protocol from the SB projects website.

Operational Use

The remote control has 21 keys, and the keys “0 to 9” are used to control fan speed, “0” will be turn off the fan. The key “CH-” can also be used to turn off, while the key “CH+” is to turn on. The +/- buttons can also be used to increase and decrease the fan speed respectively. The previous/next keys are used to increase/decrease time with one hour step, and a maximum of 8 hours can be set. The timer will be disabled when it is decremented to zero. The timer can be turned on/off using the “PLAY”/“EQ” keys in the remote, and it will be disabled automatically when it reaches the set value (i.e. when the fan is turned off by the timer). No timer adjustments are possible if the fan is not running. The EEPROM also store the timer set value, so when enabled it starts with the last timer off-time. The timer is enabled when pressing the previous/next button in the remote but it doesn't change the timer value on the first press. The two push buttons (SW1 and SW2) can also be used to increase/decrease fan speed.

The LED is lit while it accepts the commands from the remote control. It is also used to display the remaining time if the timer is running. The number of blinks represents the remaining time, and it repeats at an interval of every six seconds.

The Circuit and Assembling

Fig. 5. The Circuit diagram. The fan is connected between Hot out and neutral line (N).
Fig. 5. The Circuit diagram. The fan is connected between Hot out and neutral line (N).

Since there is no transformer for power-line isolation, the user must be very careful and assess the risks from electric shock hazards. The author is not responsible for any damages arising from any use of this circuit.

The PCB is designed with Eagle software can be used to build the project. The circuit, PCBs and hex file for programming PIC12F675 are available in link 1. Please take care not to erase the internal oscillator calibration constant, which is written to the last location program memory. The Microchip® Development Tools maintain all calibration bits to factory settings, or if you are using IC-Prog your consent is required before erasing.

The circuit can be tested with a 12V AC (instead of 230V AC) supply from a transformer, and connecting a 10 Ohm, 0.5W resistor parallel to the capacitor C6. The outputs (i.e. between 'N' and 'Hot out') may be connected to an LED through a 1.2k resistor, instead of a fan. Now use remote or keys to test the circuit functions, like speed (LED brightness will change), timer etc. After testing you can put the circuit in the actual situation, but please remember to remove the 10 Ohm resistor.

Downloads