脈搏檢測+體溫檢測設(shè)計(jì)實(shí)物圖:
0.jpg (43.23 KB, 下載次數(shù): 91)
下載附件
2017-12-18 01:25 上傳
0.jpg (97.89 KB, 下載次數(shù): 98)
下載附件
2017-12-18 01:25 上傳
Altium Designer畫的原理圖和PCB圖如下:(51hei附件中可下載工程文件)
0.jpg (53.48 KB, 下載次數(shù): 89)
下載附件
2017-12-18 01:26 上傳
0.jpg (75.89 KB, 下載次數(shù): 81)
下載附件
2017-12-18 01:24 上傳
脈搏體溫檢測儀仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
}I_]$FHZ99(XZCK$D9R%B}T.png (19.28 KB, 下載次數(shù): 91)
下載附件
2017-12-17 15:14 上傳
文檔:
0.jpg (74.99 KB, 下載次數(shù): 79)
下載附件
2017-12-18 01:32 上傳
清單 | 元件名 | 位置 | 數(shù)量 | 備注 | |
|
|
| 電源電路 |
|
|
| 電源接線端子 | J1 | 1套 |
| 開關(guān) | S1 | 1個 |
| 指示燈 | D1 | 1個 |
| 電阻1K | R2 | 1個 |
|
|
|
|
|
|
|
|
| 單片機(jī)最小系統(tǒng) |
|
|
| IC座子40P | U1 | 1個 |
| 單片機(jī)STC89C52 | Y1 | 1個 |
| 晶振12M | Y1 | 1個 |
| 獨(dú)石電容22P | C1、C2 | 2個 | 元件上標(biāo):220 | 電阻 10K | R1 | 1個 |
| 按鍵 | K1 | 1個 |
| 電解電容 | C3 | 1個 |
|
|
|
|
| 溫度傳感器電路 |
|
|
| DS18B20傳感器 | U4 | 1個 |
| 電阻10K | R16 | 1個 |
|
|
|
|
| 顯示電路 |
|
|
| 排座16P | LCD1 | 1個 |
| 液晶1602顯示屏 | LCD1 | 1個 |
| 電位器10K | W1 | 1個 | 改變液晶顯示屏亮度 | |
|
|
| 報(bào)警部分 |
|
|
| 蜂鳴器 | B1 | 1個 |
| 三極管 | Q1 | 1個 |
| 電阻1K | R14 R15 | 1個 |
| 5mmLED燈 | D2 | 1個 |
| 按鍵 | K2 K3 K4 | 3個 |
|
|
|
|
|
|
|
|
| 光電部分和放大部分 |
|
|
| 紅外光電傳感器 | U3 | 1個 |
| LM358運(yùn)放 | U4 | 1個 |
| DIP8座子 | U4 | 1個 |
| 電阻330歐 | R3 R9 R13 | 3個 |
| 電阻20K | R4 R7 R10 | 3個 |
| 電阻10K | R5 R6 R12 | 3個 |
| 電阻100K | R8 | 1個 |
| 電阻56K | R11 | 1個 |
| 3MM指示燈 | D2 | 1個 | | 10UF/25V電解電容 | C3 | 1個 | | 1UF/50V電解電容 | C4 C5 | 2個 | | |
|
| | 主板 |
|
| | 萬能板 | 9cm*15cm | 1張 | |
視頻這部分 主要 給大家詳細(xì)的講解了《電源部分》、《復(fù)位部分》、《時鐘部分》、《液晶顯示部分》;
由于文件較大,請自行下載。把下面的網(wǎng)址復(fù)制到瀏覽器里打開后就可以下載了。
原理圖講解視頻下載:
游客,本帖隱藏的內(nèi)容需要積分高于 1 才可瀏覽,您當(dāng)前積分為 0
單片機(jī)源程序如下:
- #include <reg52.h> //調(diào)用單片機(jī)頭文件
- #define uchar unsigned char //無符號字符型 宏定義 變量范圍0~255
- #define uint unsigned int //無符號整型 宏定義 變量范圍0~65535
- #include<DS18N02.h>
- #include <intrins.h>
- #include "eeprom52.h"
- #define DBPort P0
- unsigned char i=0,timecount=0,displayOK=0,rate=0,rate1=0,aa=0,time1=0,flat300ms=0;
- unsigned int time[6]={0};
- unsigned int oneminte=0;
- unsigned int ReadTempDate;
- unsigned char S_temp_H,S_temp_L,S_heart_H,S_heart_L;
- unsigned char yemian=0,biaozhi=0;
- sbit K1 = P1^0; //菜單
- sbit K2 = P1^1; //加
- sbit K3 = P1^2; //減
- sbit Buzzer= P1^7; //控制端
- sbit rs = P2^5 ;
- sbit rw = P2^6 ;
- sbit ep = P2^7 ;
- bit flag=1;
-
- /******************把數(shù)據(jù)保存到單片機(jī)內(nèi)部eeprom中******************/
- void write_eeprom()
- {
- SectorErase(0x2000);
- byte_write(0x2000, S_heart_H);
- byte_write(0x2001, S_heart_L);
- byte_write(0x2002, S_temp_H);
- byte_write(0x2003, S_temp_L);
-
-
- byte_write(0x2060, a_a);
- }
- /******************把數(shù)據(jù)從單片機(jī)內(nèi)部eeprom中讀出來*****************/
- void read_eeprom()
- {
- S_heart_H = byte_read(0x2000);
- S_heart_L = byte_read(0x2001);
- S_temp_H = byte_read(0x2002);
- S_temp_L = byte_read(0x2003);
- a_a = byte_read(0x2060);
- }
- /**************開機(jī)自檢eeprom初始化*****************/
- void init_eeprom()
- {
- read_eeprom(); //先讀
- if(a_a != 2) //新的單片機(jī)初始單片機(jī)內(nèi)問eeprom
- {
- S_heart_H = 120;
- S_heart_L = 60;
- S_temp_H = 38;
- S_temp_L = 5;
- a_a = 2;
- write_eeprom();
- }
- }
- /***********************1ms延時函數(shù)*****************************/
- void delay_1ms(uint q)
- {
- uint i,j;
- for(i=0;i<q;i++)
- for(j=0;j<110;j++);
- }
- /********************************************************************
- * 名稱 : delay_uint()
- * 功能 : 小延時。
- * 輸入 : 無
- * 輸出 : 無
- ***********************************************************************/
- void delay_uint(uint q)
- {
- while(q--);
- }
- typedef bit BOOL ;
- uchar data_byte;
- void delay(uchar ms)
- { // 延時子程序
- uchar i ;
- while(ms--)
- {
- for(i = 0 ; i<250;i++) ;
- }
- }
- void delay1()//延時10us
- {
- uchar i;
- i--;
- i--;
- i--;
- i--;
- i--;
- i--;
- }
- void longdelay(uchar s) //長延時
- {
- while(s--)
- {
- delay(10) ;
- }
- }
- /************************LCD模塊******************************************/
- BOOL lcd_bz()//測試LCD忙碌狀態(tài)
- {
- BOOL result ;
- rs = 0 ;
- rw = 1 ;
- ep = 1 ;
- result = (BOOL)(P0 & 0x80) ;
- ep = 0 ;
- return result ;
- }
- void write_cmd(uchar cmd)// 寫指令
- {
- while(lcd_bz()) ;
- P0 = cmd ;
- ep = 1 ;
- ep = 0 ;
- }
- void write_addr(uchar addr)//寫地址
- {
- write_cmd(addr|0x80) ;
- }
- void write_byte(uchar dat)//寫字節(jié)
- {
- while(lcd_bz()) ;
- rs = 1 ;
- rw = 0 ;
- ep = 0 ;
- P0 = dat ;
- ep = 1 ;
- ep = 0 ;
- }
- void lcd_init()// 初始化
- {
- write_cmd(0x38) ;
- delay(1);
- write_cmd(0x08) ;
- delay(1);
- write_cmd(0x01) ;
- delay(1);
- write_cmd(0x06) ;
- delay(1);
- write_cmd(0x0c) ;
- delay(1);
- }
- display(uchar addr, uchar q)//在某一地址上顯示一字節(jié)
- {
- delay(1) ;
- write_addr(addr) ;
- write_byte(q) ;
- // longdelay(1) ;
-
- }
- void show1()
- {
- lcd_init();// 初始化
- // Welcome
-
-
- display(0x05,'W');
- display(0x06,'e');
- display(0x07,'l');
- display(0x08,'c');
- display(0x09,'o');
- display(0x0a,'m');
- display(0x0b,'e');
- longdelay(50);//短暫延時
-
-
- display(0x42,' ');
- display(0x43,' ');
- display(0x44,' ');
- display(0x45,' ');
- display(0x46,' ');
- display(0x48,' ');
- display(0x49,' ');
- display(0x4a,' ');
- display(0x4b,' ');
- longdelay(50);//短暫延時
-
- }
- void key() //按鍵程序 選擇菜單模式
- {
-
- if(!K1)
- {
- delay_1ms(20);
- if(!K1)
- {
- while(!K1)
- ;
- yemian++;
- if(yemian>=5) { yemian=0; }
-
- }
- }
- }
- void shezhi() //對里面的數(shù)值進(jìn)行修改
- {
- if(!K2) //按下按鍵
- {
- delay_1ms(20);
- if(!K2)
- {
- if(yemian==1)
- {
- S_heart_H+=1; //沒按下一次,數(shù)值加1
- if(S_heart_H>=200) {S_heart_H=200;}
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_heart_H/100+'0');
- display(0x47,S_heart_H%100/10+'0');
- display(0x48,S_heart_H%100%10+'0');
- }
-
- if(yemian==2)
- {
- S_heart_L+=1; //沒按下一次,數(shù)值加1
- if(S_heart_L>=200) {S_heart_L=200;}
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_heart_L/100+'0');
- display(0x47,S_heart_L%100/10+'0');
- display(0x48,S_heart_L%100%10+'0');
- }
-
- if(yemian==3)
- {
- S_temp_H+=1; //沒按下一次,數(shù)值加1
- if(S_temp_H>=125) {S_temp_H=125;}
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_temp_H/100+'0');
- display(0x47,S_temp_H%100/10+'0');
- display(0x48,S_temp_H%100%10+'0');
- }
-
- if(yemian==4)
- {
- S_temp_L+=1; //沒按下一次,數(shù)值加1
- if(S_temp_L>=125) {S_temp_L=125;}
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_temp_L/100+'0');
- display(0x47,S_temp_L%100/10+'0');
- display(0x48,S_temp_L%100%10+'0');
- }
-
- }
- // while(!K2); //等待按鍵 彈起 屏蔽此句,可以實(shí)現(xiàn)按鍵按下不放開時,連加技術(shù)功能,
- // 不過需要將上面延時去抖時間延長效果才好。建議改為: delay_LCD(50);
- }
-
-
- if(!K3) //按下按鍵
- {
- delay_1ms(20);
- if(!K3)
- {
- if(yemian==1)
- {
-
- if(S_heart_H<=1) {S_heart_H=1;}
- S_heart_H-=1; //沒按下一次,數(shù)值加1
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_heart_H/100+'0');
- display(0x47,S_heart_H%100/10+'0');
- display(0x48,S_heart_H%100%10+'0');
- }
- if(yemian==2)
- {
-
- if(S_heart_L<=1) {S_heart_L=1;}
- S_heart_L-=1; //沒按下一次,數(shù)值加1
- write_eeprom(); //保存數(shù)據(jù)
-
- display(0x46,S_heart_L/100+'0');
- display(0x47,S_heart_L%100/10+'0');
- display(0x48,S_heart_L%100%10+'0');
- }
-
- if(yemian==3)
- {
- if(S_temp_H<=1) {S_temp_H=1;}
- S_temp_H-=1; //沒按下一次,數(shù)值加1
- write_eeprom(); //保存數(shù)據(jù)
- display(0x46,S_temp_H/100+'0');
- display(0x47,S_temp_H%100/10+'0');
- display(0x48,S_temp_H%100%10+'0');
-
- }
-
- if(yemian==4)
- {
- if(S_temp_L<=1) {S_temp_L=1;}
- S_temp_L-=1; //沒按下一次,數(shù)值加1
- write_eeprom(); //保存數(shù)據(jù)
- display(0x46,S_temp_L/100+'0');
- display(0x47,S_temp_L%100/10+'0');
- display(0x48,S_temp_L%100%10+'0');
-
- }
- }
- // while(!K3); //等待按鍵 彈起 //等待按鍵 彈起 屏蔽此句,可以實(shí)現(xiàn)按鍵按下不放開時,連加技術(shù)功能,
- // 不過需要將上面延時去抖時間延長效果才好。建議改為: delay_LCD(50);
- }
-
- }
- void wendumaibo()
- {
- if(displayOK==0)//如果顯示關(guān)
- {
- display(0x06,'W');
- display(0x07,'a');
- display(0x08,'i');
- display(0x09,'t');
- display(0x0a,'i');
- display(0x0b,'n');
- display(0x0c,'g');
- flag=1;
- oneminte=0;//加上這個,當(dāng)displayOK標(biāo)志位沒有置1時,都清零計(jì)數(shù),等待重新檢測中計(jì)數(shù)。
- }
-
- if(displayOK==1 && oneminte<=200)//如果顯示開
- {
- flag=0;
- display(0x06,'T');
- display(0x07,'e');
- display(0x08,'s');
- display(0x09,'t');
- display(0x0a,'i');
- display(0x0b,'n');
- display(0x0c,'g');
- }
-
- ReadTempDate=ReadTemperature();
- display(0x46,ReadTempDate/100+'0');
- display(0x47,ReadTempDate%100/10+'0');
- display(0x48,'.');
- display(0x49,ReadTempDate%100%10+'0');
- display(0x4a,0xdf);
- display(0x4b,'C');
- }
- void baojin()
- {
- if( ( (rate*6<S_heart_L || rate*6>S_heart_H) && oneminte>200 ) || ReadTempDate>=S_temp_H*10 || ReadTempDate<=S_temp_L*10 ) { Buzzer=0; }
- if( oneminte>=0 && oneminte<200 && ReadTempDate<S_temp_H*10 && ReadTempDate>S_temp_L*10 ) { Buzzer=1; }
- }
- /*************定時器0初始化程序***************/
- void time_init()
- {
- EA = 1; //開總中斷
- TMOD = 0X01; //定時器0、定時器1工作方式1
- ET0 = 1; //開定時器0中斷
- TR0 = 1; //允許定時器0定時
- }
- /***********外部中斷0初始化程序****************/
- void init_int0() //外部中斷0初始化程序
- {
- EX0=1; //允許外部中斷0中斷
- EA=1; //開總中斷
- IT0 = 1; //外部中斷0負(fù)跳變中斷
- }
- /****************主函數(shù)***************/
- void main()
- {
- ReadTemperature();
- show1();//顯示問候語和其他信息
- time_init(); //初始化定時器
- init_int0(); //外部中斷0初始化程序
- init_eeprom(); //讀eeprom數(shù)據(jù)
- while(1)
- {
- key(); //按鍵掃描
- if(flat300ms>=4) //200ms
- {
- flat300ms=0;
- //==================主界面===================
- if(yemian==0)
- {
- if(biaozhi==0)
- {
- biaozhi=1;
- lcd_init();// 初始化
- display(0x00,'H');
- display(0x01,'e');
- display(0x02,'a');
- display(0x03,'r');
- display(0x04,'t');
- display(0x05,':');
- display(0x40,'T');
- display(0x41,'e');
- display(0x42,'m');
- display(0x43,'p');
- display(0x44,':');
- }
- wendumaibo();
- baojin();
- }
- //==================脈搏報(bào)警上限 設(shè)置===================
- if(yemian==1)
- {
- if(biaozhi==1)
- {
- biaozhi=2;
- Buzzer=1;
- lcd_init();// 初始化
- display(0x04,'H');
- display(0x05,'e');
- display(0x06,'a');
- display(0x07,'r');
- display(0x08,'t');
- display(0x09,'-');
- display(0x0a,'H');
- display(0x46,S_heart_H/100+'0');
- display(0x47,S_heart_H%100/10+'0');
- display(0x48,S_heart_H%100%10+'0');
- }
- shezhi();
- }
- //==================脈搏報(bào)警下限 設(shè)置===================
- if(yemian==2)
- {
- if(biaozhi==2)
- {
- biaozhi=3;
- Buzzer=1;
- lcd_init();// 初始化
- display(0x04,'H');
- display(0x05,'e');
- display(0x06,'a');
- display(0x07,'r');
- display(0x08,'t');
- display(0x09,'-');
- display(0x0a,'L');
- display(0x46,S_heart_L/100+'0');
- display(0x47,S_heart_L%100/10+'0');
- display(0x48,S_heart_L%100%10+'0');
- }
- shezhi();
- }
-
- //==================溫度報(bào)警 上限設(shè)置===================
- if(yemian==3)
- {
- if(biaozhi==3)
- {
- biaozhi=4;
- Buzzer=1;
- lcd_init();// 初始化
-
- display(0x05,'T');
- display(0x06,'e');
- display(0x07,'m');
- display(0x08,'p');
- display(0x09,'-');
- display(0x0a,'H');
- display(0x46,S_temp_H/100+'0');
- display(0x47,S_temp_H%100/10+'0');
- display(0x48,S_temp_H%100%10+'0');
- }
- shezhi();
- }
- //==================溫度報(bào)警 下限設(shè)置===================
- if(yemian==4)
- {
- if(biaozhi==4)
- {
- biaozhi=0;
- Buzzer=1;
- lcd_init();// 初始化
-
- display(0x05,'T');
- display(0x06,'e');
- display(0x07,'m');
- display(0x08,'p');
- display(0x09,'-');
- display(0x0a,'L');
- display(0x46,S_temp_L/100+'0');
- display(0x47,S_temp_L%100/10+'0');
- display(0x48,S_temp_L%100%10+'0');
- }
- shezhi();
- }
-
- ……………………
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復(fù)制代碼
本人初學(xué),僅供參考,存在錯誤和不足之處,請大家回帖多多指教,切勿照搬,文件下載:
脈搏檢測 體溫檢測設(shè)計(jì).zip
(6.92 MB, 下載次數(shù): 631)
2017-12-17 15:15 上傳
點(diǎn)擊文件名下載附件
|