You are on page 1of 36

PROBLEM STATEMENT

GBPUAT is an agro-based university with considerable efforts of research being applied in this field through experimentation; therefore a large part of these studies takes place in the several polyhouses that are installed across the university campus. To provide these installations with a low-cost ventilation temperature control system, our project aims to fulfill this very need. The project aims to automatically control and regulate the speed of Induction Motor according to the current temperature of the surroundings thereby increasing the air flow rate and bringing about a resultant decrease in temperature. It is aimed at designing an integrated low cost solution that can be easily installed in external environments of

Polyhouses/Greenhouses and to remove the need for manual control of the ventilation system.

Chapter 1: INTRODUCTION

The concept of this project is to create an Automatic Temperature Control System to control the temperature of a system. The circuit maintains the temperature of the system in a particular range. The fan RPM increases with increase in temperature and vice versa. For the circuit, it consists of Temperature Sensing Unit, ATMEGA16 microcontroller, LCD Module, Switching Device, Driver Circuit and a Fan. It will operate based on the values or ranges of temperature in the system which is detected by the Temperature Sensor. The Temperature Sensor detects the temperature of the system. The Temperature Sensor consists of an LM35 IC. The temperature sensor is connected to the ADC input of the ATMEGA16 microcontroller. It converts the analog input to a digital value. The ATMEGA16 generates Pulse Width Modulation (PWM) value according to the temperature sensor value. The ATMEGA16 is connected to a driver circuitwhich regulates the speed of the fan. The LCD module is also connected to the ATMEGA16 microcontroller. The LCD module displays the current temperature and PWM value.

Chapter 2: LITERATURE REVIEW

2.1

DC Motor: A DC motor is a mechanically commutated electric motor powered from direct

current (DC). The stator is stationary in space by definition and therefore its current. The current in the rotor is switched by the commutator to also be stationary in space. This is how the relative angle between the stator and rotor magnetic flux is maintained near 90 degrees, which generates the maximum torque. DC motors have a rotating armature winding (winding in which a voltage is induced) but non-rotating armature magnetic field and a static field winding (winding that produce the main magnetic flux) or permanent magnet. Different connections of the field and armature winding provide different inherent speed/torque regulation characteristics. The speed of a DC motor can be controlled by changing the voltage applied to the armature or by changing the field current. The introduction of variable resistance in the armature circuit or field circuit allowed speed control. Modern DC motors are often controlled by power electronics systems called DC drives. The introduction of DC motors to run machinery eliminated the need for local steam or internal combustion engines, and line shaft drive systems. DC motors can operate directly from rechargeable batteries, providing the motive power for the first electric vehicles. Today DC motors are still found in applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and paper machines.

The speed of a d.c. motor is given by: N=(V-IR)/ (2.1)

It is clear that there are three main methods of controlling the speed of a d.c. motor, namely: (i) By varying the flux per pole. This is known as flux control method. (ii) By varying the resistance in the armature circuit. This is known as armature control method. (iii) By varying the applied voltage V. This is known as voltage control method.

2.2

Controlling dc motor speed with Pulse Width Modulation (PWM) PWM is an effective method for adjusting the amount of power delivered to the load.

PWM technique allows smooth speed variation without reducing the starting torque. In PWM method, operating power to the motors is turned on and off to modulate the current to the motor. The ratio of on to off time is called as duty cycle. The duty cycle determines the speed of the motor. The desired speed can be obtained by changing the duty cycle. The PulseWidth-Modulation (PWM) in microcontroller is used to control duty cycle of DC motor drive. PWM is an entirely different approach to controlling the speed of a DC motor. Power is supplied to the motor in square wave of constant voltage but varying pulse-width or duty cycle. Duty cycle refers to the percentage of one cycle during which duty cycle of a continuous train of pulses. Since the frequency is held constant while the on-off time is varied, the duty cycle of PWM is determined by the pulse width. Thus the power increases duty cycle in PWM.

2.3

Induction Motor An AC motor is an electric motor driven by an alternating current (AC).It commonly

consists of two basic parts, an outside stationary stator having coils supplied with alternating current to produce a rotating magnetic field, and an inside rotor attached to the output shaft that is given a torque by the rotating field. An induction or asynchronous motor is an AC motor in which current is induced in the rotor winding by the magnetic field of the stator winding, by electromagnetic induction. Therefore they do not require the sliding electric contacts, such as a commutator or slip rings, which are needed to transfer current to the rotor winding in other types of motor such as the universal motor. Rotor windings consist of short-circuited loops of conductors and are made in two types: the wound rotor and the squirrel-cage rotor. Three-phase squirrel-cage induction motors are widely used in industrial drives because they are rugged, reliable and economical. Single-phase induction motors are used extensively for smaller loads, such as household appliances like fans. Although the simple induction motor is a fixed-speed device, they are increasingly being used with variablefrequency drive (VFD) systems, which allow the speed to be varied. VFDs offer especially important energy savings opportunities for existing and prospective induction motors in variable-torque centrifugal fan, pump and compressor load applications. Squirrel cage induction motors are very widely used in both fixed-speed and VFD applications. There are the following methods for the Speed control of the Induction motors: 1.Speed control by Frequency Changing or Variable Frequency control method 2.Speed control by Voltage Variation or Stator voltage Control Method 3.Speed control by pole changing method

2.4

Speed Control by Voltage Variation using TRIAC The Induction motor speed can be controlled by changing the applied voltages on

the stator; because in induction motor the output torque is directly proportional to the square of the voltage. Thus the motor speed controlled without changing the supply frequency, for example, if the supply voltage value is decreases to its half, the motor torque is decreases th times; the torque is directly proportional to the speed of the motor. In stator voltage control method, the stator voltage is controlled by a SCR; these SCRs are connected with three phase supply (with each Phase) in anti parallel conduction. The output voltage of the SCR is controlled by the firing angle of the SCR. Increasing the firing angle, decreases the output voltage and this way the speed of the induction motor is decreases. By decreases the firing angle, increasing the output voltages and the speed of the motor is increases.

Chapter 3: PROJECT RESOURCES REQUIRED

3.1

Softwares

3.1.1 Proteus ISIS 7.6: Proteus is the best simulation software for various designs with microcontroller. It is mainly popular because of availability of almost all microcontrollers in it.This software combines mixed mode circuit simulation, micro-processor models and interactive component models to allow the simulation of complete micro-controller based designs. Proteus provides the means to enter the design in the first place, the architecture for real time interactive simulation and a system for managing the source and object code associated with each project. In addition, a number of graph objects can be placed on the schematic to enable conventional time, frequency and swept variable simulation to be performed. 3.1.2 ExpressPCB: ExpressPCB is a simple to use PCB layout packager aimed at the first time user and designer. ExpressPCB offers a schematic capture program that integrates with their PCB layout software. The schematic and layout files can be linked to automatically carry changes forward. ExpressPCB is meant to be used with the ExpressPCB PCB manufacturing service and does not support outputting to standard formats directly. ExpressPCB offers a file conversion service for a fee if standard outputs are required.

3.2 3.2.1

Hardware Atmega16 Microcontroller:

Fig 3.1: Pin Diagram of Atmega16 Microcontroller

ATmega16 is an 8-bit high performance microcontroller of Atmels Mega AVR family with low power consumption. Atmega16 is based on enhanced RISC architecture with 131 powerful instructions.. Atmega16 can work on a maximum frequency of 16MHz. ATmega16 has 16 KB programmable flash memory, static RAM of 1 KB and EEPROM of 512 Bytes. ATmega16 is a 40 pin microcontroller. There are 32 I/O (input/output) lines which are divided into four 8-bit ports designated as PORTA, PORTB, PORTC and PORTD. ATmega16 has various in-built peripherals like USART, ADC, Analog Comparator, SPI, JTAG etc. Each I/O pin has an alternative task related to in-built peripherals.
8

Advanced Features of Atmega16 Microcontroller: Up to 16 MIPS Throughput at 16 MHz 16K Bytes of In-System Self-Programmable Flash 512 Bytes EEPROM 1K Byte Internal SRAM 32 Programmable I/O Lines In-System Programming by On-chip Boot Program 8-channel, 10-bit ADC Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Four PWM Channels Programmable Serial USART Master/Slave SPI Serial Interface Byte-oriented Two-wire Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator External and Internal Interrupt Sources

The following table shows the pin description of ATmega16:

Pin no. Pin name 1 (XCK/T0) PB0 2 3 (T1) PB1 (INT2/AIN0) PB2 4 (OC0/AIN1) PB3

Description I/O PORTB, Pin 0

Alternate Function T0: Timer0 External Counter Input. XCK : USART External Clock I/O

I/O PORTB, Pin 1 I/O PORTB, Pin 2

T1:Timer1 External Counter Input AIN0: Analog Comparator Positive I/P INT2: External Interrupt 2 Input

I/O PORTB, Pin 3

AIN1: Analog Comparator Negative I/P OC0 : Timer0 Output Compare Match Output

5 6 7 8 9

(SS) PB4 (MOSI) PB5 (MISO) PB6 (SCK) PB7 RESET

I/O PORTB, Pin 4 I/O PORTB, Pin 5 I/O PORTB, Pin 6 I/O PORTB, Pin 7 Reset Pin, Active Low Reset

In System Programmer (ISP) Serial Peripheral Interface (SPI)

10 11 12 13 14 15 16 17 18 19 20 21

Vcc GND XTAL2 XTAL1 (RXD) PD0 (TXD) PD1 (INT0) PD2 (INT1) PD3 (OC1B) PD4 (OC1A) PD5 (ICP) PD6 PD7 (OC2)

Vcc = +5V GROUND Output to Inverting Oscillator Amplifier Input to Inverting Oscillator Amplifier I/O PORTD, Pin 0 I/O PORTD, Pin 1 I/O PORTD, Pin 2 I/O PORTD, Pin 3 I/O PORTD, Pin 4 I/O PORTD, Pin 5 I/O PORTD, Pin 6 I/O PORTD, Pin 7 PWM Channel Outputs Timer/Counter1 Input Capture Pin Timer/Counter2 Output Compare Match Output USART Serial Communication Interface External Interrupt INT0 External Interrupt INT1

10

22 23 24 25 26 27 28

PC0 (SCL) PC1 (SDA) PC2 (TCK) PC3 (TMS) PC4 (TDO) PC5 (TDI) PC6 (TOSC1)

I/O PORTC, Pin 0 I/O PORTC, Pin 1 I/O PORTC, Pin 2 I/O PORTC, Pin 3 I/O PORTC, Pin 4 I/O PORTC, Pin 5 I/O PORTC, Pin 6 Timer Oscillator Pin 1 JTAG Interface TWI Interface

29

PC7 (TOSC2)

I/O PORTC, Pin 7

Timer Oscillator Pin 2

30 31 32 33 34 35 36 37 38 39 40

AVcc GND AREF PA7 (ADC7) PA6 (ADC6) PA5 (ADC5) PA4 (ADC4) PA3 (ADC3) PA2 (ADC2) PA1 (ADC1) PA0 (ADC0)

Voltage Supply = Vcc for ADC GROUND Analog Reference Pin for ADC I/O PORTA, Pin 7 I/O PORTA, Pin 6 I/O PORTA, Pin 5 I/O PORTA, Pin 4 I/O PORTA, Pin 3 I/O PORTA, Pin 2 I/O PORTA, Pin 1 I/O PORTA, Pin 0 ADC Channel 7 ADC Channel 6 ADC Channel 5 ADC Channel 4 ADC Channel 3 ADC Channel 2 ADC Channel 1 ADC Channel 0

Fig 3.2: Pin Description of Atmega16 Microcontroller

11

3.2.2

Temperature Sensor LM35:

The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of 14C at room temperature and 34C over a full 55 to +150C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35s low output impedance, linear output, and precise inherent calibration make Interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very low self-heating, less than 0.1C in still air. The LM35 is rated to operate over a 55 to +150C temperature range, while the LM35C is rated for a 40 to +110C range (10with improved accuracy).

LM35 Pin Diagram:

+Vcc 1 Output 2 GND 3

Fig. 3.3 LM35 Pin Diagram

12

3.2.3

LCD JHD162A

LCD is based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16 characters each. It can display all the letters of alphabet, Greek letters, punctuation marks, mathematical symbols etc on a miniature liquid crystal display. It is also possible to display symbols made up by the user. Other useful features include automatic message shift (left and right), cursor appearance, LED backlight etc. An LCD (Liquid Crystal Display) basically works on the concept of Light Polarization of a Liquid Crystal under the influence of an Electric Field. Every LCD contains a Back-Light behind the Liquid Crystal array, which acts as a light source. When an Electric Field is applied across certain fluids, it changes the way they allow light to pass through them, that is, it changes the orientation of the liquid crystal molecules as a result they do not allow light to pass through them. Hence, by applying suitable potential difference, we can control if light passes or doesnt pass through the LCD pixels.

Fig 3.3: Pin Diagram of LCD

13

Pin Description of JHD162A: LCD Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Symbol Vss Vdd Vo RS R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 1 15 Function Signal Ground (GND) Vcc for LCD Contrast Adjust Register Select Signal Read/Write Select Signal Enable Signal Four low oder bidirectional three-state data bus lines . These four are not used if 4bit interface used. Four low oder bidirectional three-state data bus lines . These four are not used if 4bit interface used LED (K) LED (A) External connection External ground (Power section) Power supply for logic (+5v) Externally connected potentiometer To micro-controller control pins To micro-controller control pins To micro-controller control pins To micro-controller data pins To micro-controller data pins To micro-controller data pins To micro-controller data pins To micro-controller data pins To micro-controller data pins To micro-controller data pins To micro-controller data pins Back light LED cathode terminal Back light LED cathode terminal

Fig 3.4: Pin Description of LCD

14

3.2.4

Motor Drive IC L293D

Fig. 3.5: Pin Diagram of L293D

Pin Diagram shows that L293D consists of four inputs (A), which accepts TTL logic voltage level and four outputs (Y) that gives VCC2 Voltage. That allows L293D to be used as two "reversible" output or four "one-way" outputs. There are two more TTL inputs (EN), which stands for enable. This means that pin 1 (1,2EN) enables outputs 1Y and 2Y. Without pin 1 set to logical 1, the outputs will remain inactive. The enable inputs are usually hooked to +5V to be set still. In "motor driving" applications, enable inputs are called slow stop and it's used for speed control. Switching from logical 1 to logical 0 causes motor to rotate according to the switching interval.

15

Pin configuration of L293D Pin no. 1 2 3 4 5 6 7 8 Function Enable pin for motor 1; active high Input 1 for motor 1 Output 1 for motor 1 Ground (0v) Ground (0V) Output 2 for motor 1 Input 2 for motor 1 Supply Voltage for motors; 912V(upto 36V) 9 10 11 12 13 14 15 16 Enable pin for motor 2; active high Input 1 for motor 1 Output 1 for motor 1 Ground (0V) Ground (0V) Output 2 for motor 1 Input 2 for motor 1 Supply voltage; 5V(upto 36V) Enable 3,4 Input 3 Output 3 Ground Ground Output 4 Input 4 Vcc1 Name Enable 1,2 Input 1 Output 1 Ground Ground Output 2 Input 2 Vcc 2

Fig. 3.6: Pin Configuration of L293D

16

3.2.5

Optocoupler

Fig. 3.7: Pin Diagram of Optocoupler

Optocouplers (MOCs) are used to transmit signals between circuits that do not share a power source.MOCs have a LED and a sensor inside. If the LED is turned on, it activates the sensor and lets the current flow. This circuit is used to isolate signal circuitry from transients generated or transmitted by power supply and high-current control circuits. An optocoupler, also known as optoisolator, is a component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal.

17

3.2.6

Power Supply

Fig. 3.8: Circuit Diagram of Power Supply

The ATMEGA16 requires a regulated 5 volt supply voltage. The 7805 voltage regulator is used to provide for that. The 7805 takes in a voltage between 7 and 30 volts and regulates it down to exactly 5 volts. The first capacitor takes out any ripple coming from the transformer so that the 7805 is receiving a smooth input voltage, and the second capacitor acts as a load balancer to ensure consistent output from the 7805. The 7805 has three leads. If we look at the 7805 from the front (the side with printing on it), the three leads are, from left to right, input voltage (7 to 30 volts), ground, and output voltage (5 volts).

18

3.2.7

Triac

A triac is basically a bidirectional electronic switch, which can conduct current in either directionwhen it is triggered. The triggering can be either a positive or negative voltage applied to its gateelectrode. By applying a steady state gate signal, the triac may be triggered into a low impedancestate where conduction across the main terminals will occur. The gate signal polarity need notfollow the main terminal polarity. Gate requirement vary depending on the direction of the mainterminal current and the gate current.

Fig. 3.9: Symbol & Pin Diagram of Triac

Pin 1: Main Terminal 1 Pin 2: Main Terminal 2 Pin 3: Gate

19

3.2.8

Printed Circuit Board

A printed circuit board, or PCB, is used to mechanically support and electrically connect electronic components using conductive pathways, tracks or signal

traces etched from copper sheets laminated onto a non-conductive substrate. When the board has only copper tracks and features, and no circuit elements such as capacitors, resistors or active devices have been manufactured into the actual substrate of the board, it is more correctly referred to as printed wiring board (PWB) or etched wiring board. Use of the term PWB or printed wiring board although more accurate and distinct from what would be known as a true printed circuit board, has generally fallen by the wayside for many people as the distinction between circuit and wiring has become blurred. Today printed wiring (circuit) boards are used in virtually all but the simplest commercially produced electronic devices, and allow fully automated assembly processes that were not possible or practical in earlier era tag type circuit assembly processes.

20

Chapter 4: METHOD

4.1 Block Diagram:

Fig. 4.1: Block Diagram of Project

21

4.2

Circuit Diagram:

Fig. 4.2: Circuit Diagram of Project

22

4.3

Working: The circuit maintains the temperature of the system below a particular value. A fan is

used for controlling the temperature of the system. The fan RPM increases with increase in temperature and vice versa. The current temperature within the greenhouse is measured by using a temperature sensor. When the current temperature is above the set maximum temperature, the system is cooled by using a fan. When the current temperature is below the set maximum temperature, no control action is needed. The current temperature of the room is continuously displayed on the LCD. This makes user aware of current temperature of the system. The Temperature Sensor detects the temperature of the system. The Temperature Sensor consists of an LM35 IC. The temperature sensor is connected to the ADC input of the microcontroller. It converts the analog input to a digital value. The microcontroller generates the corresponding PWM value according to the sensed temperature. If using AC motor as the load, we use an optocoupler to isolate the 230V circuit from the microcontroller circuit.The switching device (triac) is connected to the microcontroller through the optocoupler. The firing angle of triac is changed according to the PWM value of the microcontroller; hence, changing the speed of the fan.When using DC motor as load, the PWM generated output control signals are sent to the Motor Driver IC L293D. Motor Driver IC L293D is fed with the PWM generated output from microcontroller. The speed of the fan is controlled by the ON time of the PWM generated by the controller. With increasing ON time, the speed of the fan reduces the temperature of the system. The LCD module is also connected to the microcontroller. The LCD module displays the currenttemperature and PWM value in terms of percentage.

23

4.4 Algorithm:

1. Initialize Ports & LCD. 2. Sense temperature. 3. Display temperature on LCD with corresponding PWM. 4. If temperature<28C Then PWM=0 Motor OFF 5. If 28 C<temperature< 38C Then PWM=31 Motor ON and run at low speed 6. If temperature>38 C Then PWM=98 Motor ON and run at full speed 7. Goto step 2

24

4.5

Program:

#define F_CPU

8000000UL

#include <util/delay.h> #include <avr/io.h> #include <string.h> #include <avr/interrupt.h> /*Global Variables Declarations*/ /*LCD function declarations */ voidLCD_send_command(unsigned char cmnd); voidLCD_send_data(unsigned char data); voidLCD_init(); voidLCD_goto(unsigned char y, unsigned char x); voidLCD_print(char *string); void Convert1(unsigned int value); void Convert(unsigned int value); voidbin_to_ascii_two(unsigned char); voidInitPWM(); #define LCD_DATA_PORT PORTC #define LCD_DATA_DDR DDRC #define LCD_DATA_PIN PINC PORTD

#define LCD_CNTRL_PORT #define LCD_CNTRL_DDR DDRD #define LCD_CNTRL_PIN PIND #define LCD_RS_PIN6 #define LCD_RW_PIN5 #define LCD_ENABLE_PIN 4 #define FREQ 8000000 #define prescaler 8

unsigned int Count=0;//,d1,d2,d3,d4,x1,x2,x3,x4; void main(void) { unsignedinti,brightness,tempC,display; DDRC=0xff; DDRD=0xf0;


25

LCD_init(); InitPWM(); LCD_goto(1,1); LCD_print("COT PANTNAGAR"); LCD_goto(2,8); LCD_print("Temp:"); LCD_goto(2,1); LCD_print("PWM:"); DDRA = 0x00; while(1) { ADCSRA = 0x97; // Enable the ADC and its interrupt feature // and set the ACD clock pre-scalar to clk/128 ADMUX = 0xE0; // Select internal 2.56V as Vref, left justify // data registers and select ADC0 as input channel ADCSRA |= (1<<ADSC); while(!(ADCSRA & (1<<ADIF))); tempC = ADCH; LCD_goto(2,13); itoa(tempC/10,display,10); LCD_print(display); itoa(tempC%10,display,10); LCD_print(display); LCD_send_data(0xDF); LCD_print("C"); //bin_to_ascii_two(((brightness*100)/256)+1); bin_to_ascii_two(((255-brightness)*100)/255);//*100); // Output ADCH to PortD // Configure PortA as input

if(tempC<=27)// &&tempC<=30) { for(brightness=0;brightness<250;brightness++) { SetPWMOutput(brightness); }


26

if(tempC>=28 &&tempC<=37) { for(brightness=0;brightness<175;brightness++) {

SetPWMOutput(brightness); } } if(tempC>=38) {

for(brightness=0;brightness<5;brightness++) //5 { SetPWMOutput(brightness); } } } }

/* This function sends a command 'cmnd' to the LCD module*/ voidLCD_send_command(unsigned char cmnd) { LCD_DATA_PORT = cmnd; LCD_CNTRL_PORT &= ~(1<<LCD_RW_PIN); LCD_CNTRL_PORT &= ~(1<<LCD_RS_PIN);

LCD_CNTRL_PORT |= (1<<LCD_ENABLE_PIN); _delay_us(2); LCD_CNTRL_PORT &= ~(1<<LCD_ENABLE_PIN); _delay_us(100); } /* This function sends the data 'data' to the LCD module*/ voidLCD_send_data(unsigned char data) { LCD_DATA_PORT = data; LCD_CNTRL_PORT &= ~(1<<LCD_RW_PIN); LCD_CNTRL_PORT |= (1<<LCD_RS_PIN);

27

LCD_CNTRL_PORT |= (1<<LCD_ENABLE_PIN); _delay_us(2); LCD_CNTRL_PORT &= ~(1<<LCD_ENABLE_PIN); _delay_us(100); }

voidLCD_init() { LCD_send_command(0x38); LCD_send_command(0x0C); LCD_send_command(0x01); _delay_ms(10); LCD_send_command(0x06); } /* This function moves the cursor the line y column x on the LCD module*/ voidLCD_goto(unsigned char y, unsigned char x) { unsigned char firstAddress[] = {0x80,0xC0,0x94,0xD4}; LCD_send_command(firstAddress[y-1] + x-1); _delay_ms(10); }

voidLCD_print(char *string) { unsigned char i=0;

while(string[i]!=0) { LCD_send_data(string[i]); i++; }} voidbin_to_ascii_two(unsigned char binbyte) {unsigned char adc_out1; char i=0; char position=0xC5;
28

for(i=0;i<=1;i++) { adc_out1= binbyte %10; binbyte=binbyte/10; LCD_send_command(position); LCD_send_data(48+adc_out1); _delay_ms(10); position--; } }voidSetPWMOutput(uint8_t duty) { OCR2=duty; } void Wait() { _delay_loop_2(3200); }voidInitPWM() { TCCR2=0x75; //Set OC0 PIN as output. It is PB3 on ATmega16 ATmega32

DDRD|=(1<<PD7); }

29

4.6

PCB Design:

Fig. 4.3: PCB Circuit Layout

30

Chapter 5: Results

Fig. 5.1: Waveform at 25 C

The results at 25 C(<28 C) were obtained as given above with PWM=1. These were matching with those obtained on the model. At this temperature, the fan was OFF.

31

Fig. 5.2: Waveform at 30 C

The results at 30 C(28 C< temperature < 38 C) were obtained as given above with PWM=31. These were matching with those obtained on the model. At this temperature, the motor was ON and working at low speed.

32

Fig. 5.3: Waveform at 40 C

The results at 40 C(38 C< temperature ) were obtained as given above with PWM=98. These were matching with those obtained on the model. At this temperature, the motor was ON and working at full speed.

33

Chapter 6: Conclusion As displayed in the results, the prototype was successful in implementing the aims of the project. The project model provides with a low-cost automatic temperature control system. The project was successful in automatically controlling and regulating the speed of Induction Motor according to the current temperature of the surroundings thereby increasing the air flow rate and bringing about a resultant decrease in temperature. It was aimed at designing an integrated low cost solution that can be easily installed in external environments of Polyhouses/Greenhouses and to remove the need for manual control of the ventilation system, which it effectively proves to do.

34

Chapter 7: Future Scope

1. By replacing the temperature sensor with pressure sensor, we can use it in furnaces. When large quantities of metal enters the furnace, the pressure sensor would sense the additional weight and would run the furnace at higher output, thereby increasing efficiency by saving energy in idle stages and reducing running costs. 2. It can be used in various industrial applications such as to control the temperature in boilers. 3. It can be used in various industrial applications such as to control the temperature in Refrigerators and Air Conditioners as air flow control component. 4. By replacing the fan with a heater and reversing the programming logic, it can be used to maintain temperatures in a narrow range in incubation centres and scientific laboratories.

35

References Maizidi Ali, MekinlyRolin D &CarseyDenny , Microcontroller & Embedded System, Pearson Education, 2nd Edition. 8051 Microcontroller and Application, 2nd Edition, Chris Braithwaite, Fred Cowan and HasanParchizadeh. Prentice Hall Inc. New Delhi India, 2001. Embedded System, Raj Kamal, 3rd Edition, Tata McGraw Hill

Electrical Machinery Fundamentals, S. J. Chapman, McGraw Hill, 2005

http://www.datasheetscatalog.com

36

You might also like