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();
}
}
}
}
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Circuit Analysis
- Tms320VC5502 and isp1581 high-speed data acquisition solution
- 2019FPGA Employment Competition and Guidance
- What kind of activities do you hope the RF/Radio Frequency section will carry out? Please leave a message in the thread.
- Oscilloscope usage tips you don't know
- Free Trial | Keysight Accelerates Signal Integrity and Power Integrity Testing
- Learning PLC technology is super easy
- Advantages of modules
- EEWORLD University Hall----Live Replay: What to listen to when stuck in traffic? New generation of in-car audio systems and software-defined cars
- Beautiful Pico Quad Keyboard