Smoke alarm system based on labview

Publisher:brian808090Latest update time:2015-09-10 Source: eefocusKeywords:labview Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
 Equipment: Computer (with labview installed), one SL-1 single-chip microcomputer development test box, one MQ-2 gas module, and ADC0809 chip.

Functions: Monitor gas concentration in real time through the host computer and compare it with the alarm threshold set by the host computer. If the gas concentration exceeds the alarm value, the upper and lower computers will alarm at the same time. Change the gas alarm value in real time and transmit it to the lower computer for judgment through the host computer.

Circuit diagram: Refer to ADC0809 datasheet and MQ-2 gas sensor module parameters. The sensor outputs 0~5V analog voltage according to the gas concentration and inputs it to the analog input terminal of 0809.

Debugging: Use the serial port debugging assistant to check the correctness of data transmission.

program:

#include

#include

#include

#define uchar unsigned char

#define uint unsigned int

sbit CLK=P3^3;      //Clock output

sbit ST=P2^0; //Start conversion input signal

sbit OE=P2^1;    //Enable output signal

sbit EOC=P3^2;               //Using interrupts, the priority is lower than T0 interrupt

 

uchar DATA; //Store A/D conversion data

sbit Beep=P2^7;

uchar aa;

void delayxms(uint x) //delay

{

uint i,j;

for(i=x;i>0;i--)

for(j=110;j>0;j--);

}

 

void delayxus(uint x) //delay xus

{

uint i;

for(i=x;i>0;i--)

_nop_();

}

 

 

void init(void)

{

TMOD=0x22; //Timer 0 automatically reloads 8 bits to generate CLK, and timer 1 sets serial port parameters

TH0=237; //50kHZ

TL0=237;

TL1=0xf3;

TH1=0xf3;//2400bps

TR1=1;

TR0=1;

 

SM0=0;

SM1=1;

 

EA=1;

ET0=1;

EN=1;

REN=1;

 

ST=0;

OE=0;

}

 

void ADC0809()

{

ST=0;

OE=0;

//LE=1;P0=0x00;LE=0;   //Select channel

delayxus(2);

ST=1;   //Start AD conversion

delayxus(10);

ST=0;

delayxus(200);

 

while(EOC==0);   //When EOC=1, the conversion is complete

YOU=1;

DATA=P1; //DATA is the data after AD conversion

delayxus(20);

OE=0;

}

[page]

 

void main()

{

Beep=1;

heat();

 

while(1)

{

ADC0809();

if(aa==49)Beep=0;

else Beep=1;

delayxms(200);

}

}

void serial() interrupt 4

{ uint r;

RI=0;

r=SBUF;

aa=r;

if(r==48||r==49)

{

   SBUF=DATA; //Send to the host computer

while(!IF);

IF = 0;

}

}

 

void T0_time() interrupt 1

{

   CLK=~CLK;

}

Smoke alarm system based on labview


Smoke alarm system based on labview
Keywords:labview Reference address:Smoke alarm system based on labview

Previous article:Smoke alarm system based on labview
Next article:How to generate executable files/setup files in LabVIEW

Recommended ReadingLatest update time:2024-11-16 21:40

Design of Engine Fuel Consumption Test System Based on LabVIEW
0 Introduction Virtual instrument is an instrument developed on a computer using a graphical programming language (G language). It combines a simple and easy-to-use graphical development environment with a flexible and powerful programming language, providing users with an intuitive environment. It has been
[Test Measurement]
Design of Engine Fuel Consumption Test System Based on LabVIEW
LabVIEW Basic Concepts
是一种程序开发环境,由 美国 国家仪器(NI)公司研制开发的,类似于C和BASIC开发环境,但是LabVIEW与其他计算机语言的显著区别是:其他计算机语言都是采用基于文本的语言产生代码,而LabVIEW使用的是图形化编辑语言G编写程序,产生的程序是框图的形式。 The concept of virtual instrument (VI)   Virtual instruments are computer- based instruments. The close integration of computers and instruments is an important direction for the curre
[Test Measurement]
The combined application of Tektronix oscilloscope and Labview
Tektronix 3014B has always been my best friend. I have been using it since 2002. I have a good understanding of its various uses and performances. In practice, I use it for both experiments and production line installations. I think its functions are really powerful. The easy-to-use operation mode and flexible
[Test Measurement]
The combined application of Tektronix oscilloscope and Labview
Design of resolver/digital conversion system based on virtual instrument
introduction Track plotter (hereinafter referred to as track plotter) is a very important navigation equipment, which is used to automatically calculate the position of the ship and automatically plot its track on the Mercator chart. When the track plotter fails and enters the factory for repair, it is nece
[Analog Electronics]
CNC machine tool network measurement and control system based on LabVIEW--key network communication technology (Part 1)
  4 Research on key network communication technologies for remote measurement and control systems of CNC machine tools   There are two basic modes for building a network measurement and control system for CNC machine tools based on the Internet: C/S and B/S. The two communication modes have their own advantages and
[Test Measurement]
CNC machine tool network measurement and control system based on LabVIEW--key network communication technology (Part 1)
Meteorological Monitoring System Based on LabVIEW
The automatic weather station is relatively large in size, and the location and space when it is used will be affected by the location and space. If you take advantage of the advantages of virtual instrument technology such as easy development, small size and convenient use, you can use virtual instruments to replac
[Test Measurement]
Meteorological Monitoring System Based on LabVIEW
Introducing the LabVIEW Wireless Sensor Network (WSN) Module Pioneer
Overview Wireless communication technology is ubiquitous due to its freedom, flexibility, distributed capabilities, and low cost. Wireless sensor networks (WSNs) are gradually becoming the next wave of wireless technology, supporting distributed measurements in large-scale physical systems. With WSNs, you can m
[Test Measurement]
Latest Test Measurement 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号