Design of a new medical call intercom system based on PIC microcontroller

Publisher:MindfulCreatorLatest update time:2011-03-13 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This paper introduces a new type of medical call intercom system based on single-chip microcomputer. It is used for timely communication between medical staff and patients. The main and extension units of this system are based on PIC series single-chip microcomputers, adopt power carrier technology, and use the two-core power cord of the system to realize the co-line transmission of voice signals and control signals. The system has the functions of real-time processing of extension call requests by the host, dialing extensions, displaying and recording bed calls, etc., which meets the needs of remote monitoring in hospitals. Actual use shows that the system has high reliability. It has low power consumption, easy installation, and strong practical value.
Keywords: medical call intercom system; dual-tone multi-frequency; audio separation and compounding; single-chip microcomputer

The medical call system is a calling tool for patients to make requests when they need care or diagnosis. It can quickly convey the patient's request to the doctor or nurse on duty. It is one of the necessary equipment to improve the hospital's nursing level. As a bridge between patients and nurses and doctors, it is increasingly showing its practicality and superiority. It plays a very important role in improving the comprehensive level of the hospital, improving service quality and service efficiency, and resolving conflicts between doctors and patients caused by accompanying care. Most of the early medical call systems adopted a centralized structure. Each ward was connected to the nurse's room through a signal cable. This type of system has the disadvantages of high cost, difficult installation and debugging, and high failure rate. This article introduces a new type of call system. The host and ward extension are both implemented with PIC series microcontrollers. The host and extension are not connected by computer communication ports, but power carrier technology is used to realize data communication and voice communication through the power lines provided by the host to each extension. The whole system is simple to install and easy to maintain, which greatly improves the practicality of the device.

1 System Overall Design
The system consists of four parts: host, extension, display and control. The buttons on the telephone and the list are the input part of the control. The host and the patient list display window are installed at the nurse station in the ward, the LED display is installed in the corridor, and the extensions are set at each bedside of the ward. The structural block diagram is shown in Figure 1. Once someone presses the call button at the bedside of the ward, the host of the nurse station will ring or the phone will ring. At the same time, the corridor display will synchronously display the call bed number, and the nurses can immediately rush to the ward to deal with the emergency.

a.JPG
The system adopts the centralized power supply mode of the host and the power carrier technology. The power supply is provided through the power line connecting the host to each extension and the electronic display screen. At the same time, the half-duplex data communication and full-duplex voice communication between the host and the extension are realized through the power supply cable, and the simplex data communication between the host and the electronic display screen is realized. The system can work continuously for 24 hours and has static protection and lightning protection functions.
The system adopts one host and multiple extensions. The host and the extension communicate in a two-wire system. Each extension is connected to the bus and powered by the host. Each extension has a unique address number, which is used to identify when communicating with the host. When the host calls the extension, it wakes up all extensions and sends the extension address code through the bus. The extension compares the received address code with its own address code. Only the same extension will start the call circuit, and no response will be made if it is different. When the extension calls the host, the host sends the received extension number to the phone through DTMF to ring and display the incoming call, and sends it to the display module at the same time. The host can make a call when it picks up the phone. Each extension is awakened only when it is called or queried, and data is transmitted on the bus. When no communication is taking place, it is in a "sleep" state, thus achieving energy-saving effects.

2 Call system hardware design
2.1 Host hardware design
The host mainly includes the main control board, display device, telephone, and power supply. The functional block diagram is shown in Figure 2.

b.JPG The main control board needs to complete the following functions: signal reception and transmission, information display, and information storage. According to the demand analysis, the main control CPU must be powerful and resource-rich. Here, Micro-chip's PIC16F877A is selected, which has a high-performance RISC CPU, 10-bit multi-channel digital/analog conversion, all GPIO pins have the function of triggering interrupts when the level changes on the pins, and 128 B of data E2PROM memory. When the main extension recognizes the start signal, it will trigger the interrupt code reception. Figure 3 is the host code transmission circuit. When the host sends a signal, the RESP pin controls the conduction and cutoff of the transistor QS3 to control the high and low changes of the bus voltage. Figure 4 is the host code reception circuit. The signal sent by the extension to the host is shaped and amplified, and then sent to the phase-locked loop LM567 to modulate it into a level signal that the PIC16F877 A can recognize. LM567 sets the center frequency through the timing elements Rt and Ct connected to pins 5 and 6. The relationship is: f0≈1/(1.1RtCt). The operating frequency can be continuously changed in the range of 0.01 Hz to 500 kHz. The system sets the center frequency to 100 kHz. The 8th pin is connected to RB7 of 877A. The pin of RB port has the function of level trigger interrupt. When the 100 kHz signal is input to pin 3, the 8th pin outputs a low level to trigger the 877A interrupt to start receiving code. Normally, the 8th pin remains at a high level.

c.JPG


2.2 Extension Hardware Design
The CPU of the extension uses the PIC12F629 of the PIC series. This single-chip microcomputer is used to reduce the cost and size of the extension; secondly, it is used to reduce the power consumption of the extension. The power amplifier uses the built-in compensation type low-noise dual operational amplifier NE5532. The extension block diagram is shown in Figure 5.
The extension is connected to the bus without distinguishing between positive and negative poles and is powered by the host. When there is no signal transmission, the voltage on the bus is 9 V DC. After passing through the series voltage regulator circuit composed of transistors, a stable voltage of 5 V is provided to the extension chip. When the bus is idle, each extension is in a dormant state. At this time, the transistor Q6 on the extension is cut off, so that the operational amplifier NE5532 is in an off state. The power consumption of each extension is very small. When there are many extensions on the bus, a small static working current flows through the bus to ensure the normal operation of the system. L1 is a red and green dual-color light used to indicate the status of the extension. L1 is off when the extension is dormant. The host calls the extension. The extension's pin GP0 is the receiving end of the downlink call signal. When the CIN pin receives the start signal, it is awakened, and then determines whether the start signal is valid. If it is valid, it starts to receive the code. If the connection condition is met, the CLKIN pin outputs a high level, the transistor Q6 is in a saturated conduction state, and the op amp NE5532 is powered, then the extension is in the intercom state. Otherwise, GP2 remains low, the transistor is in a cut-off state, and the extension returns to the dormant state. The extension calls the host. Press the button on the bedside or handle, the extension CPU outputs a call signal from the GP4 pin, which is amplified by Q5 and coupled to the bus. The extension waits for the answer and L1 emits green light; after the host answers, GP5 outputs a high level, the transistor is in a saturated conduction state, NE5532 enters the working state, and L1 emits red light, indicating that the extension is in the intercom state. When the extension is in the intercom state with the host, the downlink audio signal passes through the bus, is amplified by the op amp, and drives the extension speaker to sound. The uplink voice signal is amplified by the operational amplifier and coupled to the system bus through transistor Q7.

3 Communication method and transmission protocol
At present, some call systems on the market use CAN bus protocol and MCU with CAN communication module, but such MCU is generally expensive; others use DTMF (dual tone multi-frequency) transmission protocol, that is, DTMF signal codec chip is used, and the main extension sends DTMF signal to communicate, that is, the main machine uses DTMF signal codec chip, which also has the problem of high cost. Therefore, in the design of this system, considering the principle of stable communication, only DTMF signal codec chip is used on the main circuit, and the communication protocol is written. By increasing the complexity of software design, the product cost is reasonably reduced. 3.1 Extension code sending method
The extension code uses a 100 kHz square wave, which is output by the GPIO4 pin of the microcontroller and coupled to the bus through a transistor. When the extension calls, it sends a square wave of a certain length, as shown in Figure 6. The signal that the extension replies to the host is an intermittent square wave, as shown in Figure 7.

d.JPG


3.2 Host code transmission method
The host code transmission adopts variable length duty cycle to send code elements, where a duty cycle of 1:1 represents code element 0, and a duty cycle of 3:1 represents code element 1. The schematic diagram of host code transmission is shown in Figure 8.

e.JPG
3.3 Communication protocol
To ensure the reliability of the communication process, the following communication protocol is specially formulated: the host code data format is specified as: control command + extension address, each time 11 bits of data are sent, of which bit11~bit9 are command codes, and the low byte is the number of the specified extension. When the host sends the code, it first sends the start signal, and the extension starts to receive the code after recognizing the start signal. The extension number is stored in each E2PROM, and the initial value is set to 0. The host can encode it online. After receiving the host's number change command, the LED indicators of all extensions light up, prompting the user to press the button. After the modification is successful, a confirmation signal will be returned to the host, otherwise it will time out and exit without processing. The extension will only be awakened after actively calling or recognizing the host's start signal. It is usually in a dormant state, which greatly saves power consumption.
When the host queries, after each query of an extension, it first detects whether the phone is off-hook. If the phone is off-hook, the off-hook process will be executed. The busy flags of all extensions will be set from the beginning of the query, which does not allow the extension to send codes when calling. At this time, the host can still detect the extension calling, but there is no square wave transmission on the bus, so the stability of communication is guaranteed.
When the host and extension are communicating by voice, other extensions can still make calls. Since the square wave of the request signal is 100 kHz, and the voice frequency range is 0.3~3.4 kHz, the host will query the called extension only when the phone is on hook, and there will be no interference. Therefore, the voice signal and the digital signal can be transmitted on the bus at the same time. When the extension calls, it sends a 100 kHz square wave to the bus. The host detects a low level by the receiving circuit, triggering an interrupt to receive the code. Then the host will first shield this incoming call interrupt, and then start to query in order according to the level of bed care. If the extension is queried, it will reply with an answer signal, and the extension that has not been called will not answer. After the query, the incoming call level interrupt is restored, and a command is sent to notify the extension to reset the busy flag.

4 Design and implementation of main extension software
4.1 Workflow
The system host and extension communication software mainly includes two parts: sending and receiving. The sub-sending module and the host code receiving process are shown in Figure 9 and Figure 10 respectively. Each extension needs to contain the extension address code and the broadcasting machine flag. This information is stored in the E2PROM. When the extension is started for the first time, the initial value is written, and the extension information is only read from the specified address in the future. The address allocation is shown in Table 1.

f.JPG
In order to ensure the accuracy of the code and make the waveform more accurate, the code module is improved by assembly language, and the code cycle is controlled by parameters to send a 100 kHz square wave with an accuracy of microseconds. The frequency error is less than 5% after experimental measurement. The receiving code is read by a timer. Since the host uses variable-length coding, the extension decoding process needs to make a 1 or 0 threshold judgment according to the protocol; the host decoding is mainly completed by the phase-locked loop integrated chip LM567, and the extension reply code is divided into two types: with or without reply.
4.2 System Stability
This system solves the conflict between the call and request bus very well. Since the host always queries from extension 1 to the last one, the extension cannot send a 100 kHz square wave when the host queries. Therefore, the bus will not be disturbed, the bit error rate is greatly reduced, and the extension request will not be missed. Even in the extreme case of 100 extensions calling at the same time, the host can respond one by one. The host uses variable-length coding, and the extension uses a timer to read the code, and is equipped with a counting state machine, so that the CPU can accurately decode and eliminate the impact of glitches, ensuring the accuracy of the receiving code. The host and extension also use state machines in the main loop, use global variables to switch between states and use variables and flags to control, reasonably allocate CPU resources, and be able to handle the most urgent events in a timely manner. Hanging up the host phone can also reset the input variables, and even if the operation is wrong, it can still be canceled by hanging up.

5 Conclusion
The system uses carrier technology to achieve two-wire non-polarity connection, making installation and construction very simple. The extension uses a low-power regulated power supply and a PIC microcontroller, which makes the extension have low power consumption, so that the system has good scalability. The communication distance between the host and the extension is greater than or equal to 1,000 m, and the number of extensions is greater than or equal to 100, which can meet the requirements of hospitals of various sizes, and an interface is reserved for communication with a PC. On the basis of stable communication, economical chips are used, which have the advantages of simple installation and wiring, easy detection and maintenance, and saving design costs. The prototype developed in this paper has been verified by experimental operation to verify its effectiveness and practical value, and has been put into small-scale trial production, with good prospects for promotion and application.

Reference address:Design of a new medical call intercom system based on PIC microcontroller

Previous article:Application of PIC16LF874 single chip microcomputer in capacitance measurement module
Next article:PIC16C55 single-chip microcomputer controls a multi-purpose electronic clock

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号