Ship cabin leakage alarm based on ARM SCM

If there is a leakage in the cabin of a sailing ship, it is a major accident that threatens the personnel and property of the ship. If we can’t take timely measures, there will be a devastating disaster. In order to judge the leakage of the cabin, it is necessary to set up a leakage alarm system, so as to achieve the purpose of detecting and alarming the leakage of the cabin, and avoid the occurrence of accidents. This paper discusses the design of ship cabin leakage alarm system based on ARM SCM. In order to ensure the stability and precision of the product, the hardware design of the alarm system is carried out, such as circuit design, software design, the programming of SCM, the software programming of upper computer, etc. It is hoped that it can be of reference value to interested readers.

The safety of the ships is very important for navigation field, among which the leakage of cabin is one of the major hidden dangers that threaten the safety of navigation, and this kind of accident is very frequent in the process of navigation. Once the cabin leakage accident occurs, not only will bring significant property losses, but also will cause casualties, resulting in irreparable damage. Therefore, experts have conducted a lot of research on the design and operation of the cabin leakage prevention and alarm system. At present, they adopt the ship cabin leakage alarm system based on ARM SCM, the ship cabin leakage can be monitored in real time through the design of sensor monitoring, upper computer software design, multi-channel voice alarm and so on, which is conducive to early processing and timely adoption of measures.

Overview of ship cabin leakage alarm system based on ARM SCM
ARM SCM is a kind of single-chip microcomputer with ARM processor as its core, it is a new product that appears with the improvement of intelligence and networking of electronic equipment in recent years. The ship cabin water leakage alarm system based on the ARM SCM has the functions of multi-channel display, visual control and voice prompt. The hardware part includes keyboard display, voice recording and playing, analog quantity acquisition circuit, serial communication circuitcircuit, etc., the software includes upper computer program and SCM program, etc.. Compared with the hardware of other SCM ship cabin leakage system, the chip of this system does not occupy the time of the CPU and can perform keyboard scanning by itself, the keyboard display part of the interface chip can be used to drive the digital tube and keypad, the working efficiency of the SCM is higher, that can perform repetitive playback, the recording time is longer, and the software of the lower computer can be programmed by C Language, the software of the upper computer is programmed by VB Language, the method is not simple, the statement is rich [1].

Hardware design of ship cabin leakage alarm system based on ARM SCM
The hardware part of the system, using the control mode of the monitoring room, including multi-channel voice alarm, audio microphone, upper computer, etc. All the hardware is connected and communicated through a multi-channel voice alarm circuit system, and the sensors are closely

Figure 1
The cabin water leakage multi-path alarm system chart As shown in the cabin water leakage multi-path alarm system chart, the measuring range of the liquid level sensor is 0-1m, the output current is 4-20MA, the switching circuit selects an analog switch, which can transmit all signals through the analog switch at the same time. Through the signal processing circuit, the current amplifies, forms the single chip microcomputer voltage quantity to reach 0.8-4V. The controller of SCM adopts an enhanced mode, built-in A/D converter, located at the core of the alarm, controlled by voice processing chip, and output voice through the speaker. On the other hand, after the digital quantity is collected, it is transmitted to the upper computer through serial communication and displayed on the interface. The Speech IC is additionally arranged on the microphone and the loudspeaker, and the keyboard display circuit comprises a programmable keyboard display interface chip, a digital tube device, etc., so that the keyboard can be scanned by oneself without taking up CPU time, and the mutual conversion between levels is realized. The program language is VB language. The technical indicators of the system include the input current of the alarm, leakage detection range, supply voltage, operating temperature, etc.
System technical index technical parameters specification Leakage detection range 0-1M accuracy 2% supply voltage 24VDC operating temperature 0-50℃ alarm input current 4-20MA Hardware circuit design including the lower computer system, reset circuit, crystal oscillating circuit, etc. The highest frequency of the processor of the lower computer can support 48MHz, instruction mode for a single cycle, it's 10 to 12 times faster than the general SCM, and it has a plurality of functional modules, which can carry out anti-interference on the motor and carry out intelligent communication [2].
The liquid level sensor adopts a stainless steel full-seal welding structure, the chip is an oil-filled structure, the key component of the circuit is a pressure sensitive core, the product has strong stability, the working principle is to convert the pressure signal into an electrical signal, and has the characteristics of leakage prevention and moisture resistance. Compact structure, flexible installation and simple use. The working state is that using the negative pressure, protect the circuit through the role of pressure, precision resistance in the conversion channel through software settings, and form a direct current signal in the liquid level. The control address code of SCM is ABCD, transmits the acquisition result to the pin after cyclic scanning, and the SCM performs A/D conversion. In the design of display circuit and keyboard, a microcomputer digital display system composed of digital tube and programmable display interface chip is used to display the scanning system. The system is scanned statically and dynamically, and the interface takes up CPU time. The circuit drive method is used to automatically scan the keyboard and measure and control the devices in real time.

Main technical specifications of liquid level transmitter
The digital tube display and keyboard drive circuit are linked with the digital tube through a buffer period, and the output driving current can drive seven sections of digital tubes, after obtaining the signal of the recovery line, and after waiting for 10ms in delay, the control state of the key is sent into a memory, and relevant data is obtained by automatically displaying the keyboard.
The hardware design of the recording and playback circuit converts the voice signal into a digital signal through the digital restoration function of the circuit to form a voice signal. Speech IC has played a great role, no matter what type of chip, can handle voice information and use SCM to control. The address code in the Speech IC stores each information segment, and the SCM can play the voice as long as it calls the address.
The chip includes on-record type, primary type, mask type, etc. A voice integrated circuit, a microphone, a loudspeaker and the like are adopted to form an independent voice playing system, The voice integrated circuit has the characteristics of voice reproduction and high quality, the manual switch and the microcontroller can be controlled, adopt the mode of level and edge triggering, carry out the direct cascade continuous playing, the power can be automatically cut off under the pressing mode, the microphone is provided with an oscillator on a chip, which can control the automatic gain and process the digital voice sample. In addition, the control line and the address can be connected to the microcontroller, and after the SCM receives the signal of the sensor, the pre-recorded voice is output by the voice processing chip.
The hardware design of serial communication adopts one-to-one data communication, the upper computer and the lower computer continue to prefer short-range serial communication, the maximum distance can reach 15 meters. The transport protocol belongs to a balanced half-duplex two-point pair transport mode. The working power supply can be 5V or 3.5V, and the communication mode is full duplex or half duplex mode. The former uses serial chips for logic point out, the latter increases the transmission and reception control port, allowing serial output, transmission distance, strong anti-interference ability. In the design, the network matching of resistance by using network terminal is also considered.

Software design of ship cabin leakage alarm system based on ARM SCM
The design of the software system of the upper computer adds a variety of features, a variety of applications, which can change the program and interface in real time, support the debugger, deployment programs and run project template. The software added Web development tools, visual designers and other functions, enhance the voice data function. The overall process of the upper computer software is to show the leakage of the cabin, the process is: initialization, and then start the serial communication, read the data sent by the lower computer, and then the cabin leakage data displayed on the upper computer [4]. Upper computer software flow chart The upper computer program design includes a number of controls, to show the depth and height of the leakage, using drawing controls, forming a pie chart, column diagram, etc.. The language using VB development language, select the icon type according to the number of columns and icon type, display icon object, set the numerical value, describe the chart elements behind the graphics, etc., just the figure shows the level of the liquid level, the vertical axis of the interface is the depth of water leakage, unit is cm.
Through the current output of the sensor, the control address code ABCD conduct circuit cycle acquisition, transmit the result to the pin of the SCM, after converted into A/D, the data is transmitted to the upper computer through the serial port and displayed on the window, including the cabin leakage data, etc. [5].
The design of the communication part refers to the communication between the upper computer and the lower computer, the collect data is displayed on that upper compute through software, and the lower computer is connected by mean of the control serial communication.
First, create a communication space in the dialog box, pull the control to the dialog box through the menu to select the project, set up monitoring control, open the serial port, to monitor events and measures.
The design of the lower computer, using C language for programming, download the program through the serial port, initialization SCM, Speech IC, etc., use the keyboard to scan, press the recording button, perform recording subroutine, perform serial number minus one function, test the pre-recorded speech output, use SCM to analog switch cycle scan, collect data, monitor the sensor analog switch, judge whether there is leakage.
Data acquisition program design, first，use ADC control register for initialization, then carry out real-time analog power supply operation, arrange a conversion channel inlet, store the conversion structure, and after the conversion is completed, the storage format auxiliary memory is controlled. Selecting a channel through a SCM selecting end, assigning a value of 0000, starting A/D conversion, querying whether the conversion mark is ended, storing the data in a register after filtering, and then returning the program until the channel stores data [6].
Serial communication program design, it is necessary to determine the working mode of the register, the use of automatic reassembly, the specific program is: first of all, use the method of pointing the pointer of the SCM to the storage unit is adopted and then start the serial and send data, if the data cannot be sent, it is necessary to wait until the data is sent.
For keyboard and display program design, it is necessary to wait for the normal work of the circuit, the execution of the query button command, at this time the system is in a state of waiting, press the button on the panel, execute the corresponding program, keys including plus one, subtract one, recording keys, etc., the main program is responsible for calling the keyboard and scanning keyboard, SCM to perform Speech IC playback and sentence conversion function. The program setting of recording and playback needs to be initialized by recording address, input pin through chip, high level select playback and low level, provide starting address, select playback address and pull pin down to high level. Enter playback mode to judge the effect of playback.

Conclusion
The design scheme of ship cabin leakage alarm system based on ARM SCM requires scientific design of hardware and software of the system, including the main program, A/D sampling subroutine, serial communication and other software design, and then design and install the ship cabin alarm. Practice has proved that the ARM SCN is ideal in control effect and reasonable in design, the data can be displayed conveniently and quickly, there is no problem of abnormal data reception, and the leakage alarm can be effectively controlled. It is worth mentioning that due to the accuracy of the sensor, the number of bits in the A / D converter, etc., is directly related to the error. Therefore, in the future design of cabin leakage alarm system, we should do more detailed and scientific research on the corresponding upper computer cable communication, voice alarm multi-channel operation, leak detection, sensor and so on. On this basis, a more precise and efficient multi-channel cabin alarm system is realized.