Professional Documents
Culture Documents
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
SUBSCRIBE
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
...
PC Controlled Robot
BY AVINASH - DECEMBER 25 2011 06:06 PM
Many times a nice visualization of ADC data is required during learning about new sensors. In this situation this valuable tool will come to your help. The tool I called is ADCGraph2, it is being with me from a long time but today I thought of sharing it publicly.
YOU ARE HERE : EXTREME ELECTRONICS AVR PROJECTS VISUALIZE ADC DATA ON PC SCREEN USING USART AVR PROJECT
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. 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.
WARNING !!! Never Touch any part of the circuit when AC load is connected. 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. 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 inrckeys.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.
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
Schematic
********************************
Compiler: avr-gcc (WinAVR-20090313) Project Manager/IDE: AVR Studio 4.17 Build 666 Other Lib: eXtreme NEC Decoder.
Hardware:
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/interrupt.h>
#define POWER_LED_ON()
FAN_POWER_LED_PORT&=(~(1<<FAN_POWER_LED_BIT))
uint8_t table[10]={141,125,109,94,78,62,47,31,16,1};
POWER_LED_OFF();
Display(0);
RemoteInit();
MCUCR|=((1<<ISC11)|(1<<ISC10)); GICR|=(1<<INT1);
//Enable INT1
//Output
TIMSK|=(1<<OCIE2);
//Enable OCI2
sei();
} /*
*/
return; }
PORTD|=(1<<PD5);
OCR2=table[speed];
TCNT2=0x00;
TCCR2|=((1<<CS22)|(1<<CS21)|(1<<CS20));
/*
TCCR2&=(~((1<<CS22)|(1<<CS21)|(1<<CS20))); }
//Stop Timer
/*
for(i=0;i<100;i++) _delay_loop_2(0); }
/*
if(num>9) return;
PORTC=0B00010010;
void main() {
Initialize();
while(1)
//Enter Key
if(cmd==RC_ENTER) { if(fan_on) { POWER_LED_OFF(); fan_on=0; } else { POWER_LED_ON(); fan_on=1; //Turn On //Turn Off
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
Complete AVR Studio Project. HEX File For ATmega8-16PU Chip. A Compatible Remote Control is available from our shop. PCB Layouts in PDF,Microsoft Word and PNG Formats.
Buy Kit
Buy complete kit including PCB, Parts, Programmed MCU and Matching IR Remote Control Unit. You just need to buy a 12-0-12 Transformer of current rating 500ma or more because it is NOT included in the kit. Buy Remote Controlled Fan Regulator Kit.
Related Post
Using IR Remote Controls with AVR MCUs By Avinash Gupta www.AvinashGupta.com me@avinashgupta.com
Tags: Atmega, Atmega8, Avr Project, Bt136, Ir, Microcontroller, Moc3021, Opto-Coupler,Project, Remote Control, 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.
1.
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.
REPLY
2.
Avinash Says:
@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 Dont forget to post your project in your blog to share with the World. And give credit to us for the Remote Libraries.
REPLY
3.
Avinash Says:
As for the AVR Studio Error Please use Project Manager/IDE: AVR Studio 4.17 Build 666
REPLY
4.
Avinash Says:
If you post your project on your blog with pictures and code, then I will give you this PCB(Bare) for Free!!!
REPLY
5.
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?
REPLY
6.
7.
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.
REPLY
8.
Avinash Says:
@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.
REPLY
9.
Avinash Says:
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 dont add anything for mere educational purpose.
REPLY
10.
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
REPLY
11.
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 havent updated the project yet.
REPLY
12.
Avinash Says:
@Arif Your PCBs have been dispatched. You may get them by Wednesday. Please inform me when you receive them.
REPLY
13.
14.
Puneet Says:
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
REPLY
15.
Fatimah Says:
do you any supplier in malaysia if i would like to buy the component that used in this project?
REPLY
16.
remote control fan regulater this products is to good. I want this kit 100 pcs. please sent price and mode of payment
REPLY
Avinash Says:
17.
Sandeep Says:
hello avinashplz tell me the min ampere rating of the transformer. thats to be used in this project ,as in shops they ask for that too apart from voltage rating.. inform me as asap.. thanks
REPLY
18.
Tandy Says:
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. Im not too sure with what Ive found so far! Please help, Tandy
REPLY
19.
Tandy Says:
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
REPLY
Avinash Says:
@Tandy I cant get what you mean by What sort of 12-0-12 Trasformer should I use?
REPLY
20.
Tandy Says:
Hi Avinash, Sorry I think I worded the post incorrectly. Im 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.
REPLY