Optimization Design of smoke alarm based on MSP430

Source: Internet
Author: User
Optimization Design of smoke alarm based on MSP430
[Date: 2008-10-22] Source: World Electronic Components by Li Peng Wang Ting Wu yanwen, Huazhong Normal University [Font:Large Medium Small]

 

 

Introduction

Traditional smoke alarms are generally composed of Smoke sensors and smoke detection chips. The detection chips receive and process sensor signals to determine whether a fire has occurred. This smoke detector has simple structure and low cost, but has the disadvantages of high false positive rate and poor environmental adaptability. To solve this problem, the microcontroller is embedded into the alarm to identify interference signals generated by the sensor due to environmental impact. However, this introduces other problems: (1) using a general single-chip microcomputer, such as 51 single-chip microcomputer, will greatly increase the power consumption of the alarm, this is unacceptable for smoke alarms that require battery power for a long time; (2) sensors generate weak analog signals, this signal can be processed by a single-chip microcomputer only after being amplified or converted to a modulus. The use of independent A/D conversion circuit not only increases the power consumption of the system, but also reduces the reliability of the system; (3) the microcontroller software design is unreasonable, resulting in A high false alarm rate, operation Control is not flexible.

In view of the above situation, a smoke alarm is designed with TI's MSP430 microcontroller as the core device. The fuzzy filtering algorithm is used in the software design to improve the monitoring capability and adaptability of the single chip microcomputer to the environment.

System Hardware Design

About MSP430

The MSP430 Series single-chip microcomputer is a 16-bit Ultra-Low Power hybrid digital signal processor launched by TI. It integrates many analog circuits, digital circuits, and microprocessor into one chip to meet actual application requirements. MSP430 is a 16-bit single-chip microcomputer based on a simplified instruction set (RISC) structure. When an 8 MHz crystal oscillator is used, the instruction speed can reach 8 MIPS. The power supply of MSP430 single-chip microcomputer is 1.8v ~ 3.6v low voltage. The power consumption of Ram data is only 0.1 μA, and the maximum leakage rate of I/O input ports is 50na. MSP430 has normal working mode (AM) and 5 low-power working modes (lpm0 ~ Lpm4 ). When the power supply voltage is 3 V, the current in various modes is AM: 340 μA, lpm0: 70 μA, lpm2: 17 μA, lpm3: 2 μA, lpm4: 0.1 μA, single-chip microcomputer can easily switch between various working modes. The ultra-low power consumption of MSP430 makes it outstanding in alarm systems, portable devices, and other applications with extremely demanding power supply requirements. The MSP430 Series Single-Chip Microcomputer integrates TI's high-performance simulation technology. All members integrate a wide range of on-chip peripherals (depending on different models ), these peripherals include multi-channel and high-precision ADC and DAC, In-chip analog comparator, multiple timers with PWM function, in-chip usart, hardware multiplier, LCD driver, watchdog timer (wdt) in-chip Numerical Control Oscillator (DCO), a large number of I/O ports, and large-capacity in-chip memory can meet the needs of most applications. The high integration of MSP430 makes it easy for application staff to design a monolithic system in a true sense without having to spend too much effort on various peripherals.

This design uses msp430f2254. Its main parameters are as follows: 16 KB Flash ROM, B-bit Ram, 32 I/O Ports, 12-Channel 10-bit ADC, 3 16-bit Timer A and 3 16-bit timer B.

Hardware Circuit Design

Smoke Detection Circuit

Smoke detection uses photoelectric sensors, sensors and amplification circuit 1. The sensor circuit consists of the infrared transmitting tube D1 and the infrared receiving tube D2. The detection signal is amplified and received by the microcontroller.

D1 and D2 are placed in the photoelectric sensor chamber (also known as the maze). There is an obstacle between the two. The infrared rays emitted by D1 cannot be directly received by D2. When smoke enters the maze, the infrared rays are received by D2 after being reflected by smoke, and then converted into electrical signals to detect the existence of smoke. The single-chip microcomputer outputs high and low levels by the I/O port P1.6 at intervals, controls the D1 to emit infrared rays and stops the emission to detect smoke. Sensors work intermittently to reduce power consumption. The power supply of the integrated op amp is provided by the MCU P1.5. Similarly, only when the sensor is working, the op-amp scales up the received signal to avoid continuous operation to reduce power consumption. After the signal is amplified, the/D converter in the MSP430 chip is entered through the P1.4 pin of the microcontroller, which avoids the design of an independent A/D conversion circuit, which not only reduces power consumption, it also improves the system reliability. P1.4 serves as the input channel A7 of the ADC.

Alarm Circuit

Alarm Circuit 2. The timer A in MSP430 can generate pulse width modulation (PWM) signals with adjustable cycle and duty cycle. The PWM signal is output from the P1.3 pin and the buzzer is driven after the transistor is amplified. The duty cycle of the PWM signal is set to 50%. Changing the signal frequency can adjust the sound size of the buzzer. The system is set to 1 kHz (when the frequency is 1 kHz, the maximum number of decibels of the alarm sound of this alarm is reported ).

Low Voltage Monitoring Circuit

After a long period of work, the battery voltage gradually decreases, so that the alarm system cannot be properly operated. Smoke alarm has strict requirements on the Stability of battery power supply. This smoke alarm has automatic monitoring function for low voltage power supply.
Low Voltage monitoring circuit 3. P1.1 outputs high levels to enable Q4 and Q5. The pressure drop of VDD on R11 enters the/D converter in the MSP430 chip through the P1.2 pin of the microcontroller. At this time, P1.2 serves as the input channel A2 of the ADC. After A/D conversion, the voltage signal is compared with the preset safe voltage threshold to determine whether the power supply voltage is normal. As shown in figure 3, VDD indicates the voltage of the system powered battery. This alarm is powered by a 9 V Dry Battery. After voltage conversion, the VDD becomes a VCC of 3.3V.

System Software

Signal Data Processing

Although many smoke alarms use single-chip microcomputer to process signals, there is still a high false positive rate. One important reason is that the signal processing is not reasonable. In the program design of signal data processing, the alarm system adopts the fuzzy inference filtering method to improve the system's adaptive capability and reduce the false positive rate.

The environment of the fire scene is complex, and the fire signal is also random. The smoke parameters detected by the sensor are unpredictable and uncertain. Environmental changes and noise in the detector system may interfere with smoke parameters. The data converted from A/D must be filtered, it also requires that the signal processing algorithm be able to adapt to the changes of various environmental factors, and automatically adjust the alarm parameters to quickly detect fire and reduce the false positive rate.

The Fuzzy Logic Theory in Fuzzy Mathematics is a good solution to the problems that are difficult to determine by using accurate calculation and boolean logic. Therefore, in software design, the signal data processing program uses a fuzzy logic algorithm to solve the relationship between the ambiguity of external interference and the change of alarm threshold, so as to improve the reliability of the detector. First, blur the smoke signal after A/D conversion. The details are as follows: when the smoke signal value x is less than the threshold B0, no fire is considered; when the signal value x is greater than the threshold B1, it is considered that there is a fire. When the signal value x is between the B0 and B1 thresholds, it is considered that there may be a fire, and the greater the value of X is close to B1, the more appropriate the fire occurrence is. The fuzzy membership function is as follows:

In formula, a is the fuzzy amount that reflects the likelihood of fire, and f (x) is the corresponding affiliation.
The Influence of Interference Signals in the external environment is transient. The window moving filtering method can be used to improve the anti-interference capability. The filter function is as follows:

The window size is 5. When the value of f (x) is not zero for five consecutive times, the K value is calculated to determine whether the K value exceeds the threshold K0. If K is greater than or equal to K0, an alarm is triggered immediately, otherwise, no alert is reported.

In the above signal data processing process, fuzzy A is a temperature-related value. While detecting smoke, the alarm also uses temperature sensors to monitor the ambient temperature. The relationship table between A and temperature is pre-stored in the single-chip microcomputer. The single-chip microcomputer searches for the relationship table based on the monitored ambient temperature to determine the value of. The threshold values B0, B1, and K0 are the values related to the alarm accuracy. They must be properly set to ensure that the alarm can greatly reduce the false positive rate when the alarm accuracy conforms to national standards.

Application Design

IAR embedded workbench is an integrated development environment that supports Ti MSP430 processors. It supports compilation, simulation, and debugging of assembly languages and C languages. To enhance the readability and portability of the software, C language is used to develop applications.
The application design adopts the modular design idea. The whole program includes two parts: the main program and the interrupt service subroutine. The main program consists of the initialization module and the smoke signal processing module. The interrupt service subroutine consists of smoke signal detection and sampling modules, Low Voltage Detection modules, and system self-check modules. The smoke signal detection and sampling process is shown in step 4.

Some key points in the software design: (1) When initializing the program, the unused pins in the single chip microcomputer should be set to the output state to reduce power consumption. (2) In the sampling program, the power-on and Stability of the photoelectric sensor and the signal amplification circuit takes some time, so it takes A period of time before enabling the/D converter, wait until the sensor and amplifier circuit are stable, as shown in figure 4. (3) in single-chip microcomputer, the CPU runs independently from the peripheral modules. The low power consumption mode of MSP430 single-chip microcomputer should be used flexibly to reduce the power consumption of the entire system. For example, in the signal sampling process, the ADC is responsible for signal sampling and conversion as a peripheral, And the CPU can enter the low power consumption mode and wait until the conversion ends. (4) Besides the input/output and external module functions, the P1 and P2 ports of MSP430 single-chip microcomputer have the function of switching and interrupting each port, the interrupt service program with these switches can implement some additional functions.

Conclusion
The MSP430 is embedded in the smoke alarm. On the one hand, the alarm performance is enhanced to make it more intelligent, and on the other hand, the Development difficulty is reduced. There are a large number of MSP430 single-chip microcomputer models. developers can make reasonable choices based on product functions and costs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.