You are on page 1of 23

 o o o o o o o o o o o o o o o o o o 

CATEGORIES

32bit ARM Projects AVR Development Board AVR Projects AVR Tutorials Chitchat Code Libraries Code Snippets Electronics Hardwares Microchip PIC Tutorials News PIC Development Board Programming in 'C' RF Robotics Software Tools Uncategorized
NAVIGATION

Home Forum Shop Links

SUBSCRIBE

Get New Articles Deliverd To Your Inbox!

Email address:

Subscribe

Delivered by FeedBurner

 o o o o

LATEST DISCUSSIONS

eXtreme Burner for Atmega88PA Atmega328P What is the best IDE for programming of ARM mcu's M.R AVINASH 8051 with aubtm-20 PIC serial communication,Baud rate

o o o o o o 

atmega88 interrupt atmel atmega 644P What is the use of Optimization (O2) in config settings? Differentiating between colors RF communication query Problem with order some products from another country
LATEST ON AVR TUTORIALS

Time Input Dialog for Graphic LCD
BY AVINASH - DECEMBER 3 2011 01:27 PM

GUI Frameworks of all modern OS like Windows, Linux (Qt ...

DS1307 I2C RTCC Interface using SoftI2C lib
BY AVINASH - NOVEMBER 30 2011 06:34 PM

In the last tutorial, I explained you how to use ...

24CXX I2C EEPROM Interface using SoftI2C lib
BY AVINASH - NOVEMBER 26 2011 07:43 PM

In this tutorial I will show you how to use ...

LATEST ON MICROCHIP PIC TUTORIALS

Thermometer with PIC Microcontroller
BY AVINASH - JUNE 10 2011 07:26 PM

In the last tutorial we learn about the multiplexing technique ...

Using Multiplexed 7 Segment Displays – PIC Microcontroller Tutorial
BY AVINASH - MAY 31 2011 12:11 PM

...

Introduction to PIC Interrupts and their Handling in C
BY AVINASH - DECEMBER 5 2010 10:51 AM

Interrupts are common features in almost all processor family, be ...

LATEST ON AVR PROJECTS

PC Controlled Robot
BY AVINASH - DECEMBER 25 2011 06:06 PM

In this tutorial we will discuss a simple PC controlled ...

OUT . SWITCH . IN . The tool I called is ADCGraph2.Power supply from a 12-0-12 transformer is applied here. The seven segment display used to show the current speed level. 5. The Yellow LED 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. . The current speed is displayed in a seven segment display. 3. MCU .ATmega8 AVR 8 bit Microcontroller. usually supplied with small DVD players. The ENTER key is used to switch on or off the fan. Posted By Avinash On July 4th. The TSOP1738 sensor is used to pick up commands from remote control. In the Video below you can check out the project in action. YOU ARE HERE : EXTREME ELECTRONICS » AVR PROJECTS » VISUALIZE ADC DATA ON PC SCREEN USING USART – AVR PROJECT AVR Project – Remote Controlled Fan Regulator. 2010 12:41 PM. 4. In this situation this valuable tool will come to your help. The unit provides 10 way speed control from 0 to 9. The UP key increase the fan's speed while the DOWN key decrease it.Visualize ADC data on PC Screen using USART – AVR Project BY AVINASH .Manual Switch used to operate the unit without the remote control. Under AVR Projects Share on facebookShare on twitterShare on deliciousShare on diggShare on stumbleuponShare on redditShare on emailMore Sharing Services This device can be used to remotely control the speed of an AC fan and to switch it on or off. 7. The yellow LED on the PCB indicates the power status of the load. The main parts of the circuit is labeled below. The remote control is a cheap NEC Format remote. Three buttons are used to command the circuit. 6. 1. Tested on 220v 50Hz AC line. 2.Here the AC load is connected in series.JUNE 2 2011 08:26 AM Many times a nice visualization of ADC data is required during learning about new sensors. it is being with me from a long time but today I thought of sharing it publicly.

.: Atmel AVR Based Remote Controlled Fan Regulator.Fig.

To ease your job we are giving the PCB Layouts too. Then you can mount the resistors. Then solder the IC U4 and U2. so that you can make the PCB at your home using the Etching Method. remember to properly orient the diodes.Fig.: Remote Controlled Fan Regulator Wiring Diagram. Construction of Remote Controlled Fan Regulator. The small round circle on the IC package marks the PIN number 1. You may also have the PCBs made from any fab house too. . To further easy the job and save your money we have already made the PCBs from a good fab house and they are available for purchase at very low cost. After that solder the diodes. this time too take care of the orientation. You can make the circuit as per the schematic on any general purpose PCB. Start assembly process by first soldering the jumper1. They are polar and don't work if installed other way round.

Remote Control is NEC Format Only (Chinese DVD/CD player remote works good. . 6. Its time to connect a real AC load. Remote Key codes has been feed to rckey. WARNING !!! Never Touch any part of the circuit when AC load is connected. Display. 1. AVR is clocked with 16MHz crystal (other value won't work) 3. Troubleshooting If the unit does not respond to the remote control signals then look for the following. IR sensor is of good quality and must be labeled TSOP1738 (other values won't work). Triac. Connect a 220V 100W incandescent lamp (NO CFL Please). 5. This ensures that the circuit is running properly.h file the project must be Rebuild.DOWN and ENTER keys to get their keycode and put them inrckeys. (I hope you know what does that means). Finally Connect the 12-0-12 Transformer and apply power. so This part is very important. After editing the rckeys. TSOP Sensor. AVR ATmega8's Fuse BIT is programmed to o HIGH=0xC9 LOW=0xFF 2. The display should change accordingly. As shown in the above wiring diagram. It can give you a fetal shock !!! Now you can can use the remote control to increase/decrease the lamp's brightness using the remote control.: Proper IC Installation. Build and run this demo and press UP.h file. Then you can press the up/down key in remote control to adjust the speed. 7805. The display should show '0'. All remotes available in market has random keycode. TV Remote Generally do not work as these are RC5 coded) 4. You can also switch it on and off using the ENTER key. Replace the fan with bulb because its easier to test. If you get a KIT from us then most of the problem do not arise.Fig.h file. After that you can solder the ceramic disk capacitors. the 16MHz crystal.

D3.D5. Part List 01 02 03 04 05 06 07 08 09 10 11 12 330 ohm resistor (8 Nos) 4k7 Resistor (2 Nos) 1K Resistor 39 ohm Resistor 1K5 Resistor 22pF Ceramic Disk Capacitor (2 Nos) 0. Part list for Remote Controlled Fan Regulator. .R11 R12 R13 R15 C1.C2 C3.Fig.D6.C6 C4 X1 D2.D7 D1 U4 .C5.1uF Ceramic Disk Capacitor (3 Nos) 470uF 50v Electrolytic Capacitor 16 MHz Crystal Half Size 1N4007 Diode (6 Nos) LED 5mm Any Colour MCT2E Opto Coupler R2-R9 R1.D4.: This Hobby Remote Control Works Great! Hobby Remote Control (NEC) is available from our online store.

PCBs can be purchased from PCB section of our online shop.: Schematic (Click To Enlarge/Print). Schematic Fig.13 14 15 16 17 18 19 20 MOC3021 Opto Triac Driver ATmega8-16PU General purpose 8 bit MCU Triac BT136 7805 Voltage Regulator Common Anode Display TSOP1738 IR Sensor 220V AC to 12-0-12 Centre Tapped Transformer (NOT Included in KIT) Hobby Remote Control (NEC) U2 U1 U3 U5 DISP11 X2 Buy Remote Controlled Fan Regulator Kit. PCB For Remote Controlled Fan Regulator. .

******************************** Compiler: avr-gcc (WinAVR-20090313) Project Manager/IDE: AVR Studio 4.17 Build 666 Other Lib: eXtreme NEC Decoder.: Remote Controlled Fan Regulator PCB. Hardware: . /* Remote Controlled Fan Regulator.Fig. avr-gcc C Source Code.

LEARNING AND EDUCATIONAL PURPOSE ONLY. India NOTICE -------NO PART OF THIS WORK CAN BE COPIED.IR Receiver INT1 .Triac Control.h> #include <avr/interrupt.Manual Switch For ATmega8 @ 16MHz Fuse: HIGH=0xC9 LOW=0xFF Copyright (c) 2008-2010 eXtreme Electronics. PD5 . THE LIBRARY.h> #include "remote.Zero Crossing Detector. NOR ANY PART OF IT CAN BE USED IN COMMERCIAL APPLICATIONS. PB2 .h" #include "rckeys. IT IS INTENDED TO BE USED FOR HOBBY. DISTRIBUTED OR PUBLISHED WITHOUT A WRITTEN PERMISSION FROM EXTREME ELECTRONICS INDIA.h" #define FAN_POWER_LED_PORT PORTD .h> #include <util/delay_basic.INT0 . */ #include <avr/io. IF YOU WANT TO USE THEM IN COMMERCIAL APPLICATION PLEASE WRITE TO THE AUTHOR.

PORTD|=(1<<PD5). //Seven segment DDRB|=0b00000010. //Middle segment G Display(0). DDRC|=0b00111111. //Initialize the zero crossing detector INT(1) MCUCR|=((1<<ISC11)|(1<<ISC10)).78.62. void Initialize() { FAN_POWER_LED_DDR|=0B10000000.31. //High = TRIAC Off .16. uint8_t fan_on=0. POWER_LED_OFF(). uint8_t speed=0.94.1}.125. GICR|=(1<<INT1).#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.109. //INT in Rising edge //Enable INT1 //Output DDRD|=(1<<PD5).47. RemoteInit().

TCNT2=0x00. } //High = TRIAC Off if(speed==9) { PORTD&=(~(1<<PD5)). } PORTD|=(1<<PD5). //CTC TIMSK|=(1<<OCIE2). TCCR2|=((1<<CS22)|(1<<CS21)|(1<<CS20)). */ ISR(INT1_vect) { if(!fan_on) { PORTD|=(1<<PD5).//Set Timer 2 TCCR2|=(1<<WGM21). //Start Timer prescaler =1024 . //High = TRIAC Off OCR2=table[speed]. } /* Zero Crossing Detect. return. //low = TRIAC ON return. //Enable OCI2 sei().

i++) _delay_loop_2(0).i<100. } //Stop Timer /* Simple Wait Function */ void Wait() { char i. for(i=0. //low = TRIAC ON TCCR2&=(~((1<<CS22)|(1<<CS21)|(1<<CS20))). } /* Displays a number in Seven Seg Display */ void Display(uint8_t num) { .} /* Timer2 Compare ISR */ ISR(TIMER2_COMP_vect) { PORTD&=(~(1<<PD5)).

switch (num) { case 0: PORTC=0B00000000. PORTB&=(~(0B00000010)). break. break. case 5: // xxfedcba PORTC=0B00010010. case 2: // xxfedcba PORTC=0B00100100. .if(num>9) return. PORTB&=(~(0B00000010)). PORTB|=0B00000010. break. case 1: // xxfedcba PORTC=0B00111001. PORTB|=0B00000010. break. break. break. case 4: // xxfedcba PORTC=0B00011001. case 3: // xxfedcba PORTC=0B00110000. PORTB&=(~(0B00000010)).

} } void main() { uint8_t cmd. break. PORTB|=0B00000010. break. case 6: // xxfedcba PORTC=0B00000010. break. case 9: // xxfedcba PORTC=0B00010000.PORTB&=(~(0B00000010)). PORTB&=(~(0B00000010)). break. PORTB&=(~(0B00000010)). PORTB&=(~(0B00000010)). break. case 7: // xxfedcba PORTC=0B00111000. //Command received from remote Initialize(). while(1) . case 8: // xxfedcba PORTC=0B00000000.

//Now process the command //UP Key if(cmd==RC_UP) { if(speed<9) speed++. } else { POWER_LED_ON().{ //Get Command For the Remote Control cmd=GetRemoteCmd(1). } //DOWN Key if(cmd==RC_DOWN) { if(speed>0) speed--. } //Enter Key if(cmd==RC_ENTER) { if(fan_on) { POWER_LED_OFF(). //Turn On //Turn Off } . fan_on=1. fan_on=0.

Related Post  Using IR Remote Controls with AVR MCUs By Avinash Gupta www. Parts. Opto-Coupler. Moc3021.} Display(speed). Buy Remote Controlled Fan Regulator Kit.com Tags: Atmega. When I tried to build the project.” 1. Buy Kit Buy complete kit including PCB. You just need to buy a 12-0-12 Transformer of current rating 500ma or more because it is NOT included in the kit. Programmed MCU and Matching IR Remote Control Unit. Avr Project. Microcontroller. Atmega8. PCB Layouts in PDF. Downloads    Complete AVR Studio Project. Bt136. } } Note: Other files that are part of the eXtreme NEC decoder must also be added to the project. Triac Share on facebookShare on twitterShare on deliciousShare on diggShare on stumbleuponShare on redditShare on emailMore Sharing Services 45 Responses To “AVR Project – Remote Controlled Fan Regulator.Microsoft® Word® and PNG Formats. Remote Control.Project. The project file you kept for download is having some problems. i got “no build tools defined” error. Arifuddin Sheik Says: July 6.AvinashGupta. . there is no problem. They can be downloaded from links given below.com me@avinashgupta. When i compiled the same files by creating a new project. Ir. HEX File For ATmega8-16PU Chip. 2010 at 6:51 pm Hi Avinash! Nice project. A Compatible Remote Control is available from our shop.

Is it for educational purpose to cover more topics or there is a need for using the hardware? REPLY . Avinash Says: July 6. I am asking about POWER LEDS and FAN OUTPUT connections. REPLY 3. After all. But somewhere in my mind.I build a project for controlling home appliances using DVD remote using your files with LCD support and EEPROM options. Avinash Says: July 6. 2010 at 11:37 pm Sure. Can i connect output to any pin say PC2 ( i bought Xboard MIni from your store. Arifuddin Sheik Says: July 6. So. I am thinking of generating pwm using atmega8 feature for speed control. I made that using your libraries and tutorials! I had finished the project just today. 2010 at 7:14 pm If you post your project on your blog with pictures and code. I am working on integration of speed control. 2010 at 7:09 pm @Arif. Do you think the pwm logic works for speed control. Yes you can change the Triac Output pins. i got an idea of integrating this fan speed control option in my project. I know we cant change the interrupt pin. whenever the Main power goes off. REPLY 2. After seeing this project. the MCU will check the EEPROM data which has the appliances status. I just want to know whether the outputs you specified can be changed to other pins or not. Simply Change the OUTPUT Section in the Initialize() Function. The main reason why I thought this is to reduce the hardware and to avoid the optocouplers. I will definitely post the project with Pictures and code. then I will give you this PCB(Bare) for Free!!! REPLY 5.17 Build 666 REPLY 4. I will test that tomorrow and post the results. 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. the PD5 pin is already dedicated for LCD connection). And give credit to us for the Remote Libraries. Avinash Says: July 6. 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. 2010 at 7:11 pm As for the AVR Studio Error Please use Project Manager/IDE: AVR Studio 4.

2010 at 11:39 pm Sorry its atmega16.html check out the details of my project in my blog. The article you submitted is just great ! You won your PCB as I promised! So should I send it to your registered address? Khammam. Arifuddin Sheik Says: July 6. 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 using this we fire INT1 whever the AC Wave reaches zero point. I will update it as soon as I finish doing it. REPLY 9. 2) Triac Can only be switched on and it remains on even if the driving voltage is removed from the Gate terminal.D4. 2010 at 2:17 pm http://arif-ece.com/2010/07/remote-controlled-home-appliances. not atmega8! REPLY 7. REPLY .D5 is NOT filtered with capacitor. Please post your comments and suggestion. 2010 at 4:58 pm Also the bridge rectifier section made from D2. Avinash Says: July 7. If capacitor is used it will become PURE DC and we cannot detect Zero point. 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. Avinash Says: July 7.blogspot.D3. Arifuddin Sheik Says: July 7. REPLY 8. 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.6. 2010 at 4:52 pm @Arifuddin. I am working on improving the code for fan speed control using PWM.

But I also need the components that are required in the project. I haven’t updated the project yet. credit goes to you. I deleted the old link because the post is containing html errors. You initiated me for writing the article. You may get them by Wednesday. My address is correct as you stated.blogspot. I will anyhow continue posting my projects.blogspot. 2010 at 6:32 pm Thank you so much. I read your comment in my blog regarding projects today which you sent in may 2010. REPLY 13. Coming to the board modification which I had done. Please inform me when you receive them. Avinash Says: July 11.html This is the new link. I will deposit cash in your bank account. http://arif-ece. Please mail me the appropriate cost. REPLY 12. Arifuddin Sheik Says: July 7. Arifuddin Sheik REPLY 11.html Thanking you. 2010 at 8:11 pm http://arif-ece. you please check this article and give me suggestions and your feedback regarding powering the XBoardMini with USB Power supply.10.com/2010/07/remote-controlled-home-appliances_07. 2010 at 8:39 am @Arif Your PCBs have been dispatched. Coming to my blog. Arifuddin Sheik Says: July 7. I think you should consider using Vcc pin in ISP connector. I did some research regarding yesterdays comment regarding PWM and found out the same. Arifuddin Sheik REPLY . Arifuddin Sheik Says: July 26. 2010 at 9:37 pm @Avinash Thanks for sending me your PCB’s. So.com/2010/07/modifying-avr-development-board-and. I forgot about my blog before a long time.

php REPLY 17.as in shops they ask for that too apart from voltage rating.14. 2010 at 8:43 am @Mahendra Patel. that’s to be used in this project . 2010 at 12:49 pm hello avinashplz tell me the min ampere rating of the transformer. Puneet Says: August 7. I want this kit 100 pcs. Fatimah Says: September 2.5 kva. thanks… .co.. Thanks Puneet REPLY 15. 2010 at 11:42 pm remote control fan regulater this products is to good. For Payment Option see http://shop. Sandeep Says: October 17. 2010 at 3:02 am do you any supplier in malaysia if i would like to buy the component that used in this project? REPLY 16. I want to build these remote controllers which can take a load of 1. please sent price and mode of payment REPLY o Avinash Says: September 13.in/shipping. Mahendra Patel Says: September 12. Please advice on what alteration need to be done to the circuit. inform me as asap.extremeelectronics.. 2010 at 3:17 pm Hello Avinash.

I’m very new at this and find this project to be very interesting (a bit of a hobbyist). Sorry I think I worded the post incorrectly. What sort of 12-0-12 Trasformer should I use? Please help REPLY o Avinash Says: November 18. Tandy Says: November 18. 2010 at 8:36 am Hi Avinash. Sorry for asking another question almost immediately! Basically I have a 240VAC fan to run which runs with 120W of power. I noticed that you ran a 100W bulb with your mains being at 220V AC with your transformer. Quick question on the 220V AC to 12-0-12 Centre Tapped Transformer. 2010 at 6:37 am Hi Avinash. 2010 at 7:04 am Hi Avinash.REPLY 18. I’m not too sure with what I’ve found so far! Please help. Is it possible for you to direct me to a place where I could buy them online. Tandy Says: November 18. . Tandy Says: November 18. Tandy REPLY 19. 2010 at 8:15 am @Tandy I can’t get what you mean by What sort of 12-0-12 Trasformer should I use? REPLY 20.

Please help with some knowledge thanks. The fan is a 120W fan(that I found lying around) and runs on 240V AC from the mains.If i was trying to implement this with the fan I have what sort of transformer would you recommend. REPLY .