1. Basic knowledge of temperature sensor AD590
The current generated by AD590 is proportional to the absolute temperature. It can accept an operating voltage of 4V-30V and a temperature range of -55℃-+150℃. It has very good linear output performance. For every 1℃ increase in temperature, its current increases by 1uA.
The relationship between the temperature and current of AD590 is shown in the following table Celsius
temperature
AD590 Current
through 10KΩ Voltage
0℃
273.2 uA
2.732V
10℃
283.2 uA 2.832
V 20
℃
293.2 uA
2.932 V
30℃
303.2 uA
3.032 V
40℃
313.2 uA 3.132 V 50℃ 323.2 uA
3.232 V 60℃ 333.2 uA 3.332 V 100℃ 373.2 uA 3.732 V AD590 pin diagram 2. Experimental task Use the AD590 temperature sensor to complete the temperature measurement, send the converted temperature value to one of the channels of ADC0809 for A/D conversion, and convert the conversion result into temperature value and send it to the digital tube for display. 3. Circuit schematic diagram
Figure 4.30.1
4. Hardware connection on the system board
(1). Connect P1.0-P1.7 in the "MCU system" area to the ABCDEFGH ports in the "Dynamic digital display" area with an 8-core cable.
(2). Connect P2.0-P2.7 in the "MCU system" area to the S1S2S3S4S5S6S7S8 ports in the "Dynamic digital display" area with an 8-core cable.
(3). Connect P3.0 in the "MCU system" area to the ST terminal in the "Analog-to-digital conversion module" area with a wire.
(4). Connect P3.1 in the "MCU system" area to the OE terminal in the "Analog-to-digital conversion module" area with a wire.
(5). Connect P3.2 in the "MCU system" area to the EOC terminal in the "Analog-to-digital conversion module" area with a wire.
(6). Connect P3.3 in the "MCU system" area to the CLK terminal in the "Analog-to-digital conversion module" area with a wire.
(7) Connect the A2A1A0 terminals in the "Analog-to-digital conversion module" area to the GND terminal in the "Power module" area with a wire.
(8) Connect the IN0 terminal in the "Analog-to-digital conversion module" area to the self-made AD590 circuit with a wire.
(9) Connect P0.0-P0.7 in the "MCU system" area to the D0D1D2D3D4D5D6D7 terminals in the "Analog-to-digital conversion module" area with an 8-core cable.
5.Program design content
(1) The CLK signal of ADC0809 is provided by the P3.3 pin of the MCU
(2). Since the temperature range of AD590 is between -55℃ and +150℃, the voltage sampled after 10KΩ varies between 2.182V and 4.232V, which does not exceed the range represented by 5V voltage. Therefore, the reference voltage is the power supply voltage VCC (measured VCC = 4.70V). It can be calculated that the Celsius temperature display data after A/D conversion is:
If (D*2350/128) < 2732, the displayed temperature value is - (2732 - (D*2350/128))
If (D*2350/128) ≥ 2732, the displayed temperature value is + ((D*2350/128) - 2732)
6.Assembly source program
(omitted)
7. C language source program
#include
#include
unsigned char code dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d ,0x7d,0x07,0x7f,0x6f,0x00,0x40};
unsigned char dispbuf[8]={10,10,10,10,10,10,0,0};
unsigned char dispcount;
unsigned char getdata;
unsigned long temp;
unsigned char i;
bit sflag;
sbit ST=P3^0;
sbit OE=P3^1;
sbit EOC=P3^2;
sbit CLK=P3^3;
sbit LED1=P3^6;
sbit LED2=P3^7;
sbit SPK=P3^5;
void main(void)
{
ST=0;
OE=0;
TMOD=0x12;
TH0=0x216;
TL0=0x216;
TH1=(65536-4000 )/256; TL1 = (65536-4000 )
%256; TR1 =
1
; TR0 =
1; ET0
= 1 ; ET1 = 1 ; EA = 1 ; TH1=(65536-4000)/256; TL1=(65536-4000)%256; if(EOC==1) { OE=1; getdata=P0; OE=0; temp=(getdata*2350); temp=temp/128; if(temp<2732) { temp=2732-temp;
sflag=1;
}
else
{
temp=temp-2732;
sflag=0;
}
i=3;
dispbuf[0]=10;
dispbuf[1]=10;
dispbuf[2]=10;
if(sflag==1)
{
dispbuf[7]=11;
}
else
{
dispbuf[7]=10;
}
dispbuf[3]=0;
dispbuf[4]=0;
dispbuf[5]=0;
dispbuf[6]=0;
while(temp/10)
{
dispbuf=temp%10;
temp=temp/10;
i++;
}
dispbuf=temp;
ST=1;
ST=0;
}
P1=dispcode[dispbuf[dispcount]];
P2=dispbitcode[dispcount];
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
}
Reference address:30. Four-digit digital thermometer
The current generated by AD590 is proportional to the absolute temperature. It can accept an operating voltage of 4V-30V and a temperature range of -55℃-+150℃. It has very good linear output performance. For every 1℃ increase in temperature, its current increases by 1uA.
The relationship between the temperature and current of AD590 is shown in the following table Celsius
temperature
AD590 Current
through 10KΩ Voltage
0℃
273.2 uA
2.732V
10℃
283.2 uA 2.832
V 20
℃
293.2 uA
2.932 V
30℃
303.2 uA
3.032 V
40℃
313.2 uA 3.132 V 50℃ 323.2 uA
3.232 V 60℃ 333.2 uA 3.332 V 100℃ 373.2 uA 3.732 V AD590 pin diagram 2. Experimental task Use the AD590 temperature sensor to complete the temperature measurement, send the converted temperature value to one of the channels of ADC0809 for A/D conversion, and convert the conversion result into temperature value and send it to the digital tube for display. 3. Circuit schematic diagram
(1). Connect P1.0-P1.7 in the "MCU system" area to the ABCDEFGH ports in the "Dynamic digital display" area with an 8-core cable.
(2). Connect P2.0-P2.7 in the "MCU system" area to the S1S2S3S4S5S6S7S8 ports in the "Dynamic digital display" area with an 8-core cable.
(3). Connect P3.0 in the "MCU system" area to the ST terminal in the "Analog-to-digital conversion module" area with a wire.
(4). Connect P3.1 in the "MCU system" area to the OE terminal in the "Analog-to-digital conversion module" area with a wire.
(5). Connect P3.2 in the "MCU system" area to the EOC terminal in the "Analog-to-digital conversion module" area with a wire.
(6). Connect P3.3 in the "MCU system" area to the CLK terminal in the "Analog-to-digital conversion module" area with a wire.
(7) Connect the A2A1A0 terminals in the "Analog-to-digital conversion module" area to the GND terminal in the "Power module" area with a wire.
(8) Connect the IN0 terminal in the "Analog-to-digital conversion module" area to the self-made AD590 circuit with a wire.
(9) Connect P0.0-P0.7 in the "MCU system" area to the D0D1D2D3D4D5D6D7 terminals in the "Analog-to-digital conversion module" area with an 8-core cable.
5.
(1) The CLK signal of ADC0809 is provided by the P3.3 pin of the MCU
(2). Since the temperature range of AD590 is between -55℃ and +150℃, the voltage sampled after 10KΩ varies between 2.182V and 4.232V, which does not exceed the range represented by 5V voltage. Therefore, the reference voltage is the power supply voltage VCC (measured VCC = 4.70V). It can be calculated that the Celsius temperature display data after A/D conversion is:
If (D*2350/128) < 2732, the displayed temperature value is - (2732 - (D*2350/128))
If (D*2350/128) ≥ 2732, the displayed temperature value is + ((D*2350/128) - 2732)
6.
(omitted)
7. C language source program
#include
#include
unsigned char code dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d ,0x7d,0x07,0x7f,0x6f,0x00,0x40};
unsigned char dispbuf[8]={10,10,10,10,10,10,0,0};
unsigned char dispcount;
unsigned char getdata;
unsigned long temp;
unsigned char i;
bit sflag;
sbit ST=P3^0;
sbit OE=P3^1;
sbit EOC=P3^2;
sbit CLK=P3^3;
sbit LED1=P3^6;
sbit LED2=P3^7;
sbit SPK=P3^5;
void main(void)
{
ST=0;
OE=0;
TMOD=0x12;
TH0=0x216;
TL0=0x216;
TH1=(65536-4000 )/256; TL1 = (65536-4000 )
%256; TR1 =
1
; TR0 =
1; ET0
= 1 ; ET1 = 1 ; EA = 1 ; TH1=(65536-4000)/256; TL1=(65536-4000)%256; if(EOC==1) { OE=1; getdata=P0; OE=0; temp=(getdata*2350); temp=temp/128; if(temp<2732) { temp=2732-temp;
sflag=1;
}
else
{
temp=temp-2732;
sflag=0;
}
i=3;
dispbuf[0]=10;
dispbuf[1]=10;
dispbuf[2]=10;
if(sflag==1)
{
dispbuf[7]=11;
}
else
{
dispbuf[7]=10;
}
dispbuf[3]=0;
dispbuf[4]=0;
dispbuf[5]=0;
dispbuf[6]=0;
while(temp/10)
{
dispbuf
temp=temp/10;
i++;
}
dispbuf
ST=1;
ST=0;
}
P1=dispcode[dispbuf[dispcount]];
P2=dispbitcode[dispcount];
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
}
Previous article:26. Dot matrix LED simple graphic display technology
Next article:29. Temperature control between two points
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
Guess you like
- ESP32-S2 development pitfalls (3) -- porting littlevgl
- Recruiting part-time lecturers in motor control related majors
- It is recommended to merge the ATMEL and PIC microcontroller sections
- TI TMS320C6678 Evaluation Module
- IoT wireless communication data transmission module: multi-host gateway working mode, understand it in one article
- [RT-Thread reading notes]——The definition of threads and the implementation of thread switching
- How to read and write attributes through the characteristic uuid in sdk!
- Reasons for short-circuit failure of bidirectional TVS tube SMBJ30CA
- MSP430FR5994 Hardware SPI Exception
- In what fields can power amplifiers be used?