Pulse and body temperature monitor based on 51 single chip microcomputer

Publisher:三青Latest update time:2021-10-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Hardware Solution

The system is based on the STC89C52 microcontroller. The photoelectric sensor uses the internal timer of the microcontroller system to calculate the time. The photoelectric sensor generates a signal. The microcontroller accumulates the signal to get the pulse beats. The time is obtained by the timer. During the operation of the system, the indicator light can be observed to flash. If it flashes evenly, it means that the measurement value is accurate. When the system stops running, the total pulse number can be displayed. In addition, we also added a temperature sensor DS18B20 to detect human body temperature.


It is mainly composed of 51 single chip microcomputer + 1602 LCD display + infrared tube collection + button + buzzer; as shown in the figure:

2. Design function

(1) This design is based on the STC89C51/52 (similar to AT89S51/52 and AT89C51/52) microcontroller.

(2) LCD1602 liquid crystal displays the current heart rate and current body temperature. The heart rate unit is heart rate/minute and the temperature unit is Celsius.

(3) Place your finger in the infrared tube and read your heart rate within 2 seconds; hold the temperature sensor in your hand to measure your current body temperature.

(4) Press the button to set the upper and lower limits of heart rate and body temperature for the alarm.

(5) Three buttons: one for setting, one for adding, and one for subtracting. Press the setting button to set the heart rate value, and press it again to set the temperature value;


3. Design Schematic

(1) The schematic diagram is mainly designed using AD software, as shown in the figure:

(2) The Protues simulation diagram is as follows:

(3) The PCB diagram is as follows:

4. Software Design

Main program source code


/********************Main function****************/

void main()

{

    ReadTemperature();

    show1(); //Display greetings and other information

time_init(); //Initialize the timer 

init_int0(); //External interrupt 0 initialization program

    init_eeprom(); //Read eeprom data

while(1)

{

      key(); //Key scan

      if(flat300ms>=4) //200ms

   {

    flat300ms=0;

//==================Main interface===================

  if(yemian==0)  

{

  if(biaozhi==0)

{

                   biaozhi=1;


   lcd_init(); // Initialization

   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();

       }


//==================Pulse alarm upper limit setting===================

  if(yemian==1)  

{

  if(biaozhi==1)

{

                   biaozhi=2;

   Buzzer=1;

   lcd_init(); // Initialization

   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();

       }


//==================Pulse alarm lower limit setting===================

  if(yemian==2)  

{

  if(biaozhi==2)

{

                   biaozhi=3;

   Buzzer=1;

   lcd_init(); // Initialization

   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();

       }

       

//==================Temperature alarm upper limit setting===================

  if(yemian==3)  

{

  if(biaozhi==3)

{

                   biaozhi=4;

   Buzzer=1;

   lcd_init(); // Initialization

  

   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();

       }       


//==================Temperature alarm lower limit setting===================

  if(yemian==4)  

{

  if(biaozhi==4)

{

                   biaozhi=0;

   Buzzer=1;

   lcd_init(); // Initialization

  

   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();

       }       

      

        

   }

    }

 }

Reference address:Pulse and body temperature monitor based on 51 single chip microcomputer

Previous article:RFID access control system based on 51 single chip microcomputer - LCD12864 display
Next article:Design of eight-way buzzer-beater based on 51 single-chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号