AC fan speed control using remote control power electronics term project report
1. Capital University of Science & Technology
Department of Electrical Engineering
Term Project
Power Electronics
Ac phase control using Remote control
Karamatullah EE123022
2. ii
Copyright 2016 by CUST Student
All rights reserved. Reproduction in whole or in part in any form requires the prior written
permission of karamatullah.
3. iii
DECLARATION
It is declared that this is an original piece of my own work, except where otherwise
acknowledged in text and references. This work has not been submitted in any form for
another degree or diploma at any university or other institution for tertiary education and
shall not be submitted by me in future for obtaining any degree from this or any other
University or Institution.
karamatullah
Reg. No EE123022
June 2016
4. iv
ACKNOWLEDGMENT
All the praise is for Allah, the most Merciful and Beneficent, who blessed us with the
knowledge, gave us the courage and allowed us to accomplish this task. The special thanks
goes to our teacher, Sir. Muhammad Rizwan Javed the support and demonstration that he
gave us to complete this project is really helpful to us. We faced difficulties in completion of
assigned tasks and we did best and valuable according to our working.
5. v
ABSTRACT
This project is about the AC phase control system using remote control. The Ac phase can be
controlled by using TRIAC. After zero detection Arduino control the output power by
generating a control gate pulse and firing it on the gate of TRIAC while getting data from
remote. The remote generate the HEX number and send to Arduino. Arduino will trigger the
TRIAC with a delay according to HEX code regions that are define. Using this method, it
controls the average output of AC power.
6. vi
TABLE OF CONTENTS
DECLARATION ......................................................................................................................iii
ACKNOWLEDGMENT...........................................................................................................iv
ABSTRACT...............................................................................................................................v
LIST OF FIGURES .................................................................................................................vii
Chapter 1................................................................................................................................... 8
INTRODUCTION .................................................................................................................... 8
1.1 Overview .................................................................................................................... 8
1.2 Statement of Problem................................................................................................. 8
1.3 Purpose of the project................................................................................................. 8
1.4 Specifications of proposed solution ........................................................................... 8
1.5 Applications of the project ......................................................................................... 8
Chapter 2................................................................................................................................... 9
PROJECT DESIGN AND IMPLEMENTATION.................................................................... 9
2.1 Design Procedure ....................................................................................................... 9
2.1.1 IR codes............................................................................................................... 9
2.1.2 Zero Crossing Detector ..................................................................................... 11
2.2 Details About Software ............................................................................................ 11
2.3 Software Implementation......................................................................................... 12
2.3.1 Arduino Sketch ................................................................................................. 12
2.3.2 Proteus Implementation .................................................................................... 13
Chapter 3................................................................................................................................. 14
TOOLS AND TECHNIQUES................................................................................................ 14
3.1 Hardware used with technical specifications ........................................................... 14
3.1.1 Arduino mega 2560........................................................................................... 14
3.1.2 Zero Crossing Detector 4N25 ........................................................................... 15
3.1.3 TRIAC BT136................................................................................................... 15
3.2 Software(s), simulation tool(s) used......................................................................... 15
3.2.1 Proteus Professional.......................................................................................... 15
3.3 Summary .................................................................................................................. 16
Chapter 5................................................................................................................................. 17
CONCLUSION....................................................................................................................... 17
References............................................................................................................................... 18
APPENDICES ........................................................................................................................ 19
7. vii
Appendix – A...................................................................................................................... 19
LIST OF FIGURES
Figure 1:Block Diagram............................................................................................................ 9
Figure 2:Power Control........................................................................................................... 11
Figure 3:Arduino Sketch......................................................................................................... 12
Figure 4:Proteus Implementation............................................................................................ 13
Error! Bookmark not defined.Figure 8:Arduino Mega 2560.............................................. 14
Figure 9: 4N25 OPTCOUPLER ............................................................................................. 15
Figure 10:TRIAC BT136........................................................................................................ 15
8. 8
Chapter 1
INTRODUCTION
Arduino is an open-source prototyping platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs, turn it into an output,
activating a motor and turning on an LED. You can tell your board what to do by
sending a set of instructions to the microcontroller on the board. To do so you use
the Arduino programming language [1].
1.1 Overview
The Arduino platform gives you a lot of pre-wiring and free code libraries that
will let you concentrate on testing your idea instead of spending your time
building supporting circuitry or writing tons of low level code. Arduino based
projects are useful because it allows easy and fast prototyping.
1.2 Statement of Problem
Our problem is to design a Temperature based Arduino automatic AC power
control system using Arduino Mega 2560. We done this project in Arduino 1.6.7
software. The open-source Arduino Software (IDE) makes it easy to write code
and upload it to the board [2]. It runs on Windows. This software can be used with
any Arduino board.
1.3 Purpose of the project
The purpose of this project is to design a speed control based on remote control
using Arduino. To eliminate human involvement, familiar our self with Arduino
Power based application and practical implementation in Power system.
1.4 Specifications ofproposedsolution
The given specification of Proposed solution is to design a remotely control
Arduino automatic AC power control system using a Power TRIAC and Arduino
Mega 2560 on Arduino Software.
1.5 Applications of the project
Motor frequency control.
Motor speed control
AC phase control
Home automation
9. 9
Chapter 2
PROJECT DESIGN AND IMPLEMENTATION
We design Arduino based cooling system in open-source Arduino Software. It’s
easy to write code and upload it to the board using Arduino Software. Then we
implement this project in Proteus 8 Professional.
2.1 DesignProcedure
Arduino is interfacing with several devices.
Interfacing with zero crossing detector to get information when AC wave
cross zero level.
Interfacing with TRIAC to control AC power.
Interfacing with remote with arduino.
2.1.1 IR codes
switch(results.value)
{
case 0xE318261B:
Arduino
IR receiver
TRIAC Load
Zero Crossing
Detector
220 V AC
Regulated power
Supply
Figure 1:Block Diagram
10. 10
Serial.println(" power ");
break;
case 0xF0C41643:
Serial.println(" zero ");
break;
case 0x9716BE3F:
Serial.println(" one ");
break;
case 0x3D9AE3F7:
Serial.println(" two ");
break;
case 0x6182021B:
Serial.println(" three ");
break;
case 0x8C22657B:
Serial.println(" four ");
break;
case 0x488F3CBB:
Serial.println(" five ");
break;
case 0x449E79F:
Serial.println(" six ");
break;
case 0x32C6FDF7:
Serial.println(" seven ");
break;
case 0x1BC0157B:
Serial.println(" eight ");
break;
case 0x3EC3FC1B:
Serial.println(" nine ");
break;
delay(500);
}//END translateIR
11. 11
2.1.2 Zero Crossing Detector
The zero-crossing detection circuit provides a 5v pulse every time the ac signal
crosses zero volts. We detect this with the Arduino to trigger the circuit precisely
in synchronization with these zero-crossing events. The method for power control
is shown in the figure below [3].
Figure 2:Power Control
Once a zero crossing is detected, the TRIAC remains off for a controlled amount
of time (t1). The longer this time is, the less power the ac circuit receives. Once
the “off-time”, t1 has elapsed, the microcontroller turns on the TRIAC by
applying a voltage to the gate (shown in red). Once turned on, the TRIAC will
remain on even after the gate voltage has been removed. It will turn off if the gate
voltage is zero the next time the ac waves crosses zero [3].
Because of this, we do not need to take care to turn the TRIAC off when the ac
signal crosses zero again. All we need to do is to ensure that the TRIAC gets
turned off inside of the period of ½ wave (t3). The duration of the gate pulse (t2)
is determined by a minimum requirement of the TRAIC. If this pulse is too short,
the TRAIC will not fire Once the second zero crossing occurs, since there is no
voltage on the gate, the TRIAC remains off until triggered again in the next ½
cycle. The net result here is that we “chop” parts of the wave out resulting in
lower average power [3].
We will be using interrupts and the Arduino timer to precisely control the timing
of the TRIAC gate. The AC signal is 50 Hz. This means is that the AC signal
crosses zero, reaches peak positive voltage, crosses zero, reaches peak negative
voltage and returns to zero 50 times each second [3].
2.2 Details About Software
Arduino programs may be written in any programming language with a compiler
that produces binary machine code. The Arduino project provides the Arduino
integrated development environment (IDE). It includes a code editor with features
such as syntax highlighting, brace matching, and automatic indentation, and
12. 12
provides simple one-click mechanism for compiling and loading programs to an
Arduino board. A program written with the IDE for Arduino is called a "sketch".
The Arduino IDE supports the C and C++ programming languages using special
rules of code organization. A typical Arduino C/C++ sketch consist of two
functions that are compiled and linked with a program stub main () into an
executable cyclic program [4].
setup (): a function that runs once at the start of a program and that can initialize
settings.
loop (): a function called repeatedly until the board powers off [4].
2.3 Software Implementation
2.3.1 Arduino Sketch
Figure 3:Arduino Sketch
14. 14
Chapter 3
TOOLS AND TECHNIQUES
The tools and techniques used in Arduino based cooling system are given below
in details. Tools and techniques includes both hardware and software.
3.1Hardware used with technicalspecifications
In Arduino based cooling system we use following Hardware for the
implementation of the project.
3.1.1 Arduino mega 2560
Arduino is an open-source computer hardware and software company, project and
user community that designs and manufactures microcontroller-based kits for
building digital devices and interactive objects that can sense and control objects
in the physical world. The project is based on microcontroller board designs,
manufactured by several vendors, using various microcontrollers. These systems
provide sets of digital and analog I/O pins that can be interfaced to various
expansion boards and other circuits. The boards feature serial communications
interfaces, including USB on some models, for loading programs from personal
computers. For programming it includes support for the C and C++ programming
languages. An Arduino board historically consists of an Atmel 8-, 16- or 32-bit
AVR microcontroller. Most boards include a 5 V linear regulator and a 16 MHz
crystal oscillator. Arduino mega 2560 has 70 numbers of inputs and outputs.
There are 5 numbers of digital inputs. There are 16 numbers of analog inputs and
it has a 256 KB of flash memory on board [1].
Figure 5:Arduino Mega 2560
15. 15
3.1.2 Zero Crossing Detector 4N25
The 4N25 family is an industry standard single channel phototransistor coupler. Each OPTOCOUPLER
consists of gallium arsenide infrared LED and a silicon NPN phototransistor [5].
Figure 6: 4N25 OPTCOUPLER
3.1.3 TRIAC BT136
TRIAC use in applications requiring high bidirectional transient and blocking voltage
capability and high thermal cycling performance. Typical applications include motor
control, industrial and domestic lighting, heating and static switching [5].
Figure 7:TRIAC BT136
3.2 Software(s), simulationtool(s) used
3.2.1 Proteus Professional
Proteus is a Virtual System Modeling that combines circuit simulation animated
components and microprocessor models to co-simulate the complete
microcontroller based designs. This is the perfect tool for engineers to test their
microcontroller designs before constructing a physical prototype in real time. This
program allows users to interact with the design using on-screen indicators and/or
LED and LCD displays and if attached to the PC switches and buttons. One of the
main components of Proteus is the Circuit Simulation. Proteus is best simulation
software for various designs with microcontroller. It is mainly popular because of
availability of almost all microcontrollers in it. You can simulate your
programming of microcontroller in Proteus 8 Simulation Software. After
simulating your circuit in Proteus Software you can directly make PCB design
with it so it could be an all in one package for students and hobbyists [6].
16. 16
3.3Summary
In this chapter we discussed about the Hardware and Software tools that are used
in temperature based Arduino automatic AC power control. Hardware tools are
Arduino Microcontroller, zero crossing detector 4N25 and TRIAC. Then we
discussed in details about these Hardware parts. Software tool that is used in this
project. Then we discussed about Proteus Professional tools in details.
17. 17
Chapter 5
CONCLUSION
This project increases our knowledge in the field of Power Electronics and
Industrial Electronics. This field is most growing area in the field of electronic
and electrical engineering. Through this project we learn the working of different
electronics components and we also learned how to manage these components
through computerized programmed device in our case is Arduino.
18. 18
References
[1] "ARDUINO," [Online]. Available:
https://www.arduino.cc/en/Guide/Introduction. [Accessed 15 June 2016].
[2] "ARDUINO," [Online]. Available:
http://playground.arduino.cc/Projects/Ideas. [Accessed 15 June 2016].
[3] "ARDUINO," [Online]. Available:
http://playground.arduino.cc/Main/ACPhaseControl. [Accessed 15 June
2016].
[4] "ARDUINO," [Online]. Available: https://www.arduino.cc/en/Main/Software.
[Accessed 15 June 2016].
[5] "DatasesheetCatalog," [Online]. Available: http://www.datasheetcatalog.com/.
[Accessed 15 June 2016].
[6] "PROTEUS," [Online]. Available: http://proteus.software.informer.com/.
[Accessed 15 June 2016].
19. 19
APPENDICES
Appendix – A
#include "IRremote.h"
/*-----( Declare Constants )-----*/
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin
11
/*-----( Declare objects )-----*/
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of
'decode_results'
/*-----( Declare Variables )-----*/
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the
pushbutton status
void setup() {
Serial.begin(9600);
Serial.println("IR Receiver Raw Data + Button Decode Test");
irrecv.enableIRIn(); // Start the receiver
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
if (irrecv.decode(&results)) // have we received an IR signal?
{
// Serial.println(results.value, HEX); UN Comment to see raw
values
translateIR();
irrecv.resume(); // receive the next value
}
// read the state of the pushbutton value:
switch(results.value)
{
case 0xE318261B:
Serial.println(" power ");
if (13==HIGH )
{
20. 20
digitalWrite(ledPin,LOW);
}
else
digitalWrite(ledPin,HIGH);
break;
// case 0xF0C41643:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(8.9);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
case 0x9716BE3F:
if (13==HIGH )
{
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
delay(0);
digitalWrite(ledPin, HIGH);
}
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
}
else digitalWrite(ledPin, LOW);
break;
case 0x3D9AE3F7:
21. 21
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
delay(5);
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
break;
case 0x6182021B:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
delay(7);
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
break;
// case 0x8C22657B:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(5);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
22. 22
//
// case 0x488F3CBB:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(4);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
//
// case 0x449E79F:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(3);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
//
// case 0x32C6FDF7:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(2);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
23. 23
// }
// break;
//
// case 0x1BC0157B:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(1);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
// case 0x3EC3FC1B:
// buttonState = digitalRead(buttonPin);
//
// // check if the pushbutton is pressed.
// // if it is, the buttonState is HIGH:
// if (buttonState == HIGH) {
// // turn LED on:
// delay(0);
//
// digitalWrite(ledPin, HIGH);
//
// }
// else {
// // turn LED off:
// digitalWrite(ledPin, LOW);
//
// }
// break;
//
}
}
void translateIR() // takes action based on IR code received
// describing Car MP3 IR codes
{
switch(results.value)
{
case 0xE318261B:
Serial.println(" power ");
24. 24
break;
case 0xF0C41643:
Serial.println(" zero ");
break;
case 0x9716BE3F:
Serial.println(" one ");
break;
case 0x3D9AE3F7:
Serial.println(" two ");
break;
case 0x6182021B:
Serial.println(" three ");
break;
case 0x8C22657B:
Serial.println(" four ");
break;
case 0x488F3CBB:
Serial.println(" five ");
break;
case 0x449E79F:
Serial.println(" six ");
break;
case 0x32C6FDF7:
Serial.println(" seven ");
break;
case 0x1BC0157B:
Serial.println(" eight ");
break;
case 0x3EC3FC1B:
Serial.println(" nine ");
break;
}
delay(500);
}//END translateIR