Design of liquid dripping speed monitoring system based on 89C51

Publisher:a407895356Latest update time:2010-11-19 Source: 微计算机信息Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

The liquid drip speed control system is a set of control equipment that can improve efficiency and service quality for large hospitals. In particular, the remote monitoring function enables the nurse station to monitor the patient's drip status in real time and adjust the drip speed according to the patient's status. There are many drip control systems on the market. The design point of this article is low cost. Only the cheapest 89C51 and ordinary components are used to realize the whole system.

2. System design requirements

2.1. Slave station design requirements

A. Detect the dripping speed at the drip bucket and use a digital display device to dynamically display the dripping speed (drops/minute).

B. The dripping speed can be controlled by changing the height of the drip bottle. The dripping speed can be set and displayed on the keyboard. The setting range is 20-150 (drops/minute). The control error range is +/-10%+/-1 drop of the setting value.

C. System adjustment time <= 3 minutes.

D. When the liquid level in the drip bottle is lower than the warning value, an alarm signal will be issued

2.2. System communication design requirements

Design and produce a wired monitoring system where the master station controls 16 slave stations

A. Master station function: It has two modes: fixed-point detection and patrol detection; it can display the slave station number and dripping speed transmitted by the slave station; during patrol detection, the master station can arbitrarily set the number of slave stations to be queried, the slave station number and the dripping speed of each slave station; after receiving the alarm signal sent by the slave station, it can sound and light alarm and display the corresponding slave station number; the alarm state can be manually released.

B. Slave function: can output slave number, drip speed and alarm signal; slave number and drip speed can be set arbitrarily; receive drip speed information set by the master station and display it; alarm for abnormal situations.

C. The communication method between the master station and the slave station is not limited, and the communication protocol is self-determined, but the number of signal transmissions should be minimized.

3. System design block diagram

Figure 1 System design diagram

4. Hardware design and demonstration

4.1. Drip speed detection scheme

This article uses a slot-type photocoupler. It is composed of a built-in amplifier and Schmidt integrated circuit of the photointerrupter LG-207 of KODENSHI Company and an indicator light of LITEON Company. The output signal port of the slot-type photocoupler is connected to a light-emitting diode. Because the coupler outputs a shaped pulse signal, the microcontroller can easily read it. The pulse also drives the indicator light-emitting diode, which can clearly and intuitively understand the detection of water droplets falling. Therefore, this device is very suitable for detecting the speed of water drops.

Figure 2 Schematic diagram of slot-type optocoupler circuit

4.2 Liquid level detection alarm solution

The photoelectric sensor is composed of a light-emitting diode and a photoelectric triode. The light-emitting diode and the photoelectric triode are fixed on both sides of the warning position to ensure that the infrared light emitted by the light-emitting diode and the receiving triode are level. The photoelectric triode can receive the infrared light emitted by the light-emitting diode. When the liquid level is normal (higher than the warning position), a high level of 4.2V is output. If the liquid level is lower than the warning position, the light spot triode outputs a low level of 0.2V. In both cases, the output voltage has a significant jump, and the low level emitted by the triode below the warning position can be directly sent to the single-chip microcomputer as an alarm signal.

4.3. Motor drive scheme

Solution 1: DC motor drive. The advantages of DC motors are: they can be self-locking, have strong load capacity, and run smoothly at a voltage of 12V. When the motor stops running, it can easily drag the infusion bottle and make it stop steadily at the corresponding position. This advantage is beneficial for adjusting the height ratio of the drip bottle. However, the DC motor inevitably causes a delay in the start and stop of the motor. Such dragging is somewhat disadvantageous for improving the positioning accuracy of the infusion bottle and the drip speed control. The control circuit uses a slow relay to control the opening or closing of the motor. As long as there is a voltage of 12V, the forward and reverse rotation of the motor can be adjusted by switching the switch. The circuit is simple and easy to implement.

Solution 2: 4-phase 8-beat stepper motor. Each time a pulse is sent to the stepper motor, the motor rotates 0.9 degrees (the stepping speed is 0.9 degrees/Step). Such performance is very beneficial for precise control. However, stepper motors also have obvious shortcomings: they cannot be self-locking, their load capacity is not as good as that of DC motors, their driving current is large, and they are prone to losing steps during operation. When the motor stops running, it cannot stop steadily because it is dragging a heavy load such as an infusion bottle, resulting in changes in the height of the drip bottle.

Taking all aspects into consideration, especially the load capacity of the motor, this paper decided to use a DC motor to drive the system.

4.4. Digital display solution

The character LCD (Liquid Crystal Display) display [3] can display relatively clear prompts using numbers, some symbols and English. It is relatively simple to implement and is sufficient to meet the requirements for the dynamic display of the drip speed of this system.

4.5. Setting scheme of dripping speed adjustment button

Each button switch is connected to a 10K lower resistor, so that it is in the off state and the output is low level, not floating state [4]. Before setting, you must first press the "Ctrl" button to output a high level to P0.5 of the microcontroller, indicating the start of setting. After that, if you press the button "++", a high level is output to P0.6 of the microcontroller; if you press the button "--", a high level is output to P0.7 of the microcontroller. To exit the setting, it is required to give P0.6 and P0.7 a high level at the same time, that is, you need to press the buttons "++" and "--" at the same time to explain the microcontroller.

4.6. System alarm

Sound and light alarm. Once the alarm signal is received, the bird call doorbell alarm circuit will be activated immediately

5. Software Design

5.1. MCU part

The single-chip minimum system uses the 89C51 processor, which is the core of the entire hardware system. It is mainly responsible for setting the speed and displaying it; reading the pulse of the on-site drip and detecting and displaying the on-site drip speed; receiving the alarm signal of the liquid level detection and realizing the alarm.

5.2. Measurement and display of dripping speed

Solution 1: Measure the dripping speed in units of 15 seconds (drops/15 seconds), and convert the speed value into the required speed in units of 1 minute (drops/minute). This solution is considered because the design requires adjustment to the set speed within 3 minutes. If (drops/minute) is directly used as the unit, there will not be enough adjustment time, and the speed in units of 15 seconds will not change too much, which is more stable for motor control.

Solution 2: Measure the time interval t between two consecutive drops of liquid, and then convert it into the number of drops per minute. Since the time interval between two drops of liquid will deviate, the final conversion result will have errors, so it is not adopted.

5.3 Software Flowchart

A. Speed ​​Control Flowchart


Figure 3 DC motor control flow chart

B. Flowchart of the communication program between the PC master station and multiple slaves

Figure 4 Master-slave station communication monitoring process

5.4 Communication Protocol

The communication between the master and slave stations requires a certain communication protocol. The communication protocol used in this question is shown in Table 1.

For example, the master station wants to query a slave station for its current status: the master station sends a query command to the slave station every 0.2s: "machine number (30H~3FH) + query word (0A0H)"; the slave station sends back the status: "machine number + current dripping speed + whether there is an alarm".

6. System Testing

Through actual testing, the photoelectric coupler with its own shaping circuit can still accurately test each drop of liquid after passing through the transparent tube wall of the dropper. Through the pulley placed on the top of the dropper rack, the DC motor can completely control the lifting and lowering of the dropper bottle. Although the control accuracy of the DC motor is not as accurate as that of the stepper motor in theory, through the PI algorithm and making the DC motor only travel 1/2 of the overshoot value each time, the system can still reach the required droplet stability value in 3 minutes.

7. Conclusion

The system uses a motor to control the liquid level and changes the pressure to change the drip speed in the drip tube. Coupled with remote monitoring by the main station, it can effectively reduce the pressure on medical workers. This system can be implemented at a low cost and equipment space. In addition, if an Ethernet interface is added, this system can fully meet the needs of large hospitals.

Keywords:MCU Reference address:Design of liquid dripping speed monitoring system based on 89C51

Previous article:Implementation of serial communication between PC and single chip microcomputer based on duplex mode
Next article:Design of digital thermometer based on AT89C2051

Recommended ReadingLatest update time:2024-11-16 19:35

Infrared drip infusion detection system based on 51 single chip microcomputer
1. Hardware Solution The system is based on the AT89C51 single-chip microcomputer, with infrared tubes as sensors, and uses the internal timer of the single-chip microcomputer system to calculate the time. The LM393 voltage comparator generates pulses. The single-chip microcomputer processes the pulses to make sound a
[Microcontroller]
Infrared drip infusion detection system based on 51 single chip microcomputer
Solar-LED Street Light Solution Based on STM32 MCU
As fossil energy is decreasing and the problem of global warming caused by excessive greenhouse gas emissions is becoming more and more important, people are actively developing various types of renewable energy on the one hand, and advocating green environmental protection technologies for energy conservation and e
[Power Management]
Solar-LED Street Light Solution Based on STM32 MCU
Design and implementation of control system transformation of CM402 high-speed placement machine based on PIC16F628 single-chip microcomputer
introduction With the continuous optimization of surface mount technology (SMT) and the rapid development of chip component manufacturing technology, the application of chip mounters in the electronics manufacturing industry has become increasingly prominent. The CM402 high-speed chip mounter is developed and p
[Microcontroller]
Design and implementation of control system transformation of CM402 high-speed placement machine based on PIC16F628 single-chip microcomputer
MCS-51 microcontroller interrupt system (1)
When the CPU exchanges information with peripherals, there is a contradiction between a fast CPU and a slow peripheral. To solve this problem, the concept of interruption was developed.       A single-chip microcomputer can only process one task at a time. When multiple tasks require the single-chip microcomputer to p
[Microcontroller]
51 single chip microcomputer realizes breathing light
I. Overview Use 51 single chip microcomputer to control LED to realize the gradual change process from dark to bright and then from bright to dark. II. Procedure #include STC15F2K60S2.H #include "MacroAndConst.h"   sbit LED = P1^5;   #define LED_ON() LED = 0; //LED is on #define LED_OFF() LED = 1; //LED off   #
[Microcontroller]
The hardware composition of AT89S51 microcontroller
    The hardware structure of the AT89S51 microcontroller is shown in Figure 2-1. It integrates the basic functional components required for control applications on a limited size integrated circuit chip, with the following functional components and features:      (1) 8-bit microprocessor (CPU).      (2) Data memory (
[Microcontroller]
The hardware composition of AT89S51 microcontroller
Based on 51 single chip microcomputer + infrared remote control decoding + LCD1602 display
basic introduction What is infrared? The visible light that human eyes can see is arranged from long to short in wavelength, namely red, orange, yellow, green, cyan, blue and purple. The wavelength range of red light is 0.62-0.76μm; the wavelength range of purple light is 0.38-0.46μm. Light with a shorter wavelength t
[Microcontroller]
Based on 51 single chip microcomputer + infrared remote control decoding + LCD1602 display
Wearable device business opportunities emerge, Cortex-M4 MCU demand surges
The market demand for high-end microcontrollers (MCUs) is hot. As smart watches, smart glasses and portable medical devices gradually become the rising stars of electronic products, various original equipment manufacturers (OEMs) have begun to introduce low-power and high-performance Cortex-M4 MCUs to develop products
[Analog Electronics]
Wearable device business opportunities emerge, Cortex-M4 MCU demand surges
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号