Tuesday, October 18, 2011

Control temperature using LM 35 & 16F877

Description:
i want to make this project for our factory
the objective of this project is to control the temperature of room servers  ; through to set the value of temperature wanted. and let the microcontroller take a decision to switch on or off the fan

How This Project Work :
the temperature is testing by LM35 sensor is given the voltage proportional with the temperature tested; then the microcontroller 16f877 will make compare between the temperature tested and the temperature wanted which will set manually by push-button, after that the pic 16f877 will take decision to start fan and display the  result on lcd at every time the value change it
i will using mikroc program to programming pic 16f877

The Components Need :
pic 16f877
temperature sonsor LM35
lcd 16x2
transistor
relays
resistor
dc power adaptor

Parts Discription
lm 35 sensor


LM 35 is a precision tempreature sensor . This is a small 3 pin IC in TO-92 package remember this is an IC .Its centre pin is output and outher tow are power .The LM35 measures temperature in centigrade .Output  of LM35 IS analog ,uniformly linear over the entire range .It rises by 10.0mV/centigrade .This IC does not require external calibration or trimming .various variants of this commnly used sensore ICare available,which differ in the range of measured temperature.

LCD 16X2 Character
LCDs are becoming more and more popular in electronic devices to communicate with user,there several LCD controllers , each having its own unique communication protocol. hitachI HD 44780 is very popular and industry standard LCD communication controller,this controller is built right on to the LCD modul .Many highlevel programming language provide ready to use libraries for communication with this device .
Transistor :
Most ICs cantnot supply large output currents so it may be necessary to use a transistor to switch the larger current required for output devices such as lmaps ,motors , relays
Atransistor can also be used to enable an IC connected to law voltage supply (5v ) to  switch  the current for an output device with a separte a higher voltage supply (12) . the two power supplies must be linked , normally this is done by linking thier 0V connections
Relays :
Using relays when we face more current flow and cannot transistor to support this current (10Aor more)that's why i prefer to use relays in my projects i know the time of responding is slow than transistor it's around (ms) but transistor around (us) .
The Microcontroller :
Although microcontrollers were being developed since early 1970's real boom came in mind 1990's, A company named Microship  made it's first simple microcontroller ,which they called PIC .Originally this was developed as a supporting device for PDP computers to control it's peripheral devices ,and therefore named as PIC, Peripheral interface Controller.thus all the chips developed by Microship have been named as a class by themselves and called PIC.
Microcontroller Core Features :

• High performance RISC CPU 
• Only 35 single word instructions to learn
• All single cycle instructions except for program
branches which are two cycle
• Operating speed: DC - 20 MHz clock input
DC - 200 ns instruction cycle
• Up to 8K x 14 words of FLASH Program Memory,
Up to 368 x 8 bytes of Data Memory (RAM)
Up to 256 x 8 bytes of EEPROM Data Memory
• Pinout compatible to the PIC16C73B/74B/76/77
• Interrupt capability (up to 14 sources)
• Eight level deep hardware stack
• Direct, indirect and relative addressing modes
• Power-on Reset (POR)
• Power-up Timer (PWRT) and
Oscillator Start-up Timer (OST)
• Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
• Programmable code protection
• Power saving SLEEP mode
• Selectable oscillator options
• Low power, high speed CMOS FLASH/EEPROM
technology
• Fully static design
• In-Circuit Serial Programming(ICSP) via two
pins
• Single 5V In-Circuit Serial Programming capability
• In-Circuit Debugging via two pins
• Processor read/write access to program memory
• Wide operating voltage range: 2.0V to 5.5V
• High Sink/Source Current: 25 mA
• Commercial, Industrial and Extended temperature
ranges
• Low-power consumption:
- < 0.6 mA typical @ 3V, 4 MHz
- 20 ìA typical @ 3V, 32 kHz
- < 1 ìA typical standby current
THE  ANALOG /DIGITAL CONVERTER using MIKROC PROGRAM
The converter generates a 10-bit binary result using the method of successive approximation and stores the conversion results into the ADC registers (ADRESL and ADRESH )


Circuit Diagram :


 for more information about code contact me :
zouhair_charaf@yahoo.com

No comments: