Research on text sound and light warning system based on SD card

Publisher:乘风翻浪Latest update time:2013-11-18 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Abstract: Taking railway crossing application as an example, an information data storage warning system based on SD card is designed. When a warning is needed, the system can issue corresponding warning information through manual operation or automatic triggering, including LED display screen displaying text warning information, voice system playing warning voice, and flashing warning lights for light warning.

  The original data of text and voice warning information is stored in the SD card. To meet different application requirements, only the content in the SD card needs to be modified, which can be applied to a variety of application scenarios.

  0 Introduction

  Voice or text warnings are often required in security, transportation, construction and other fields, such as security restricted areas, road traffic intersections or construction sites. This warning system is developed based on the application of railway crossings, which can provide early warning information to avoid accidents.

  With the continuous increase in railway speed and density and the rapid increase in road vehicles, the safety issue of railway level crossings has become very prominent. Level crossings are divided into section and station, and guarded and unguarded. Since most of the station crossings are located in densely populated urban areas with frequent economic activities, the number of road traffic vehicles is increasing day by day. The railway driving operations near many station crossings are very complicated. The main line, dedicated line, shunting line, etc. are connected in all directions. There are many lines leading to the crossings, and it is difficult to link with the station signal. All these factors restrict the process of converting level crossings into overpasses. This determines that the level crossings in the station will continue to exist for a considerable period of time in the future to serve transportation production.

  Level crossing safety is an important part of railway transportation safety. A railway level crossing is the plane intersection of any railway and highway. It is a complex system involving multiple management departments (railway, highway, local, etc.), consisting of people (drivers, traffic participants), vehicles (locomotives, cars, etc.), equipment (level crossing characteristics, safety devices, highway geometry, etc.), and environment (weather, sight distance, vehicle speed, etc.). Level crossing traffic is a weak link in railway transportation safety production and a dangerous area for road transportation. It directly threatens the personal safety of traffic participants. Setting up a warning system at a railway level crossing can issue a warning message before the train approaches the level crossing, prompting the level crossing guards, pedestrians, and passing vehicles to pay attention, thereby effectively avoiding the occurrence of level crossing traffic accidents.

  1 Railway Crossing Warning System

  Figure 1 shows a schematic diagram of a railway crossing. A-1 and A-2 are infrared detectors, B-1 and B-2 are crossing railings, C-1 and C-2 are flashing warning lights, LEDs and other text display devices are set at reasonable positions of D-1 and D-2, E is a horn speaker, K1 and K4 are train arrival detection sensors, and K2 and K3 are train departure detection sensors. According to the control requirements of the railway crossing, the arrival and departure of the train must be converted into electrical signals, which can be achieved by using sensors; then the detected electrical signals are sent to the corresponding circuits for processing to generate output signals; and then the output signals are used to drive the actuators to complete the corresponding functions such as the rise and fall of the crossing railings, voice broadcasts, and text displays, so as to achieve the purpose of warning pedestrians and vehicles.

  

  The railway crossing warning system adopts the overall design shown in Figure 2, which is mainly composed of a trigger source, a control system, and a system function realization module. The trigger source is composed of a button, an infrared detector, a sensor, etc. The trigger source sends the external trigger signal to the control system for corresponding processing. The control system is the central processing system of the entire system, which can process the obtained detection signal accordingly, control the work of each part through the combination of hardware and software, and realize the various functions of the system. The function realization module includes four functions: text display, light warning, voice playback, and controlled device action.

  

  2. Design of warning system

  According to the design requirements of the railway crossing warning system, the single-chip microcomputer C8051F340 is used as the core main control chip. This chip has rich peripheral interfaces, low power consumption, high cost performance, and can meet the needs of the crossing warning system.

  The design of the warning system is shown in Figure 3, which mainly includes SD card circuit, MP3 decoding circuit, power amplifier circuit, serial communication circuit, train movement detection circuit and crossing guardrail lifting and lowering control circuit.

  

  The buttons are mainly controlled by the duty personnel, who can trigger the buttons according to the specific situation to play a warning role; the infrared detector is installed before the crossing railing. When a warning is needed, it will be triggered when a passerby forces his way through. At this time, the trigger signal will be sent to the control circuit, and there will be corresponding voice broadcast and text information display; the train movement detection circuit is mainly used to detect the arrival and departure of the train. Its circuit is mainly composed of sensors, and magnetic steel sensors can be selected. The sensors collect the movement information of the train and send the detection signal to the single-chip microcomputer for processing; the serial interface is mainly connected to the text display device, which can be an LED display or a video display device (text can be superimposed on the video); the flashing warning light can be used for light warning, especially at night to effectively warn pedestrians and vehicles in the distance; the SD card mainly stores the text and voice content of the warning for the convenience of system call; the crossing railing lifting circuit controls the lifting of the crossing railing to prevent pedestrians and vehicles from passing when the train arrives; the voice decoding chip uses VS1003B, which can decode the voice file read by the single-chip microcomputer and output it in the form of voice. The chip supports MP3 and WMA file formats. The power amplifier circuit amplifies the decoded warning voice content and then sends it to the horn speaker for playback; the microphone is placed in the crossing room for the on-duty personnel to make voice calls in emergency situations.

  The functions of the warning system are as follows: when there is no train passing, the flashing lights of the crossing do not work, the crossing railings are raised, and the text display device can display the train's passage time and the prompt information to remind passing vehicles and pedestrians to pass safely; when a train arrives, the sensor K1 or K4 detects the train arrival signal, and the single-chip control circuit receives the train arrival signal from the sensor. At this time, the crossing railing is lowered through the control circuit, and the single-chip microcomputer calls the relevant text warning and voice files from the SD card. The voice file is in MP3 format, and the warning text information is in TXT file format. Considering that the playback time of the voice file is long, the single-chip microcomputer first reads the corresponding TXT file in the SD card, and sends the hexadecimal file stored in the file to the LED or video character display device through the serial port. After that, the single-chip microcomputer opens the relevant MP3 format audio file stored in the SD card, and the audio data is transmitted to the audio decoding chip VS1003B through the SPI bus for decoding. After decoding, it will be sent to the horn speaker through the power amplifier circuit for playback, and the flashing warning light is turned on, thereby realizing the text and sound and light warning of the passing of the train to pedestrians and passing vehicles. The infrared detector is installed at a suitable position before the crossing guardrail. When the crossing guardrail is lowered, the infrared detector will be triggered when the pedestrian approaches. The trigger signal will drive the single-chip microcomputer to call the relevant warning content from the SD card for text and sound and light warning to warn the pedestrian not to go forward. If the pedestrian continues to go forward, the duty personnel in the crossing room can press the corresponding button to make the system display the pre-made text warning information and play the pre-stored voice warning information, and can also use the microphone to make a severe voice warning. When the train leaves, the sensor K2 or K3 detects the train leaving, and the detection signal drives the single-chip microcomputer to perform corresponding actions, including the crossing guardrail rising, the flashing warning light stops flashing, the horn stops the warning voice broadcast, and the text display device displays the train's passage time and the information of running vehicles and pedestrians passing. If an emergency occurs, the duty personnel can also use the microphone to broadcast voice to warn pedestrians and passing vehicles.

  3 Naming rules for files in SD card

  There are two file formats written in the SD card. One is an audio file in MP3 format. The naming and file content of each audio file are different. The content of the voice file can be recorded according to the specific application. It should be noted that the sampling rate of the voice file must not be higher than 128 Kb/s. The other is a text file in TXT format. The relevant hexadecimal code of the alarm information is written in the text file. The naming and encoding rules and content of each text file are also different. It is used to display the specific content of the train arrival or departure or warning information on the text display device. In order to facilitate file management, the first bit of the MP3 file is determined as A, and the first bit of the TXT file is determined as C. The same naming rules can be used for the other bits of the two file names when they correspond to the same alarm event.

  3.1 MP3 file naming conventions

  When an event occurs, the player will play a warning voice, but the content played for different events is different, and the names of the audio files are also different.

  When naming audio files, a 4-bit encoding method is used. The first bit is A, representing the Audio file, and the remaining 3 digits are expressed in hexadecimal, each of which represents a different meaning. The second bit represents the corresponding information bit triggered by the key, the third bit represents the train arrival and departure information bit, if this bit is 1, it means that a train is coming, and the fourth bit represents the infrared detector trigger information bit. For example, the voice content of A010.MP3 is "The train is coming, pedestrians and vehicles should pay attention to safety and do not cross the railings."

  3.2 Naming rules for character file names

  When an event occurs, the text display device will display specific warning content in text. Different events display different warning information, and the encoding of each text file is also different. Each text file is written with the hexadecimal code of the text to be displayed by the text display device. When naming the text file, the 4-bit encoding format is also used. Its naming method is the same as that of the audio file. For example, the text file C010.TXT stores "The train is coming. Vehicles and pedestrians are prohibited from passing."

  4 Transmission and display of text warning information

  The text display device is mainly an LED display device, and a video (character overlay) display device can also be used. The LED display device is installed at D-1 and D-2 as shown in Figure 1. The video display device is mainly installed inside the duty room to provide text information display for the duty personnel. Here, the LED device is mainly used as an example to illustrate its working process.

  The text file used for text warning in the SD card should be made in accordance with the requirements of the LED text display device. The display text of C010.TXT made according to the requirements of this system is "Train is coming. Vehicles and pedestrians are prohibited from passing". The content of its TXT file is "01D60400000000007F001F000101000A0100020002BB02F002B302B502BC02B402BD02AB02B502BD02C002B40200020002B302B502C102BE02D002D002C802CB02BD01FB01D601B901CD01A801D001D001AA", a total of 82 bytes. Among them, the first 21 bytes are display parameter settings; the 22nd to 81st bytes are the combination of the GB2312 code of the displayed text and the display color. For example, the GB2312 code of the word "禁" is "BDFB", and the combination here is "BD01FB01", where "01" means the word is displayed in red, and "02" means it is displayed in green; the last byte AA is the end mark byte.

  Since the content of the character file stored in the SD card is stored in hexadecimal form, when an event occurs, the microcontroller receives the corresponding trigger signal and calls the corresponding TXT format text file in the SD card. It should be noted here that the hexadecimal code in the text file read by the microcontroller is actually the ASCII form of the code. The microcontroller needs to convert the ASCII code into hexadecimal and then send it to the LED display module through the serial port. The LED device selected in this system needs to handshake when the microcontroller communicates with it. The process is that the microcontroller first sends 0101 to the LED module through the serial port, and then receives the confirmation data 01 sent back by the LED. After that, the display data needs to be sent once within 3s, and finally the warning content is displayed on the LED display module. When using the serial port debugging assistant to connect the LED device, you must pay attention to the time limit within 3s. The flowchart of LED display is shown in Figure 4.

  

  5 Conclusion

  This article takes the railway crossing application as an example to design a text, sound and light warning system based on SD card. Since the voice and text information of the warning system is stored in SD card, the text and voice content can be easily modified, so it can be used in other occasions, such as security, ordinary intersections, construction sites, schools, museums, etc., just need to change the warning content in the SD card to the corresponding warning content on site, without changing the software program and hardware circuit. At the same time, this system can expand circuit modules such as Ethernet to achieve remote control.

Reference address:Research on text sound and light warning system based on SD card

Previous article:Physical design of microprocessor chip in wireless fire monitoring system
Next article:Discussion on the design of parking fee collection system based on NFC+3G technology

Latest Security Electronics 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号