Preface
With the development of integrated functions of single-chip microcomputers, their application fields have gradually expanded from traditional single control processing to control processing, data processing, digital signal processing, etc. Lingyang 16-bit single-chip microcomputers are designed to adapt to this development, and have become the choice of more and more single-chip microcomputer users with their excellent voice processing capabilities.
System hardware design
The system is based on a single-chip microcomputer and equipped with various integrated sensors. It is compact. The use of micro-packaged chips and components shortens the connection and reduces the number of communication interfaces, thus improving the reliability of the whole machine. The system hardware structure is shown in Figure 1.
SPCE061A MCU
SPCE061A is a 16-bit microcontroller chip in the 'nSPTM (Microcontroller And Signal Processor) series of products from Sunplus Technology. It has a built-in 32k flash memory. Its high processing speed enables the chip to process complex digital signals very easily and quickly, and is suitable for applications such as digital speech recognition.
Figure 1 System hardware structure diagram
DS18B20 Temperature Sensor
The DS18B20 temperature sensor uses a 12-bit digital representation corresponding to the stored temperature value, with a theoretical accuracy of up to 0.05°C. It can detect changes in human body temperature in real time and accurately, and can display the temperature on a liquid crystal display through a single-chip microcomputer.
Typical interface design between DS18B20 and single chip microcomputer
The power supply can be provided by two methods: external power supply and parasitic power supply (ie, power supply obtained from the data line), as shown in FIG2 .
Precautions for using DS18B20
(1) It takes a certain amount of time for DS18B20 to convert the temperature value into a digital value after the temperature measurement is completed. This must be guaranteed, otherwise it will cause conversion errors and the temperature output will always display 85°C.
(2) In actual use, it is found that the power supply voltage should be kept at around 5V. If the power supply voltage is too low, the measured temperature will be higher than the actual temperature. After testing, it is found that it is generally around 5V.
(3) Smaller hardware overhead requires relatively complex software to compensate. Since data is transmitted serially between DS18B20 and the microcontroller, the read and write timing must be strictly guaranteed when programming the DS18B20, otherwise the temperature measurement results will not be read.
(4) In the design of DS18B20 temperature measurement program, after sending the temperature conversion command to DS18B20, the program always has to wait for the return signal of DS18B20. Once the contact of DS18B20 is poor or the line is broken, when the program reads the DS18B20, there will be no return signal and the program will enter an infinite loop. This point should also be given certain attention when performing DS18B20 hardware connection and software design.
ZD-3 Micro Vibration Sensor
The ZD-3 micro-vibration sensor is an active, highly sensitive, micro-power consumption detection element that outputs in the form of a sine wave. It can be converted into a pulse wave using a 74LS14 Schmitt trigger and input into a single-chip microcomputer to detect a high level. It can record the number of steps of a runner or exerciser in real time, and then obtain the energy loss of the exerciser, so as to facilitate more effective exercise.
HK-2000A Pulse Detection Sensor
This product uses a highly integrated process to integrate force-sensitive elements (PVDF piezoelectric film), sensitivity temperature compensation elements, temperature sensing elements, and signal conditioning circuits into the sensor. It outputs a positive pulse once the pulse fluctuates. This product is used for pulse rate detection, mainly for heart rate testing in sports and fitness equipment.
OCM4X8C LCD Display Module
The OCM4X8C LCD module uses a 128×64 dot Chinese character graphic LCD module, which can display Chinese characters and graphics. It has a built-in GB2312 simplified Chinese character library (16×16 dot), 128 characters (8×16 dot) and a 64×256 dot GDRAM drawing area. It can be directly interfaced with the CPU and provides 8-bit parallel and serial connection to the microprocessor. The module provides users with the simplest solution for LCD applications. With one instruction, you can realize functions such as Chinese characters, pictures, English letters, and extra large and extra small numbers starting to display at any point on the LCD screen, flashing in any designated area, moving, and reverse display, which originally required users to spend a lot of time and energy to program. This greatly reduces the requirements for program storage space when users select CPUs. At the same time, the module has its own temperature compensation and power saving functions (microampere level), which is an excellent choice for users who require low power consumption or high and low temperature display effects, such as handheld terminals, power equipment, etc.
; Figure 2 Parasitic power supply alarm module
Respiratory air flow temperature detection module
In order to reduce the error caused by thermal inertia and accurately measure the change of respiratory airflow temperature, the thermal capacity of the thermistor should be as small as possible and its location should be at the place with the highest airflow velocity in the respiratory tract. Therefore, the BLTS101 PN junction temperature sensor (thermal response time τ<0.2s) is selected in the circuit. The constant current source provides a constant forward current of 100μA to the PN junction, and the forward voltage drop of the PN junction only changes with the change of temperature T. The voltage signal is amplified by the preamplifier, passed through a 4.84Hz low-pass filter, and then converted into a digital signal and sent to the microcontroller.
System software design
The software design adopts modular structure
The software is written in C61 (a programming language for Sunplus microcontrollers similar to C) and assembly language to display various physiological parameter data in real time on the LCD screen. Flash is used for data storage, so that data will not be lost when the instrument battery is replaced. Upper and lower alarm thresholds can be set for all measurement parameters. When any parameter exceeds the threshold, an audible and visual alarm can be issued. According to the design needs, the alarm can be stopped using the mute key. Since the respiratory impedance signal has a baseline drift phenomenon, a variable median detection method is used in the software design to correct the baseline. The specific method is to use the median point in the previous respiratory cycle as the detection point of this respiratory cycle, so as to overcome the missed detection caused by the baseline drift phenomenon within the normal detection voltage range.
Data collection part
Real-time data collection of physiological parameters is mainly carried out through sensors. When measuring human body temperature, since the temperature changes slowly during exercise, the software timer interrupt method is mainly used for detection. When detecting parameters such as step count and pulse, the frequency is mainly recorded. Software counting is sufficient. According to the high level detected, the counter performs self-increment operation to record the frequency.
Parameter threshold setting
Since the human body temperature is around 36.5℃ under normal circumstances, the initial value of the temperature threshold is set to 36.5℃, and the temperature can be increased or decreased by 0.25℃ with the up and down keys. Each time the key is pressed, it increases or decreases by 0.25℃ until the threshold that the exerciser wants to set is reached (between 35℃ and 42℃).
LCD driver design
The realization of the system display function is actually the driver programming of the OCM4X8C LCD module. According to the structured programming idea, this article uses C61 language to compile the up, down, return and confirm key functions into sub-functions, which is convenient for the main program to call. Due to space limitations, the LCD driver program is not described in detail here.
Conclusion
The successful research of this program makes it more convenient for people to exercise at home. At the same time, wireless transmission can be implemented to make the elderly and patients safer at home or in the hospital, and make their families more at ease.
Previous article:Single chip temperature recording system
Next article:ATmega48 sensor button design based on Atmel QTouch
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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
- Looking for a company that can make SIC simulation models
- The volume control IC PT2259 has background noise, how to solve it?
- [National Technology N32G430] 4GPIO inversion
- Computer World has been eliminated by the computer world! Do you still read paper magazines/newspapers?
- EEWORLD University - Getting Started from the Ground Up: Teach You How to Quickly Develop MSP430 Projects
- Free evaluation - Topmicro intelligent display module (1) Receive module
- TI has integrated it! CAN FD strengthens and upgrades automotive neural networks
- EEWORLD University - Key Considerations for Isolated CAN Transceivers
- Looking for chips or modules---infrared photoelectric sensor switch, infrared human body sensor switch, gravity sensor switch
- Hiring embedded engineers