Design of multi-channel power failure alarm system based on keyboard scanning algorithm

Publisher:WhisperingWaveLatest update time:2012-07-31 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the development of contemporary communication technology, the application of technical equipment in aviation systems, military, industry and other fields has become the fundamental guarantee for business operation. Most equipment requires 24-hour uninterrupted power supply, which requires intelligent detection and real-time monitoring of the power supply in order to deal with power outages in a timely manner and ensure the normal operation of the equipment. In actual applications, in order to ensure that there is enough time to repair the power outage line, multiple power supplies are usually used in the equipment power supply to form a structure of one main, two backup and three emergency. Therefore, real-time detection of power outage lines and alarm in multiple power outage lines have become the key to timely restore normal power supply. This paper proposes an improved keyboard scanning algorithm, and through the design of relevant detection hardware circuits and monitoring software, intelligent detection, alarm and remote monitoring of multi-power supply systems are carried out.

1 System Structure
This system has been put into use in the beacon station room of the Civil Aviation Shantou Air Traffic Control Station. The basic structure of the design is briefly described below.
The hardware part of the system is mainly composed of detection hardware circuits, AT89C51 microcontrollers and their related components and PCs. The software part is the keyboard encoding of power-off signals, the improvement of keyboard scanning algorithms and the design of PC monitoring software. The specific implementation is to send a power-off signal to the microcontroller through the detection circuit. The microcontroller obtains the keyboard code corresponding to the power-off circuit through the keyboard scanning algorithm. The PC monitoring software sends different key codes to the microcontroller through serial port communication for related alarm processing, as shown in Figure 1.

b.JPG


In the beacon station room, there are three power supply lines: mains input 1, mains input 2, and diesel generator input. Under normal circumstances, the two mains are in standby mode, and the diesel generator is on standby and does not generate electricity (when both mains are off, the diesel generator starts to generate electricity in an emergency). Therefore, there are four power supply states:
(1) Normal situation, two mains are in power supply and the diesel generator is on standby;
(2) Only one mains is in power supply and the other one fails, so the diesel generator is on standby;
(3) Both mains fail and the diesel generator starts to generate electricity;
(4) Both mains fail and the diesel generator does not start.

c.JPG


For the above four states, state A can be set as the initial state of the monitoring system, and the remaining four power-off states (state B has two cases). The keyboard is coded separately so that each power-off state has a unique key code corresponding to it. The circuit design uses a 2×4 keyboard, and the hardware circuit is shown in Figure 2. Through key code recognition, the monitoring software on the PC can judge the power-off line in real time and issue an alarm.

2 System Design
2.1 Hardware Design
As shown in Figure 2, the circuit uses a photocoupler for strong electrical isolation to play a role in lightning protection, and converts analog signals into digital signals to achieve A/D conversion. The input 220 V AC is rectified by the rectifier diode D1 and filtered by the capacitor C1 to form DC.
The current is divided into two paths, one of which passes through the current limiting resistor R1 to make the indicator LED light up; the other path is sent to the photocoupler 4N25 after current limiting by R2, lighting up the internal light-emitting diode, turning on the photosensitive transistor, and obtaining a high level at the 4th pin of the photocoupler. When the input 220 V AC power is cut off, the voltage at the input end of the photocoupler disappears, the light-emitting diode goes out, the phototransistor is cut off, and the 4th foot gets a low level. After being processed by the relevant logic circuit, the control relay is energized (the relay replaces the keyboard button). Thus, the power-off signal is simulated into the state of the keyboard being pressed, which is convenient for the next step of processing.
2.2 Improved keyboard scanning algorithm
of single-chip microcomputer For the case of multiple power supplies, the line power-off signal can be keyboard-encoded to make it possible to identify multiple power-offs. Due to the circuit's requirements for alarm real-time and accuracy, an improved keyboard scanning algorithm is adopted. Experiments have shown that the algorithm has a good effect in the application of the system. Real-time detection of power-off signals is an important indicator of system accuracy. Since the traditional keyboard scanning algorithm will shield the interrupt while the jitter algorithm is called, it is necessary to improve the keyboard scanning algorithm.
The algorithm improvement is mainly divided into three steps: First, set the interrupt variable in the interrupt running program and record the number of runs. Determine whether the number of interrupt executions meets the delay time, and then determine whether the keyboard is pressed (that is, whether the power-off signal is true). Secondly, each call to the keyboard scanning analysis program requires 10 ms synchronization. When the key is detected for the first time, only a flag is set. When the key is detected for the second time (10 ms apart from the first key), key analysis is performed to achieve alarm accuracy and improve the real-time performance of the system. Finally, the system encodes the signal according to different states. The three-way circuit is encoded into four unified and independent key codes due to four different states, which reduces the complexity of key code analysis and improves the real-time performance of the system.
2.3 Design of monitoring software based on VC++6.0
The monitoring software is designed on the VC++6.0 platform. The software mainly consists of three parts: system settings, operating status and status display. The interface is simple and convenient for monitoring. The system sets the function of resetting the system status display, selecting the communication serial port and the communication test.
The communication test is mainly used for daily maintenance. For this system, the communication link between the microcontroller and the PC is crucial. The communication test of daily maintenance can reduce the risk of the system going offline without alarm. In the operating status module, the monitoring software provides two-way mains operation report and oil engine status report, as shown in Figure 3.

a.JPG


The status display can intelligently show the power-off lines, realizing unmanned on-site supervision and remote monitoring, as shown in Figure 4.

d.JPG



3 Conclusion
This paper proposes a design of a multi-channel power failure alarm system based on an improved keyboard scanning algorithm. The simplicity and feasibility of the keyboard scanning algorithm are used to perform keyboard encoding on the multi-channel power failure line signals. The terminal monitoring alarm software identifies the corresponding keyboard code of the power failure signal and issues an alarm on the power failure line. This system simplifies the general power failure alarm system. In practical applications, the system is simple to implement, the power failure time is at the μs level, and the alarm is accurate. It has been put into practical use.

Reference address:Design of multi-channel power failure alarm system based on keyboard scanning algorithm

Previous article:Design of a missile-borne secondary power supply
Next article:Practical Design of Single-Supply Snubber Circuits

Latest Power Management Articles
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号