Remote Controlled Fan Regulator using ATmega8

USB AVR Programmer v2.0

This device can be used to remotely control the speed of an AC fan and to switch it on or off. The remote control is a cheap NEC Format remote, usually supplied with small DVD players. Three buttons are used to command the circuit. The UP key increase the fan’s speed while the DOWN key decrease it. The ENTER key is used to switch on or off the fan. The unit provides 10 way speed control from 0 to 9. The current speed is displayed in a seven segment display. The yellow LED on the PCB indicates the power status of the load. If the load is switched off using the R/C then the LED will also be switched off.

In the Video below you can check out the project in action.

The main parts of the circuit is labeled below.

  1. The seven segment display used to show the current speed level.
  2. The TSOP1738 sensor is used to pick up commands from remote control.
  3. The Yellow LED indicates the power status of the load.
  4. OUT – Here the AC load is connected in series. Tested on 220v 50Hz AC line.
  5. IN – Power supply from a 12-0-12 transformer is applied here.
  6. MCU – ATmega8 AVR 8 bit Microcontroller.
  7. SWITCH – Manual Switch used to operate the unit without the remote control.
remote controlled ac fan regulator

Fig.: Atmel AVR Based Remote Controlled Fan Regulator.

 

remote controlled fan regulator wiring diagram

Fig.: Remote Controlled Fan Regulator Wiring Diagram.

 

transformer

Fig.: Transformer with plug.

 

Construction of Remote Controlled Fan Regulator.

You can make the circuit as per the schematic on any general purpose PCB. To ease your job we are giving the PCB Layouts too, so that you can make the PCB at your home using the Etching Method. You may also have the PCBs made from any fabrication house too. To further easy the job and save your money we have already made the PCBs from a good fabrication house and they are available for purchase at very low cost.

Start assembly process by first soldering the jumper1. Then you can mount the resistors. After that solder the diodes, remember to properly orient the diodes. They are polar and don’t work if installed other way round. Then solder the IC U4 and U2, this time too take care of the orientation. The small round circle on the IC package marks the PIN number 1.

IC

Fig.: Proper IC Installation.

After that you can solder the ceramic disk capacitors, the 16MHz crystal, 7805, Triac, TSOP Sensor, Display. Finally Connect the 12-0-12 Transformer and apply power. The display should show ’0′. Then you can press the up/down key in remote control to adjust the speed. The display should change accordingly. This ensures that the circuit is running properly.

Its time to connect a real AC load. Connect a 220V 100W incandescent lamp (NO CFL Please). As shown in the above wiring diagram. Replace the fan with bulb because its easier to test.

WARNING !!!
Never Touch any part of the circuit when AC load is connected. It can give you a fatal shock !!!

Now you can can use the remote control to increase/decrease the lamp’s brightness using the remote control. You can also switch it on and off using the ENTER key.

Troubleshooting

If the unit does not respond to the remote control signals then look for the following.

  1. AVR ATmega8′s Fuse BIT is programmed to
    • HIGH=0xC9 LOW=0xFF
  2. AVR is clocked with 16MHz crystal (other value won’t work)
  3. Remote Control is NEC Format Only (Chinese DVD/CD player remote works good, TV Remote Generally do not work as these are RC5 coded)
  4. Remote Key codes has been feed to rckey.h file. Build and run this demo and press UP,DOWN and ENTER keys to get their keycode and put them in rckeys.h file. All remotes available in market has random keycode, so This part is very important. After editing the rckeys.h file the project must be Rebuild. (I hope you know what does that means).
  5. IR sensor is of good quality and must be labeled TSOP1738 (other values won’t work).
  6. If you get a KIT from us then most of the problem do not arise.
hobby remote control

Fig.: This Hobby Remote Control Works Great!

Hobby Remote Control (NEC) is available from our online store.

Part list for Remote Controlled Fan Regulator.

Part List
01 330 ohm resistor (9 Nos) R2-R9, R14
02 4k7 Resistor (2 Nos) R1,R11
03 1K Resistor R12
04 39 ohm Resistor R13
05 1K5 Resistor R15
06 22pF Ceramic Disk Capacitor (2 Nos) C1,C2
07 0.1uF Ceramic Disk Capacitor 250V(1 Nos) C3
08 0.1uF Ceramic Disk Capacitor (2 Nos) C5,C6
09 470uF 50v Electrolytic Capacitor C4
10 16 MHz Crystal Half Size X1
11 1N4007 Diode (6 Nos) D2,D3,D4,D5,D6,D7
12 LED 5mm Any Colour D1
13 MCT2E Opto Coupler U4
14 MOC3021 Opto Triac Driver U2
15 ATmega8-16PU General purpose 8 bit MCU U1
16 Triac BT136 U3
17 7805 Voltage Regulator U5
18 Common Anode Display DISP11
19 TSOP1738 IR Sensor X2
20 220V AC to 12-0-12 Center Tapped Transformer 500mA minimum.  
21 Hobby Remote Control (NEC)  

Buy Remote Controlled Fan Regulator Kit.

Schematic

remote controlled fan regulator schematic

Fig.: Schematic (Click To Enlarge/Print).

PCB For Remote Controlled Fan Regulator.

PCBs can be purchased from PCB section of our online shop.

remote controlled fan regulator pcb

Fig.: Remote Controlled Fan Regulator PCB.

 

avr-gcc C Source Code.


/*

Remote Controlled Fan Regulator.

********************************

Compiler: avr-gcc (WinAVR-20090313)
Project Manager/IDE: AVR Studio 4.17 Build 666
Other Lib: eXtreme NEC Decoder.

Hardware:
   INT0 - IR Receiver
   INT1 - Zero Crossing Detector.

   PD5 - Triac Control.
   PB2 - Manual Switch

For
   ATmega8 @ 16MHz

Fuse: 
   HIGH=0xC9 LOW=0xFF

   Copyright (c) 2008-2010
   eXtreme Electronics, India

                                     NOTICE
                           --------
NO PART OF THIS WORK CAN BE COPIED, DISTRIBUTED OR PUBLISHED WITHOUT A
WRITTEN PERMISSION FROM EXTREME ELECTRONICS INDIA. THE LIBRARY, NOR ANY PART

OF IT CAN BE USED IN COMMERCIAL APPLICATIONS. IT IS INTENDED TO BE USED FOR
HOBBY, LEARNING AND EDUCATIONAL PURPOSE ONLY. IF YOU WANT TO USE THEM IN 
COMMERCIAL APPLICATION PLEASE WRITE TO THE AUTHOR.

*/


#include <avr/io.h>
#include <util/delay_basic.h>

#include <avr/interrupt.h>

#include "remote.h"
#include "rckeys.h"

#define FAN_POWER_LED_PORT PORTD
#define FAN_POWER_LED_DDR DDRD
#define FAN_POWER_LED_BIT 7

#define POWER_LED_ON()  FAN_POWER_LED_PORT&=(~(1<<FAN_POWER_LED_BIT))
#define POWER_LED_OFF() FAN_POWER_LED_PORT|=(1<<FAN_POWER_LED_BIT)

uint8_t table[10]={141,125,109,94,78,62,47,31,16,1};

uint8_t speed=0;
uint8_t fan_on=0;


void Initialize()
{
   FAN_POWER_LED_DDR|=0B10000000;

   POWER_LED_OFF();

   DDRC|=0b00111111; //Seven segment
   DDRB|=0b00000010; //Middle segment G

   Display(0);

   RemoteInit();

   //Initialize the zero crossing detector INT(1)

   MCUCR|=((1<<ISC11)|(1<<ISC10));     //INT in Rising edge
   GICR|=(1<<INT1);              //Enable INT1

   //Output

   DDRD|=(1<<PD5);
   PORTD|=(1<<PD5);  //High = TRIAC Off


   //Set Timer 2
   TCCR2|=(1<<WGM21);   //CTC

   TIMSK|=(1<<OCIE2);   //Enable OCI2

   sei();

}
/*

Zero Crossing Detect.

*/

ISR(INT1_vect)
{
   if(!fan_on)
   {
      PORTD|=(1<<PD5);  //High = TRIAC Off
      return;
   }

   if(speed==9)
   {
      PORTD&=(~(1<<PD5)); //low = TRIAC ON

      return;
   }

   PORTD|=(1<<PD5);  //High = TRIAC Off

   OCR2=table[speed];

   TCNT2=0x00;

   TCCR2|=((1<<CS22)|(1<<CS21)|(1<<CS20));   //Start Timer prescaler =1024

}

/*

Timer2 Compare ISR

*/
ISR(TIMER2_COMP_vect)
{
   PORTD&=(~(1<<PD5)); //low = TRIAC ON

   TCCR2&=(~((1<<CS22)|(1<<CS21)|(1<<CS20)));   //Stop Timer
}

/*

Simple Wait Function

*/
void Wait()
{
   char i;

   for(i=0;i<100;i++)
      _delay_loop_2(0);
}


/*

Displays a number in Seven Seg Display

*/
void Display(uint8_t num)
{
   if(num>9)
      return;

   switch (num)
   {
      case 0:
         PORTC=0B00000000;
         PORTB|=0B00000010;
         break;
      case 1:
          //      xxfedcba

         PORTC=0B00111001;
         PORTB|=0B00000010;
         break;
      case 2:
         //      xxfedcba
         PORTC=0B00100100;
         PORTB&=(~(0B00000010));
         break;
      case 3:
         //      xxfedcba

         PORTC=0B00110000;
         PORTB&=(~(0B00000010));
         break;
         break;
      case 4:
         //      xxfedcba

         PORTC=0B00011001;
         PORTB&=(~(0B00000010));
         break;
      case 5:
         //      xxfedcba
         PORTC=0B00010010;
         PORTB&=(~(0B00000010));
         break;
      case 6:
         //      xxfedcba

         PORTC=0B00000010;
         PORTB&=(~(0B00000010));
         break;
      case 7:
         //      xxfedcba
         PORTC=0B00111000;
         PORTB|=0B00000010;
         break;
      case 8:
         //      xxfedcba

         PORTC=0B00000000;
         PORTB&=(~(0B00000010));
         break;
      case 9:
         //      xxfedcba
         PORTC=0B00010000;
         PORTB&=(~(0B00000010));
         break;
   }
}


void main()
{

   uint8_t cmd; //Command received from remote

   Initialize();

   while(1)
   {
      //Get Command For the Remote Control
      cmd=GetRemoteCmd(1);

      //Now process the command

      //UP Key
      if(cmd==RC_UP)
      {
         if(speed<9)
            speed++;

      }

      //DOWN Key
      if(cmd==RC_DOWN)
      {
         if(speed>0)
            speed--;
      }

      //Enter Key

      if(cmd==RC_ENTER)
      {
         if(fan_on)
         {
            POWER_LED_OFF();
            fan_on=0;   //Turn Off
         }
         else
         {
            POWER_LED_ON();
            fan_on=1;   //Turn On

         }
      }

      Display(speed);

   }
}

Note: Other files that are part of the eXtreme NEC decoder must also be added to the project. They can be downloaded from links given below.

Downloads

Buy Kit

Buy complete kit including PCB, Parts, Programmed MCU, Transformer and Matching IR Remote Control Unit.

Buy Remote Controlled Fan Regulator Kit.

Related Post

By
Avinash Gupta
www.AvinashGupta.com
me@avinashgupta.com

Avinash

Avinash Gupta is solely focused on free and high quality tutorial to make learning embedded system fun !

More Posts - Website

Follow Me:
FacebookLinkedInGoogle Plus

About Avinash

Avinash Gupta is solely focused on free and high quality tutorial to make learning embedded system fun !

120 thoughts on “Remote Controlled Fan Regulator using ATmega8

  • By Arifuddin Sheik - Reply

    Hi Avinash! Nice project. The project file you kept for download is having some problems. When I tried to build the project, i got “no build tools defined” error. When i compiled the same files by creating a new project, there is no problem.

    I build a project for controlling home appliances using DVD remote using your files with LCD support and EEPROM options. So, whenever the Main power goes off, the MCU will check the EEPROM data which has the appliances status. After seeing this project, i got an idea of integrating this fan speed control option in my project. Can i connect output to any pin say PC2 ( i bought Xboard MIni from your store, the PD5 pin is already dedicated for LCD connection). I just want to know whether the outputs you specified can be changed to other pins or not. I know we cant change the interrupt pin. I am asking about POWER LEDS and FAN OUTPUT connections.

  • By Avinash - Reply

    @Arif,

    Yes you can change the Triac Output pins. Simply Change the OUTPUT Section in the Initialize() Function.

    And some control in the two ISRs

    ISR(INT1_vect)
    ISR(TIMER2_COMP_vect)’

    Also Don’t forget to post your project in your blog to share with the World. And give credit to us for the Remote Libraries.

    • By praveen - Reply

      hi avinash your light dimming project is AWESOME. i trying to do same project with out IR … REMAINING CONNECTIONS ARE SAME I AM USING ATMEGA32. BY VARING ADC CHANNEL I AM DIMMING THE LIGHT CAN U SEND ME THE CODE FOR THE SAME

  • By Avinash - Reply

    As for the AVR Studio Error Please use

    Project Manager/IDE: AVR Studio 4.17 Build 666

  • By Avinash - Reply

    If you post your project on your blog with pictures and code, then I will give you this PCB(Bare) for Free!!!

  • By Arifuddin Sheik - Reply

    Sure. I will definitely post the project with Pictures and code. After all, I made that using your libraries and tutorials! I had finished the project just today. I am working on integration of speed control. I am thinking of generating pwm using atmega8 feature for speed control. Do you think the pwm logic works for speed control. I will test that tomorrow and post the results. The main reason why I thought this is to reduce the hardware and to avoid the optocouplers. But somewhere in my mind, it is saying me that a person like Avinash could have thought the same and why he implemented this the same thing with more hardware. Is it for educational purpose to cover more topics or there is a need for using the hardware?

  • By Arifuddin Sheik - Reply

    Sorry its atmega16. not atmega8!

  • By Arifuddin Sheik - Reply

    http://arif-ece.blogspot.com/2010/07/remote-controlled-home-appliances.html

    check out the details of my project in my blog. I am working on improving the code for fan speed control using PWM. I will update it as soon as I finish doing it. Please post your comments and suggestion.

  • By Avinash - Reply

    @Arifuddin,

    The article you submitted is just great !

    You won your PCB as I promised!

    So should I send it to your registered address?

    Khammam, 507001
    Andhra Pradesh

    Also Direct PWM Control as we use with DC Motors Cannot be used with AC Motors Such as a Fan because of following reasons
    1) The PWM Must be in sync with the AC Waveform for this we use the first MCT2E Opto. By using this we fire INT1 whever the AC Wave reaches zero point.
    2) Triac Can only be switched on and it remains on even if the driving voltage is removed from the Gate terminal. It can only be Turned off during the AC Zero point!

    Because of these the Zero Crossing detection is necessary and simple PWM Cannot be used.

  • By Avinash - Reply

    Also the bridge rectifier section made from D2,D3,D4,D5 is NOT filtered with capacitor. If capacitor is used it will become PURE DC and we cannot detect Zero point.

    Every part of the circuit is well planned and I am NOT an academic guy so I don’t add anything for mere educational purpose.

  • By Arifuddin Sheik - Reply

    Thank you so much. My address is correct as you stated. But I also need the components that are required in the project. Please mail me the appropriate cost. I will deposit cash in your bank account.

    Coming to my blog, I forgot about my blog before a long time. You initiated me for writing the article. So, credit goes to you. I did some research regarding yesterdays comment regarding PWM and found out the same. I will anyhow continue posting my projects. I read your comment in my blog regarding projects today which you sent in may 2010.

    Coming to the board modification which I had done, you please check this article and give me suggestions and your feedback regarding powering the XBoardMini with USB Power supply. I think you should consider using Vcc pin in ISP connector.

    http://arif-ece.blogspot.com/2010/07/modifying-avr-development-board-and.html

    Thanking you,
    Arifuddin Sheik

  • By Arifuddin Sheik - Reply

    http://arif-ece.blogspot.com/2010/07/remote-controlled-home-appliances_07.html

    This is the new link. I deleted the old link because the post is containing html errors. I haven’t updated the project yet.

  • By Avinash - Reply

    @Arif

    Your PCBs have been dispatched. You may get them by Wednesday. Please inform me when you receive them.

  • By Arifuddin Sheik - Reply

    @Avinash

    Thanks for sending me your PCB’s.

    Arifuddin Sheik

  • By Puneet - Reply

    Hello Avinash,

    I want to build these remote controllers which can take a load of 1.5 kva. Please advice on what alteration need to be done to the circuit.

    Thanks

    Puneet

  • By fatimah - Reply

    do you any supplier in malaysia if i would like to buy the component that used in this project?

  • By mahendra patel - Reply

    remote control fan regulater this products is to good. I want this kit 100 pcs.
    please sent price and mode of payment

  • By sandeep - Reply

    hello avinash-
    plz tell me the min ampere rating of the transformer.
    that’s to be used in this project ,as in shops they ask for that too apart from voltage rating..
    inform me as asap..

    thanks…

  • By Tandy - Reply

    Hi Avinash,

    Quick question on the 220V AC to 12-0-12 Centre Tapped Transformer. Is it possible for you to direct me to a place where I could buy them online.

    I’m not too sure with what I’ve found so far!

    Please help,
    Tandy

  • By Tandy - Reply

    Hi Avinash,

    Sorry for asking another question almost immediately! Basically I have a 240VAC fan to run which runs with 120W of power.

    What sort of 12-0-12 Trasformer should I use?

    Please help

    • By Avinash - Reply

      @Tandy

      I can’t get what you mean by

      What sort of 12-0-12 Trasformer should I use?

  • By Tandy - Reply

    Hi Avinash,

    Sorry I think I worded the post incorrectly.

    I’m very new at this and find this project to be very interesting (a bit of a hobbyist).

    I noticed that you ran a 100W bulb with your mains being at 220V AC with your transformer.

    If i was trying to implement this with the fan I have what sort of transformer would you recommend.

    The fan is a 120W fan(that I found lying around) and runs on 240V AC from the mains.

    Please help with some knowledge thanks.

    • By Avinash - Reply

      @Tandy,

      12-0-12 (500ma) transformer has nothing to do with the AC load. It is just powering the logic part. So what ever AC load you use (as long as it is within the range of Triac BT136), it does not affect the selection of transformer. It is same.

  • By Tandy - Reply

    Also a place to order the type of transformer that you recommend!

    Thanks

  • By Tandy - Reply

    Hi Avinash,

    Thanks for your reply, I’m sorry I got back late with this reply because I’ve had work over the last few days and haven’t had time to play with this circuit. I’ve sort of understood the principals behind the circuit you’ve shown and understand the purpose of most parts of the circuit.

    There is one thing I’m not sure of though! If you could please help that would be brilliant.

    The thing I dont get is how we connect the output from the circuit board to run the lamp.

    I have drawn a couple of images. One with a friend’s suggestion and one of my understanding.

    Link 1
    http://img201.imageshack.us/i/atmega.jpg/

    Link 2
    http://img14.imageshack.us/i/atmega2.jpg/

    PLEASE HELP! Please tell me the mistake or any advice.

    Thanks again,
    Tandy

  • By Tandy - Reply

    Hi Avinash,

    Your absolutely awesome! Thanks man! I’m sure I’ll be posting here once again soon.

    Cheers,
    Tharindu

  • By Tandy - Reply

    Hi Avinash,

    I’ve got this finally working. It is indeed a good setup. I’ve now embarked on a project to control my water sprinkler system.

    I was thinking of using a similar circuit as this one but instead of connecting the output to a 240VAC system.I thought of using a cheap step down transformer adapter as this sprinkler system runs on 24VAC.

    I will then switch the sprinkler either “ON” or “OFF”.

    If you can provide any thoughts that would be brilliant!

    Thanks

  • By DHAVAL SHETH - Reply

    hi Avinash,

    I purchased u r fan regulator kit.and i built it.but i have some problem with it can u try to solve it…..

    1.my controller portion is working properly…but i tried to connect a.c.load with ckt..and my c13 capacitor burn out.two times..i join as per u r diagram…i dont know what happen my load is continuously on and i get 13v voltage across triac.
    triac is working properly or not?

    plz help me to avoid this problem

    thanks

  • Pingback: Remote Controlled AV Regulator | PyroElectro - News, Projects & Tutorials

  • By Shahinur - Reply

    Hi Avinash,

    At first I want to thank you for such an initiative to share your knowledge with others. Your explanation ways are extremely good to describe a project clearly. According to your instruction I have made the above project on a veroboard. Everything is working correctly without AC load. But when I connect the AC load (a 40 watt bulb) at BT136 Triac’s terminal in series, the remote control does not work properly. Most of the time it was just hang. Again when the AC load is disconnected everything is working properly.

    Please give me some suggestion to troubleshoot my problem.

    Thanks

    • By Parag Gajjar - Reply

      Hi Avinash,
      I am also facing same problem as above, please give some suggestion.

      Thanks,

      • By Avinash -

        Those who are facing problem are suggested to purchase and make using the kit.

  • Pingback: Electronics-Lab.com Blog » Blog Archive » Remote Controlled AV Regulator

  • By dinesh - Reply

    i have build this project, everything is ok ,circuit is receiving the commands, but there is no power in the fan i have done the following observation.

    1. there is 2.5v between pin 1 and 2 of opto triac(moc3021)
    2. i have disconnect the optotriac pin from atmega8 and connect

    it to grount but again no power to fan

    plz suggest me what is the possible problem whether it is the the issue of optotriac

    what is the correct no. of optotriac driver in parts list it is MOC3021. and in circuit diagram it is shown as MOC3031.

  • By Nikhil - Reply

    Hi Avinash,

    Its an awesome tutorial. i have few quires presently iam designing a board where i have serial port communication. my concern is if we are taking the zero cross detection to Interrupt pin . for every 10 milli sec there will be an interrupt. so is there any case of data crash in serial port while handling interrupt and serial data at same time is there any better algorithm to implement the zero cross, Fan speed control.through Serial port..

    Thank you ,
    Nikhil

  • By yogesh - Reply

    how the same above circuit can be used to control the speed of coolers?
    please help & let me know

  • By Arup - Reply

    I purchased a Kit from your site. Firstly the kit was missing two resistors and contained resistors of wrong value. I emailed this problem to you with the pictures. Subsequently I purchased the resistors from local market and built the kit. After building the kit the display is working and responding to the remote control. Also, by pressing enter key the power LED toggles between on/off.

    But when I connected a 60W incandescent lamp the lamp always remains at full brightness, it doesn’t dims as per the remote control output. It also doesn’t turns on/off while pressing enter key on remote.

    I’ve mailed quite a number of times regarding this and you didn’t help.

    I find this type of attitude totally unacceptable. First you sent me kit with missing part and wrong parts. When contacted you asked me to return the kit at my own cost. The cost of the parts is way cheaper than the courier charge. As a customer friendly approach you should have sent me a new kit and arrange to pickup the same.

    Also, after several request to look into problem of non-working kit you didn’t help at all.

    So, look into the matter immediately and tell me how to get the kit working.

  • By Hirak Das - Reply

    Hi Avinash
    I got ur pcb via dtdc
    bt i have some prob in remote controlled fan regulator
    R13-39 ohm or 39k which, one coz i used 39 ohm and it burned plz help me

    can i used atmega 8L-8pu

  • By shivendra kumar sahu - Reply

    i want also used on\off other room goods. can help me ?

  • By Tahir - Reply

    very nice project
    i want used without remote
    i want add 3 SWITCH 1-up 2-DOWN 3-on /off
    what Change in code ?

  • By Sinet Rags - Reply

    hello avinash … i have a few doubts …

    when using a compiler, most of the initialization code is completed by itself .. like setting a bit for interrupts, adc and much more …

    due to this all i know is how to write code with pre-implemented compiler initialization. but you write the whole code and it gets difficult for me to get about such codes ..

    can u point me to the right direction in order to write the complete code by myself, without the use of compiler .like with the help of notepad .. from head to toe …

    lol . i am not askin for a complete tut. but just a push in the right direction…

  • By ananya - Reply

    can u explain working of this circuit…??? please

  • By suraj - Reply

    Remote Controlled AC Fan Speed Regulator KIT.i want this kit can i get this kit .in your website it shows out of stoke……..piz send me reply…….

  • By Sarunas - Reply

    Hi, I made very similar circuit, and it works fine with the incandescent lamp, however when I connect my fan heater(heating is turned off) – works only fan, it doesn’t change the speed. If the speed is set to 50% it barely rotates. The same is with all speeds except 100%.
    Any ideas why??

  • By Naveen - Reply

    hi avinash, i want to implemnt ur projct for contrlng the speed of my ceilng fan but recently i have made one more circuit to switch tubelight of my room on and off through remote and in that circuit also, i have used TSOP 1738 and in the same room i want to fix ur circuit, so i have a doubt that whnevr i’ll press any key on remote then it will effct both the circuits i.e. if i want to switch off my light only without effecting the fan then it will b impossbl to do.

  • By rofik - Reply

    good site

  • By naveen - Reply

    hi avinash , pls reply on my cmnt i need ur help….

  • By Vishal G.Meshram - Reply

    dear sir

    I just want to controll the speed of submersible water pump, 230 v AC. for which i have used AVR 32 L Mc, and 3011 optocoupler, and BTA 12 traic,

    Bt when i switched it ON, the speed of the motor is not controlled, it gts switched ON, and then no response, i have to switch it OFF by manually switching the AC mains supply.

    Need your guidance

    Regards
    Vishal

  • By pragnesh s patel - Reply

    Hello Sir , We Want To AVR Remote Controller Fan Regulator PCB’S Cost & What’s Process For Collect Your PCB.

  • By ghous - Reply

    hi
    can someone tell me what is sil-100-02 in the circuit diagram?

    • By Dragosh - Reply

      It’a a conector with 2 trails. It can be any kind you want.

  • By Dragosh - Reply

    Can you please help me out with my problem. I use ATMEGA 32, all the other pieces are the same. When i remove the wire from INT1 the dim works but it’s not in phase. What can i change to make things work.

  • By BHARGAV SHANKHALPARA - Reply

    hello avinash

    can i use atmega8-8pu instead of atmega-16pu because 16pu is not available in my city. if it is possible than please tell me after anything change can i use atmega8-8pu for above project…??

  • By Gaurav - Reply

    How much it cost in rupees?

  • By srinjoy sarkar - Reply

    nice project guys.
    But I really want to do this project and intend to have the tutorial. SO ,can u help me out.

  • By Sandy - Reply

    Nice project but I think you can reduce the build cost by opting for an alternative for the AC 50/60Hz zero cross detecting opto (MCT2E). The AVR182 appnote has a rather simple way of addressing this by directly feeding the AC mains output to one of the MCU’s external interrupt pins with a series 1M ohm resistor in parallel.

  • By Sandy - Reply

    Made a mistake in the previous post. The 1M ohm resistor is in series and not in parallel.

  • By jaspreet singh - Reply

    why wont other values of crystal than 16 Mhz work? cant we use 8 Mhz ??

    • By Avinash - Reply

      because while writting the program we need to do some calculations. And we assume at what rate the CPU is running. So during all those assumptions we used 16MHz. Thats why if you run at other frequency it wont work. Anyone work

      • By jaspreet singh -

        thank you sir! :)

  • By bhargav shankhalpara - Reply

    hi avinash sir..

    i buy pcb for fan regulator from your online shop and assamble it.

    i program microcontroller which you given above with fuse bits.

    when i run it i seen that there is only number is change from 0-9. but even status led not glow.and also there is no change in lamp intensity.

    can you suggest sir there is whats going on.

    does i need to take any other precausion…??

    plz reply sir..

  • By Jacob - Reply

    Hello,
    I have a problem with interrupts in my project. I was using the same rule as in here and I’ve initialized interrupts like below:

    MCUCR=0×00; //(low level of INT1 initializes interrupts)
    GICR|=_BV(7); //INT1 set to one

    I have also used to function sei(); and in the line with command:

    ISR(INT1_vect)

    there were two errors:

    264: error: static declaration of ‘__vector_2′ follows non-static declaration

    264: error: previous declaration of ‘__vector_2′ was here

    I can’t figure out what’s wrong. I use AVRstudio with AVRdude.

    • By Avinash - Reply

      @Jacob,

      First off all tell me which MCU is being used ?

      And the version of AVR Studio

      Also upload full AVR Studio Project in the forum so that we can examine.

      http://forum.extremeelectronics.co.in/

  • By meet - Reply

    hi avinash i tried to make your project but i interfaced it with lcd and want to use sony remote which works on sirc protocol can you help me out in decoding n coding part of my project as i am new to it so i don’t have any idea of how to use winavr or any startup guide to understand how to write codes for avr controller.iy would be indeed very kind of you if you can help me i would able to learn a lot from you.just i want to get my programming base clear.

    • By Avinash - Reply

      @Meet!

      You guys drive me crazy! Asking such f***ing questions! Why would in the world I will spend any time for your project ! I already have important people in my life to take care of ! And I am already too busy to get time for them.

  • By sao - Reply

    sir Avinash, i want to know, what kind of software you used to draw that schematic. i’m newbie and uses software ISIS but can’t find component tsop1738 and moc3031. hope tou can help me. thank you very much.

    • By Avinash - Reply

      @Sao,

      So make them !

  • By Rahmat - Reply

    Hi Avinash, Can I ask you a question, for transformator, how much ampere do you use?

  • By Dragosh - Reply

    Hello,
    You know that your software code has a bug and it will never work without modification? I think you know very well. :)

  • By Rizwan Ali - Reply

    Mr. Avinash, Can you please upload the simulation(Proteus ISIS) file of the circuit?

  • By Rahmat - Reply

    Hi Avinash, can i ask you onbe more question, what is the function of J3 in your schematic?

  • By Mod Arif - Reply

    bit programing for 2 fan regulator and 4 light

  • By sahu - Reply

    dear sir . if possible pl provide here 16f676 based code.

    • By Avinash - Reply

      @Sahu, Sorry NOT available.

      • By sahu -

        any other PIC MCU ?

  • By athira - Reply

    hellow sir… can u pls give the block diagram and circuit explanation of this circuit

    • By Avinash - Reply

      @Athira,

      NO !

  • By Prashant - Reply

    Hi Avinash,

    I recently purchased the RC Fan Regulator Kit from your website and assembled the same as per the instructions keeping all the polarities and tips in mind.

    Now when I switched on the complete circuit with 12V transformer the display is showing zero, but the circuit is not responding to remote (received in kit).

    Now is this MCU programmed and sent with matching IR sensor & remote as mentioned on your website.

    Or it needs to be programmed as suggested in this article.

    • By Avinash - Reply

      see the instructions written on the box what to do when you ran into problems.

  • By Kash - Reply

    Hey Avinash,

    In the circuit you have used the opto coupler as a frequency sensor but I did not see it being utilized in your code. Could you please share the requirement for this or could you please point out the code that uses this.

    Regards,
    Kashyap

    • By Avinash - Reply

      @Kash

      The MCT2E Opto Coupler is NOT used as a frequency sensor. But as an input to detect 0 crossing of the AC Waveform. The output PWM needs to be in sync with the AC wave form. If Output PWM is NOT in sync with AC wave form we cannot predict the power delivered in that cycle.

      INT1 handler make use of this zero crossing detector.

      It switches off the trick on every cycle of AC waveform as it detects 0 crossing

      and sets an alarm which switches on the triac after a preset interval. The longer this interval the lower the power delivered to the load in that cycle. This interval depends on the current speed of regulator.

  • By Ramanujam R S - Reply

    Hi Avinash,
    I have a simple concern. Will this work with UPS both with square and sine waveforms.

  • By Souvik - Reply

    Hey Avinash,
    Please give me the block diagram…

    • By Avinash - Reply

      @Souvik, If I had the block diagram I would have put it here only!

  • By deepak - Reply

    Hi avinash,

    i am trying to make to control fan and light speed via RF modules.
    I need your assistance on it.
    Plesae help me

  • By Smita - Reply

    Dear Avinash,
    Can we use a coin cell(CR2032) instead of using 12-0-12 transformer and relay for making/braking contact instead of triac?
    Please,reply.

  • By alvin - Reply

    will this work on 220v / 60hz ac mains?

  • By Abhishek - Reply

    Hey Avinash!
    tell me the way to design this remote controller with 4 fan controller i.e for 4 channel

  • By Neelesh - Reply

    Hi Avinash,

    Great implementation, it helped a lot in some of other projects.

    Just a thought, why you have used an external crystal with 16Mhz of frequency. I think the internal oscillator @ 1Mhz will work (even with 10% tolerance).

    Thanks
    Neelesh

  • By Trianto Kontri - Reply

    Hello sir,
    I was success build the remote test to decode NEC with some modification.. I just to tell you that your code have a little wrong..
    In “remote.c” you wrote TCNT0=0;
    it should be TCNT1=0;
    Thank You

  • By nitin saini - Reply

    Thank you Avinash

    I request you to please write an tutorial about zero crossing detector

    May be all are facing problems due to it

    May be they are not using transformer. May be they are using regulated supply directly

    And if tutorial already exists at extreme elect somebody let me know the link

    I just want to know zero crossing detect more closely
    What I understand reading previous comments is that

    Triac can be switched off at close to low ac cycal
    And also if we on and off zero crossing triger triac input to low or off when ac cycal is low by referring the ac at INT1
    which results in less chances of spikes.

    If I am correct please let me know

    Either I am or not correct
    Heartly request you to write the tutorial on zero crossing detection

  • By Pranav - Reply

    Hey!
    Visiting your website after a long time! :D
    Just found a little mistake here in your disclaimer…
    You state
    “WARNING !!!
    Never Touch any part of the circuit when AC load is connected. It can give you a fetal shock !!!”

    You might wanna change that ‘fetal’ to ‘fatal’ or ‘lethal’… :P
    I’m sure no one wants to get a ‘fetal shock’ either! :D

    Regards
    Pranav

    • By Avinash - Reply

      @Pranav

      Thank you :-)

  • By vikas - Reply

    can it be made using arduino uno atmega328??? if yes, could u plz tel me what changes have to be made??

  • By hemghosh04 - Reply

    Can any one tell me how can i store the present status of the speed into EEPROM so that it can resume after power failure.

    • By Avinash - Reply

      @hemghosh04 pay us Rs. 1000 to get this done!

  • By TAHER - Reply

    HI. It is such a nice project. i request you to make me understand that how you are firing the triac?

  • By Aditya - Reply

    Very nice project!
    But what if I want to increase the number of fans, say controlling speed of two fans instead of one.
    What are your thoughts on this.
    Waiting for reply.

  • By Tariq - Reply

    Hi Avinash, is this “remote controlled fan regulator” store status in EEPROM(or Resume fan on previous set speed when power resume), Thanks

    • By Avinash - Reply

      @Tariq
      Yes I have improved the firmware with that functionality, but is not shared here. I use that for my personal use.

  • By arogya reddy - Reply

    Dear friend,

    please can you give me the circuit diagram for the same project using PWM,

    i will upload the code using arduino.

    thanks in advance.

  • By omprakash sahu - Reply

    Hi,
    i want to know about the code of this project.
    avinash your code dose not compiling in my arduino platform which is 1.0.5-r2
    please provide me some solution for making this type of project.

    • By Avinash - Reply

      omprakash sahu,

      This code is NOT for arduino!

      If you want compilation steps then we can send you.

  • By saurabh - Reply

    Hi,
    I want to know the power circuit diagram, with triac and/or Diac no.s and optoisolators no. and how they are interfaced with AVR PWM

  • By Rahul - Reply

    Do you have a design for this board with SMD components to make this very small board.

    • By Avinash - Reply

      @Rahul,

      Nope!

  • By Akash - Reply

    Do you have a similar circiut which I can operate with raspberry pi. I actually want to control AC fan speed using raspberry pi.

  • By Vaibhav - Reply

    Hello Avinash,

    Your project works really great. I have implemented part of it in my project. Works really good.
    I found few difficulties. Please help me to understand.

    So my project is about home automation. I am using ATmega8 to controller fan tube light bulb & TV using Bluetooth.
    1] I want to control 2 fans but i am finding it difficult… I have used Timer1 in CTC mode and used OCIE1A and OCIE1B to control different speed.. but its not working
    2] Also when i switch on or switch off tube light my micro controller behaves randomly.. it switch offs all loads or turns on off load..
    i am not getting any solution for this i tried it with BT136 and with electromagentic Realy too..
    can u please suggest me somthing?? where its going exactly worng..

    • By Avinash - Reply

      @Vaibhav, Thank you. I am glad you found them usefull.

      • By vaibhav -

        Hello Avinash,

        Could you please help me to find out solution to my mentioned problems??

      • By vaibhav -

        @Avinsah

        Could you please help me to find out solution to my mentioned problems??

  • By Karanbir - Reply

    My R C Fan regulator worked first time no glitches!
    It has been tested with an incandescent lamp, dimming is working.

Leave a Reply

Your email address will not be published. Required fields are marked *


8 − six =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>