Design of harmful gas infrared sensing and voice warning control system

Publisher:zukeq2009Latest update time:2009-11-10 Source: 电子工程师 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0Introduction

The infrared sensing system is used to sense whether there are harmful gases nearby. When the infrared sensing system senses that harmful gases are approaching, it sends a high level that lasts for a period of time. The single-chip microcomputer starts the voice chip by opening an interrupt. The single-chip microcomputer communicates with the serial port, extracts the harmful gas parameters from the host computer, and prompts the nearby human body, and compares it with the safety value to determine whether the current environment is safe. For the use of the voice chip, the necessary text and digital information is first recorded. When playing, the single-chip microcomputer automatically addresses and reads the real-time parameters. In order to facilitate future system improvements or transplantation to other systems, recording and playback circuits can be designed to record different contents by switching. The system design is friendly and convenient, and the information given to people is more direct.

1 System overall design plan

Based on the existing available data of gas concentration, the connectivity and portability of the system are considered. The overall scheme of the system is shown in Figure 1.

The system is divided into four modules: core control module, voice circuit module, infrared sensing module and data reading. The system is designed to read and control the gas concentration under the premise that the gas concentration is an existing available resource. The core control module uses a single-chip microcomputer as the control device, and cooperates with appropriate peripheral circuits to control the operation of the entire system. The infrared sensing module is based on an infrared sensor, configured with a certain signal processing circuit, and sends signals to the single-chip microcomputer. The voice circuit is based on the voice chip, and two circuits for recording and playback are designed.

1.1 Design of core control module

The core control device uses a single-chip microcomputer, and its minimum system structure is shown in Figure 2.

This module is the core of the system. When the infrared sensing system senses the human body, it will send an interrupt signal. After receiving the signal, the microcontroller will execute the interrupt, read the gas concentration through the serial communication, then address the voice chip, and control the voice module to report the gas concentration. In addition to the basic peripheral circuits, the core control module mainly uses interrupts, serial communications and basic input and output functions.

In this system, the host computer communicates with the single-chip microcomputer through the serial port, and then the single-chip microcomputer processes it. After receiving the infrared signal, the single-chip microcomputer controls the voice chip to work and play the corresponding voice information. There are many optional single-chip microcomputers, such as AVR, AT89C51, etc. The advantage of using a separate control chip is to reduce the workload of the main control chip (CPLD) and improve the performance of the system. We chose the AVR single-chip microcomputer. AVR is a single-chip microcomputer based on the RISC (reduced instruction set computer) structure, referred to as AVR single-chip microcomputer. This series of single-chip microcomputers has made major improvements on the basis of absorbing the advantages of PIC and 8051 single-chip microcomputers. Compared with ordinary 51 series single-chip microcomputers, AVR single-chip microcomputers have many advantages. The first and most intuitive thing is that it has JTAG boundary scanning, simulation, and programming functions, which will not cause the previous phenomenon of passing the simulation but failing offline.

1.2 Design of infrared sensing module

This module is relatively simple. It uses an infrared sensor as its core. It only processes the signal simply and sends it to the interrupt of the microcontroller, as shown in Figure 3.

1.3 Design of data reading method

There are two ways to read data: one is to directly combine with the hardware circuit, read the 16-bit binary data, and sort and restore it; the other is to communicate through the serial port and read the data that has been sorted by the host computer through the RS-232 protocol. Obviously, compared with the first method, the serial port method avoids repeated data sorting and programming is simpler. For the entire project, the design is more reasonable and the development cycle is shortened.

This system uses serial data communication, and the interface is RS-232 serial port. Experiments have proved that this communication method is simple and easy to use, and meets the requirements of this system. This system uses a half-duplex configuration, which requires both the lower computer and the host controller to have independent sending and receiving capabilities.

The receive/transmit clock is used to control the speed at which the communication device receives/transmits character data. This clock signal is usually generated by the clock circuit inside the microcomputer. When receiving data, the receiver samples the received data at the rising edge of the receive clock and performs data bit detection. When sending data, the transmitter serially shifts the data in the shift register at the falling edge of the send clock and outputs it.

The relationship between the receive/send clock frequency and the baud rate is as follows:

Where: Fe is the receive/send clock frequency; n is the frequency coefficient, n=1, 16, 64; vc is the receive/send baud rate.

The relationship between the receive/transmit clock period Tc and the transmitted data bit width Td is:

Where: n=1, 16, 64.

If n=16, the process of asynchronous transmission and receiving data synchronization is as follows: the receiver samples the receiving data line at the rising edge of each receiving clock. When the receiving data line is found to be at a low level, it is considered to be the beginning of the start bit. If the receiving data line is detected to remain at a low level within 8 consecutive clock cycles (because n=16, so Td=16Tc), it is determined to be the start bit (not an interference signal). This method can not only eliminate the noise interference on the receiving line and identify the false start bit, but also determine the middle point of the start bit quite accurately, thereby providing an accurate time reference. Starting from this reference, the data line is sampled every 16Tc as input data. Generally speaking, starting from a falling edge detected on the receiving data line, if its low level can be maintained for nTc/2 (half-bit time), it is determined to be the start bit, and then every nTc time (one data bit time) is sampled at the middle point of each data bit.

2 Communication Software Design

The system communication software consists of three parts: the lower computer, the host controller communication software and the upper computer monitoring software. The lower computer communication software mainly receives the signal sent by the host controller, sends a response signal for each lower computer address, and then responds accordingly according to the control signal sent by the host controller, and then sends the data required by the host controller. Its communication function is realized by using the serial interrupt of the microcontroller and the method of querying the receiving and sending status flag. The lower computer usually collects data from each monitoring point and stores it regularly. When there is a serial interrupt, the serial interrupt service program is executed to determine whether it is the address information of the local machine. When the address information matches the local address, it switches to receiving control commands and performs corresponding operations; when the address information does not match the address of this station, the interrupt is exited. The lower computer communication flow chart is shown in Figure 4.

The communication software of the host controller mainly implements functions including calling each slave (lower computer) and sending query control commands to each slave. Its working process is: the controller sends the address of the slave to be called, and then waits for the response signal from the slave. If the response signal is correct, the control command is sent. If the response signal is incorrect, the address to be called is resent, and the response signal is received. After receiving the response signal, the data sent by the lower computer is received, stored in the corresponding data storage area and displayed on the LCD (liquid crystal display) screen. If the same slave is called multiple times and there is no response signal within the specified time or the response signal is incorrect, an error message is prompted. Figure 5 is a communication flow chart of the host controller.

The host computer monitoring software is written in Visual C++, with good visual effects, and its functions include data query, data storage, serial communication settings, video monitoring, chart display (single machine, multi-machine), etc. The data of the host computer comes from the host controller, which is transmitted to the host computer through the RS-232 serial network. Its interface is parallel to the interface of the RS-485 network. The standard interface has 25 lines, 4 data lines, 11 control lines, 3 timing lines, 7 spare and undefined lines, but only 9 are commonly used.

3 Conclusion

For this system, in addition to using the host computer software designed by yourself for debugging, you can also use a simple serial port debugger to achieve it. This system covers the single-chip microcomputer technology and some knowledge of analog and digital circuits. The system has certain controllability, stable operation, easy implementation, low cost, and high use value. After the system was built, the operation results showed that the system worked stably and reliably, and had broad prospects in the field of industrial control.

Reference address:Design of harmful gas infrared sensing and voice warning control system

Previous article:Design of multifunctional power supply based on single chip microcomputer AVR Butterfly
Next article:Design of I SP1362 OTG based on AVR microcontroller

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

C51 interrupt application interrupt and using
The basic structure of the 8051 series MCU includes: 32 I/O ports (4 groups of 8-bit ports); two 16-bit timer counters; full-duplex serial communication; 5 interrupt sources (2 external interrupts, 2 timer/counter interrupts, 1 serial port input/output interrupt), two-level interrupt priority; 128 bytes of built-in RA
[Microcontroller]
Interrupt (MCU interrupt)
    The results of all interrupts (external interrupts, timer interrupts, etc.) are the same: the running lights light up one by one, when the interrupt is responded, all the running lights go out, and when the interrupt ends, the running lights continue to flow.     Proteus schematic diagram: 1. External interrupt
[Microcontroller]
Interrupt (MCU interrupt)
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号