HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAININGProject on MicroprocessorThe meter monitors the temperature and starts the cooling systemAdvisor
Introduction
The practical problems
The concept of temperature measurement has been around for a long time, of all the physical quantities, temperature is the most interested Temperature is a factor that directly affects the properties of matter and the environment In the abalone mushroom industry and the field of measurement and control, temperature measurement and result processing play an important role.
Today, industry and agriculture thrive, temperature monitoring plays a very important role in engineering because the device makes monitoring temperature, humidity, time easily and conveniently Industry standard equipment with high stability and accuracy.
Therefore, in the microprocessor of the Faculty of High-Quality Training- Ho ChiMinh University of Technology and Education and the guidance of Mr NguyenThanh Nghia, our group learned about: The meter monitors the temperature and starts the cooling system
The aim of the topic
Monitor temperature and start the cooling system correctly
Specific goals are as follows:
Overview description of temperature monitoring meter and cooling system startup
Detailed explanation of each electronic component
Build a temperature monitoring system and start it up by programming Construction, control and supervision of the system test and evaluate the results
Object and scope of the study
The object of research is a temperature monitoring clock system built by electronic components such as: PIC16F887, CAPACITOR, led segment, IC LM7805,temperature sensor (LM35), RESISTOR,…
The advantage of meter monitors the temperature and starts the cooling system
A temperature meter is an electronic device with a display used to measure temperature and humidity in many different environments This is also a necessary and important device in today's life.
Used to monitor the temperature in rooms, workplaces, companies or buildings
Digital display type: can be tracked even in low light areas, high accuracy, reliable operation
Research content
Chapter 2: Theoretical foundations of system operation
Chapter 3: Perform monitoring, operate the temperature monitoring meter and start the cooling system
Theoretical foundations of system operation
Working principle of the system
With a conventional needle display type, the temperature sensor part is a bimetallic piece (2 pieces of temperature-sensitive metal joined together) When the bimetallic piece is exposed to heat, it will cause non-uniform expansion between the two pieces of metal, leading to the warping of the bimetallic piece Depending on the high and low temperature, this bimetallic piece will bend more or less, when the degree through the transmission mechanism rotates the clockwise, the manufacturer's calculation will indicate the exact temperature.
With the digital display type, the returned thermal signal is a voltage(thermocouple, also known as a thermocouple), the input voltage changes based on the changing temperature Or according to the change of resistance (can PT, akaRTD), the resistance changes with temperature The signal is returned to the signal processor and then displays the exact temperature of the area to be measured
Category
Needle display type and digital display type.
Specifications
- Mounting type, mounting dimensions (diameter, length, thread type)
Note
- If high accuracy is required, stable operation should choose digital display type
- Application: commonly used in steel, engineering, technology, beverage, textile, food, chemical
Introduction to electronic components
PIC16F887 is a microcontroller chip manufactured by Microchip in the Pic family PIC16F887 is an 8-bit microcontroller based on RISC architecture 8KB ISP flash program memory that can be written and erased thousands of times, 256B EEPROM, a huge amount of RAM in the world of 8-bit processors (368B SRAM)
With 33 pins usable for I/O connections, 32 registers, 3 programmable timers/counters, internal and external interrupts (2 instructions per interrupt vector), transmission protocol USART, SPI, I2C serial communication In addition, a 10-bit analog-digital converter (ADC/DAC) can be used up to 11 channels, programmable watchdog timer, operation with 5 power modes, up to 2 modulation channels can be used pulse width (PWM)……
Figure 2.1 PIC16F887 b Specifications of PIC16F887
Connectivity I²C, SPI, UART / USART, USB
Peripherals Brown-out Detect/ Reset, HLVD, POR,
Package / Case 40-SOIC (0.295″, 7.50mm Width)
Table 2.1 Specifications of PIC16F887 c Pinout of PIC16F877
Figure 2.2 Pinout of PIC16F877 d Responsibilities of each component numerical order name Describe
1 MCLR / Vpp MCLR is used during programming, mainly connected to a programmer like PicKit
2 RA0 / AN0 Analog pin 0 or pin 0 of
3 RA1 / AN1 Analog pin 1 or pin 1 of
4 RA2 / AN2 / Vref- Analog pin 2 or pin 2 of
5 RA3 / AN3 / Vref + Analog pin 3 or pin 3 of
6 RA4 / T0CKI / C1out Pin 4 of PORTA
7 RA5/AN4/SS/C2out Analog pin 4 or pin 5 of
8 RE0 / RD / AN5 Analog pin 5 or pin 0 of
9 RE1 / WR / AN6 Analog pin 6 or pin 1 of
10 RE2/CS/AN7 Pin 7 of PORTE
11 Vdd Ground pin of MCU
12 Vss Positive pin of MCU
13 OSC1 / CLKI External oscillator / clock input pin
14 OSC2 / CLKO External oscillator / clock input pin
15 RC0 / T1OSO / T1CKI Pin 0 of PORT C
16 RC1 / T1OSI / CCP2 POCTC pin 1 or
17 RC2 / CCP1 POCTC pin 2 or
18 RC3 / SCK / SCL Pin 3 of POCTC
19 RD0 / PSP0 Pin 0 of POCTD
20 RD1 / PSPI Pin 1 of POCTD
21 RD2 / PSP2 Pin 2 of POCTD
22 RD3 / PSP3 Pin 3 of POCTD
23 RC4 / SDI / SDA POCTC pin 4 or Serial
24 RC5 / SDO Pin 5 of POCTC or Serial
25 RC6 / Tx / CK 6th pin of POCTC or emitter of Microcontroller receiver pin of Microcontroller
27 RD4 / PSP4 Pin 4 of POCTD
28 RD5/PSP5 Pin 5 of POCTD
29 RD6/PSP6 Pin 6 of POCTD
30 RD7/PSP7 Pin 7 of POCTD
31 Vss Positive pin of MCU
32 Vdd Ground pin of MCU
33 RB0/INT POCTB pin 0 or external interrupt pin
34 RB1 1st pin of POCTB
35 RB2 2nd pin of POCTB
36 RB3/PGM 3rd pin of POCTB or connect to programmer
37 RB4 4th pin of POCTB
38 RB5 5th pin of POCTB
39 RB6/PGC POCTB 6th pin or connect to programmer
40 RB7/PGD POCTB 7th pin or connect to programmer Table 2.2 Duty each pin of PIC16F887
The LM35 is a widely used temperature sensor It shows the values as output voltage instead of degrees Celsius.
A temperature sensor is a thermocouple – an electrical device consisting of two dissimilar electrical conductors that form electrical junctions at different temperatures, or a resistance temperature detector (RTD) that measures heat from a source concrete and transform the information gathered into a structured form
Temperature sensors are commonly used in HV systems and AC environmental control systems, medical equipment, food handling sensors, chemical processing, automotive control systems, etc.
Figure 2.3 Temperature sensor b Features of temperature sensor IC LM35
- The minimum and maximum input voltages are 35V and -2V respectively. Typical is 5V.
- Can measure temperatures from -55°C to 150°C.
- The output voltage is (linearly) proportional to temperature i.e there will be a 10mV (0.01V) increase for every 1°C rise in temperature.
- Small and therefore suitable for remote applications c Pinout of LM35
Number of Pins Name Describe
1 Vcc Input voltage is +5V for typical applications
2 Analog output increase by 10 mV for every 1°C increase Can range from -1V (-55°C) to 6V (150°C)
3 Ground (GND) Connect the ground of the circuit
LM7805 or 7805 is a 5V output voltage regulator IC It is LM78xx series positive
TO-92, Dpark, TO-03 IC 7805 is widely used in commercial and educational equipment as a good device to power the TTL family of digital integrated circuits It is also used by many electronics enthusiasts and mechanics due to its low cost, ease of use and lack of external components The IC has many built-in features that are ideal for use in many electronic applications such as 1.5A output current, overload protection, over temperature protection, low static current, etc.
Figure 2.4 IC LM7805 b Features of IC LM7805
- Instant short circuit shutdown function
- Reliable for use in commercial devices
- Minimum input voltage to provide 5V output: 7.3V below 7.3V chip may not provide stable 5 volts.
- Low static current only 8mA c Pinout of LM7805
Number of Pins Name Describe
1 input Input maximum voltage is 35V
2 Ground Connect the ground of the circuit
The main advantage of light emitting diodes is that because of their small die size, several of them can be connected together within one small and compact package producing what is generally called a 7-segment Display.
Each of the seven LEDs is called a segment because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be displayed. Each one of the seven LEDs in the display is given a positional segment with one of its connection pins being brought straight out of the rectangular plastic package. These individually LED pins are labelled from a through to g representing each individual LED The other LED pins are connected together and wired to form a common pin.
This display has nothing more than 8 LED inside it These 8 LEDs are separated into each segments which can be named as a, b, c, d, e, f, g, DP as shown in the picture above
Figure 2.5 7-Segnment Led b Seven segment led structure
Table 2.5 Seven segment led structure
A relay is an electromagnetic switch operated by a relatively small current that can turn a much larger current on or off The heart of the relay is an electromagnet (a coil of wire that becomes a temporary magnet when current flows through it). The relay has two states on and off whether the current flows through the relay suction coil or not. b Structure of relay
The relay terminals are usually denoted COM, NC and NO:
- COM (common): is a common pin, it is always connected to 1 of the other 2 pins.
As for which pin it is connected to, it depends on the operating state of the relay.
- NC (Normally Closed): Normally Closed When the relay is in the OFF state, the COM pin will be connected to this pin.
- NO (Normally Open): Normally Open When the relay is in the ON state (with current flowing through the coil), the COM pin will be connected to this pin.
Figure 2.6 Relay c Features of relay
- This parameter is quite important because it will determine whether your relay can be used or not For example, you need a relay module that will turn on and off a light bulb with a voltage of 220V when it is dark from a light sensor operating at 5 -12V. Maximum voltage and amperage:
- These are the parameters showing the maximum current as well as voltage of the devices that you want to switch on/off that can be wired to the relay.
- 10A – 250VAC: the maximum amperage through the relay contacts is 10A with a voltage of 250VAC
- 10A – 30VDC: the maximum amperage through the relay contacts is 10A with a voltage of 30VDC
Transistor A1015 is a PNP type bipolar transistor electronic device The A1015 is manufactured in a TO-92 plastic case.
The A1015 is a good quality low cost PNP transistor, designed primarily for use as an audio amplifier or in audio amplifier stages The collector-to-emitter voltage of the transistor is 50V so it can easily be used in circuits operating below 50V For good performance, this transistor should be used in circuits operating below 40V DC The maximum power dissipation of the transistor is 400mW and the maximum DC current amplification is 400, so this transistor is suitable for amplifying small sounds. Furthermore it can also be used as a switch and it can handle 150mA load. b Feature of A1015
Direct current gain (hfe) - 70 to 400
Operating and storage temperature range: -55 to +125°C
It is designed to amplify audio frequencies and high frequency OSCs The transistor's collector base voltage is 50V so it can easily be used in circuits that use less than 50V DC The collector current of the transistor is 150mA so it can drive any load below the 150mA limit The power dissipation of the collector and the DC current gain of the transistor are quite good as it is ideal for use in audio amplification and electronic signal amplification In addition, it can also be used as a switch to control loads below 150mA
Transistor C1815 can be used in audio amplification stages, small sound amplification (if used to drive small loudspeakers), preamplifier and also in preamplifier stages It can also be used as a switch in electronic circuits to control loads below 150mA, for example to control relays, other high power transistors, low power LEDs and other parts of electronic circuits, … It can also be used to create darlington pairs. b Feature of C1815
- Maximum current IC kit (I ): 150mAc
- Collector-Emitter peak voltage (V ): 50Vce
- Collector-Base peak voltage (V ): 60Vcb
- Max Collector Dissemination (Pc): 400 mW
- Minimum and maximum DC current gain (h ): 70 – 700fe
- Maximum storage and operating temperature should be: -55 to +150 C 0
Perform monitoring, operate the temperature monitoring meter and
Problem solving
3.1.1 Block diagram of the system
Sensor block a The operation of system
The system works by: data will be processed through IC 16F887 and displayed on the seven segment led, temperature sensor is used to monitor and customize the appropriate temperature and the relay block will active the motor. b Detailed diagram
Figure 3.1 Detailed diagram of system
We will supply the input voltage through J1 (corresponding to the positive and negative pins) and the 5V voltage at the output will be taken through C5 pin. Capacitors C1 filter the input voltage to the Vi pin of IC 7805, capacitor C1 is a has the effect of preventing the input source from suddenly increasing pressure, causing the input voltage waveform to have a sawtooth shape.
Capacitors C5 filter the voltage supplied to the load are taken from the Vo pin of
IC 7805, capacitor C5 has a large impedance, C5 has the effect of filtering output voltage noise (noise is unwanted voltages that make the output voltage waveform look jagged). b Display block
The LED scanning technique takes advantage of the limitations of the human eye in capturing images Through the human eye, the sequence of images would be continuous if it were viewed at 24 frames per second.
The display block consists of 6 7-segment LEDs combined to display numbers.Common Anode 7-segment LED Use transistor A1015 to scan 7-segment led.
Figure 3.3 Display block c Relay block
You can use relays with digital circuits Use pulse output from microcontroller or digital ICs To control the relay to work But for the most part, its output is low current So we need to use a transistor to convert to high current to drive the coil.
We already know in the electronic literature that basic transistors have amplification properties We will consider Transistor operating in saturation mode, working at full capacity.
The working principle is as follows:
- When the input is level 0 (V =0V), Q1 will not lead because there is no I line >>BE
- When the input as level 1 (V = 5V), it will pass through R to limit the current, now we have I current flowing through the coil, relay closes normally open contactce
- The diode D1 in the circuit has the effect of resisting the induced current caused by the coil, which damages the transistor.
You can calculate the resistance R from the input voltage and current For example, the input voltage is 5V, the current is about 1 mA.
Therefore, you can calculate R as follows:
Vin = 5V, VBE of transistor is about 0.7V, I = 1 mAin
Therefore, we should choose R = 4,7 K This is the standard value.
VBE is the voltage across terminals B and E of the transistor.
Figure 3.4 Relay block d Processing block
Figure 3.5 Processing block The microcontroller block uses the Pic16F877A microcontroller, it closes a very important role in the system to control the system.
Storage passwords via EEPROM memory can be stored immediately in the event of a power failure All the data that we design to control the digital locking system is stored in the memory of the microcontroller.
Construction and results
Proteus is a toolkit specializing in electronic circuit simulation This is software from Labcenter Electronics, it simulates most of the components common electronics. Thus Proteus can be made and Test run simple as well as complex machines, so you can use it in teaching, in electronics laboratories as well as in practice processor. Proteus is free software with open source code used widely used in teaching and learning.
3.3.2 Communication control software (CCS C Compiler)
Figure 3.7 Software interface of CCS C Compiler
3.3.3 Draw the principle diagram; run simulation on software
3 When the system works with the LM35 temperature sensor, the system will monitor the temperature and the sensor will adjust the temperature accordingly.
Table 3.1 Run simulation on Proteus software
From the principle circuit, arrange the components to create a compact and aesthetic circuit for easy circuit construction.
Figure 3.8 Circuit layout After arranging the components, we proceed to test the 3D circuit
Figure 3.9 3D simulation circuit front panel
Figure 3.10 3D simulation circuit rear panel
Hardware construction
After completing the steps get the circuit:
Figure 3.11 Circuit after construction - front view
1 The circuit works, but the number displayed on the 7- segment led is wrong
Conclusion
Conclusion
The circuit runs correctly and stably as when running simulation by software.With the above operation, from the simulation on the software can completely put make a real circuit.
Advantage
- The circuit operates at a low voltage source
- Easy to use user interface via 7-segment LED
Disadvantage
- The model has many limitations and the components are only symbolic
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
MA7DOAN[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; int32 read,temp;
OUTPUT_C(MA7DOAN[temp/10]); OUTPUT_LOW(PIN_D0);
DELAY_MS(1); OUTPUT_HIGH(PIN_D0);
OUTPUT_C(MA7DOAN[temp%10]); OUTPUT_LOW(PIN_D1);
DELAY_MS(1); OUTPUT_HIGH(PIN_D1);
DELAY_MS(1); OUTPUT_HIGH(PIN_D2);
OUTPUT_C(0XC6); OUTPUT_LOW(PIN_D3);
DELAY_MS(1); OUTPUT_HIGH(PIN_D3);
OUTPUT_C(MA7DOAN[X/10]); OUTPUT_LOW(PIN_D4);
DELAY_MS(1); OUTPUT_HIGH(PIN_D4);
OUTPUT_C(MA7DOAN[X%10]); OUTPUT_LOW(PIN_D5);
DELAY_MS(1); OUTPUT_HIGH(PIN_D5);
Setup_adc_ports(sAN0); setup_adc(ADC_CLOCK_INTERNAL); ENABLE_INTERRUPTS(GLOBAL); setup_adc(ADC_CLOCK_DIV_2); delay_ms(10);
SET_TRIS_B(0x00);// port B output WHILE(TRUE) { set_adc_channel(0); delay_us(30); read=read_adc(); temp = read/2.046; tang(); giam(); if(temp>=X)
OUTPUT_HIGH(PIN_b7); else OUTPUT_LOW(PIN_b7); Lm35();