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 detection 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 AD590 temperature and current is shown in the following table
2. Circuit diagram
Figure 4.30.1
3. Hardware connections 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 using an 8-core cable.
(2) Connect P2.0-P2.7 in the "MCU System" area and S1S2S3S4S5S6S7S8 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 terminals in the "Power Module" area with wires.
(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 using an 8-core cable.
4. Programming content
(1) The CLK signal of ADC0809 is provided by the P3.3 pin of the microcontroller.
(2) Since the temperature range of AD590 is between -55℃ and +150℃, the voltage sampled after passing through 10KΩ varies between 2.182V and 4.232V, which does not exceed the range represented by the 5V voltage. Therefore, the reference voltage is the power supply voltage VCC (measured VCC = 4.70V). From this, the Celsius temperature display data after A/D conversion can be calculated as:
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)
5. C language source program
#include #include unsignedcharcodedispbitcode[]={0xfe,0xfd,0xfb,0xf7, 0xef,0xdf,0xbf,0x7f}; unsignedcharcodedispcode[]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40}; unsignedchardispbuf[8]={10,10,10,10,10,10,0,0}; unsignedchardispcount; unsignedchargetdata; unsignedlongtemp; unsignedchari; bitsflag; sbitST=P3^0; sbitOE=P3^1; sbitEOC=P3^2; sbitCLK=P3^3; sbitLED1=P3^6; sbitLED2=P3^7; sbitSPK=P3^5; voidmain(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; ST=1; ST=0; getdata=148; while(1) { ; } } voidt0(void)interrupt1using0 { CLK=~CLK; } voidt1(void)interrupt3using0 { TH1=(65536-4000)/256; TL1=(65536-4000)%256; if(EOC==1) { YOU=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[i]=temp%10; temp=temp/10; i++; } dispbuf[i]=temp; ST=1; ST=0; } P1=dispcode[dispbuf[dispcount]]; P2=dispbitcode[dispcount]; dispcount++; if(dispcount==8) { dispcount=0; } }
Previous article:Circuit structure of P0 port of 51 single chip microcomputer
Next article:Wireless apnea monitoring system based on nRF4O1
- Popular Resources
- Popular amplifiers
- A very complete set of Chinese and English versions of DS18B20 single bus digital thermometer module information (including schematic diagram)
- A Digital Thermometer Using the AT89C2051 MCU
- digital clock and thermometer pic16f84
- Multi-channel pressure measuring instrument based on C8051F020 single chip microcomputer
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- 2019 Tektronix OPEN-DAY opens: Hold your DUT and test thoroughly
- Show off the Sony headphones I got from EEWORLD
- Single tube amplifier
- TMS320F28335 SVPWM source program
- 【RPi PICO】CircuitPython Firmware
- msp430f5529 uart pwm adc
- [Help] In the design of lithium battery power modules, why is every 1V of lithium battery voltage very valuable?
- [DIY Bing Dun Dun] + Limited Edition Homemade Dun Dun is here
- EEWORLD University Hall----Live Replay: Unlocking New Possibilities of TI Sitara AM2x MCU in Motor Drive
- 02.USART routines and tests