当前位置:网站首页>Design of Fire and Anti-theft System Based on Single Chip GSM
Design of Fire and Anti-theft System Based on Single Chip GSM
2022-07-31 22:48:00 【salted fish】
目录
【功能介绍】
This system has set up a based onGSMThe security systems on the network and short message platform,设计中采用了STC89C52单片机系统、无线GSMSMS module and sensor technology.Through to the main control module、通信网络、传感器模块、SMS module and interface circuit of the control.Implements the system of remote alarm and control functions,可以实现如下功能.
(1)该设计包括硬件和软件设计两个部分.模块划分为数据采集、单片机控制、GSMSMS alarm module, such as child function.
(2)系统可实现功能.当人员外出时,Can set the alarm system in the state,Detector begin to work,当有人闯入时,热释电红外传感器将探测到动作,And SMS alarm,To send a short message to realize remote anti-theft alarm function.
【原理图】
【PCB】
【实物图】
【元器件清单】
21-GSM防火防盗系统 | ||
名称 | 型号 | 数量 |
单片机 | STC89C52 | 1 |
IC座 | DIP40 | 1 |
万能板 | 9*15cm | 1 |
晶振 | 11.0592M | 1 |
电解电容 | 10uF | 1 |
电解电容 | 1000uf | 1 |
瓷片电容 | 22pF | 2 |
电阻 | 10K | 3 |
电阻 | 1K | 4 |
电阻 | 2K | 1 |
LED红 | 5MM | 1 |
LED绿 | 5MM | 1 |
蜂鸣器 | 有源 | 1 |
三极管 | S9012 | 1 |
按键 | 5 | |
显示屏 | LCD1602 | 1 |
排针 | 16P | 1 |
排母 | 16P | 1 |
人体红外模块 | HC-SR501 | 1 |
排母 | 3P | 1 |
温度传感器 | DS18B20 | 1 |
烟雾传感器 | MQ-2 | 1 |
模数转换器 | ADC0832 | 1 |
IC座 | 8P | 1 |
GSM模块 | SIM800c | 1 |
电源座 | 5MM | 1 |
电源线 | 5V2A | 1 |
自锁开关 | 1 | |
继电器 | 1 | |
小水泵 | 1 | |
导线 | 若干 | |
焊锡丝 | 若干 |
【源程序】
#include<reg52.h>
#include<intrins.h>
#include "sim800.h"
#define uchar unsigned char
#define uint unsigned int
#define K_MG_MV 120/66
typedef unsigned char U8; /* defined for unsigned 8-bits integer variable 无符号8位整型变量 */
typedef unsigned int U16; /* defined for unsigned 16-bits integer variable 无符号16位整型变量 */
unsigned char aa,bb,cc;
/********测试GSM是否启动**********/
int test_boot;
/********测试GSM是否注册网络**********/
int test_net_register;
/********GSM串口接收数据缓存**********/
unsigned char idata GSM_receive[60];
/********GSM串口接收计数器**********/
unsigned char GSMDATA_count;
unsigned char *content_fire = "Please note that! There are fire,no thief!\r\n"; //请注意!No thief,有火灾!
unsigned char *content_thief = "Please note that! There are thieves, no fire!\r\n"; //请注意!有盗贼,无火灾!
unsigned char *content_fire_thief = "Please note that! There are thieves, there are fires!\r\n"; //请注意!有盗贼,有火灾!
unsigned char str_yw[12];//烟雾值
unsigned char T_baojing = 30; //温度报警值
unsigned int C_baojing = 200; //烟雾浓度报警值
unsigned char T_buff[3]; //Temperature alarm value shows the cache
unsigned char C_buff[4]; //Smoke alarm value shows the cache
bit sdbj_flag=0; //Manual warning mark
bit sf_flag=0; //设防标志
bit sf_flag_buff=0; //Cloth start timing mark
unsigned char moshi=0;//设置模式
unsigned char data1; //ADConvert the median
long Value;// AD转换结果值
/*******引脚定义********************/
sbit Infra = P3^2; // 人体红外模块
sbit bADcs=P3^4; // AD converter pin definition
sbit bADda=P3^5; // AD converter pin definition
sbit bADcl=P3^6; // AD converter pin definition
sbit baojing=P3^7; //手动报警
sbit BUZZER = P2^0; // LED蜂鸣器
sbit shuibeng = P2^1; //水泵
sbit fengshan = P2^2; //风扇
sbit sf_led = P1^3;// 设防指示灯
sbit shefang= P1^4;// 设防按键
sbit shezhi = P1^5; // 设置
sbit jia = P1^6; // 加
sbit jian = P1^7; // 减
unsigned char IntToString(unsigned char *str, int dat);
extern bit Start18B20();
extern bit Get18B20Temp(int *temp); // ;;;;;、‘
extern void InitLcd1602();
extern void LcdShowStr(unsigned char x, unsigned char y, unsigned char *str);
float intT, decT; //温度值的整数和小数部分
/*------------------------------------------------
定时器初始化子程序
------------------------------------------------*/
void Init_Timer0(void)
{
TMOD |= 0x01; //使用模式1,16位定时器,使用"|"符号可以在使用多个定时器时不受影响
TH0=(65536-1000)/256; //重新赋值 1ms
TL0=(65536-1000)%256;
EA=1; //总中断打开
ET0=1; //定时器中断打开
TR0=1; //定时器开关打开
PT0=1; //Priority to open
}
long kssj() //开始收集
{
unsigned char i;
bADcs = 0;//当ADC0832未工作时其CS输入端应为高电平,此时芯片禁用.
bADcl=0;
bADda=1;
bADcl=1;
bADcl=0;//i down
bADda=1;
bADcl=1;
bADcl=0; // 2 down
bADda=0;
bADcl=1;
bADcl=0; // 3 down
bADda=1;
bADcl=1;
bADcl=0; // 4 down
for(i=8;i>0;i--)
{
data1<<=1;
bADcl=0;
bADcl=1;
if(bADda==1) data1|=0x01;
bADda=1;
}
bADcs=1;
Value=data1*1.0/256*500;
Value=Value*K_MG_MV;
Value=Value-5;
if(Value<0)Value=0;
return Value;
}
void Key_set_scan()
{
if(baojing==0)
{
Delay_Ms(10);
if(baojing==0)
{
while(!baojing);
sdbj_flag =~sdbj_flag;
}
}
if(shezhi==0)
{
Delay_Ms(10);
if(shezhi==0)
{
while(!shezhi);
InitLcd1602(); //初始化液晶
moshi++;
if(moshi >= 3)moshi = 0;
if(moshi == 0)
{
/*1234567890123456*/
LcdShowStr(0,0,"T: C S: PPM");
LcdShowStr(0,1," ");
}
else if(moshi == 1)
{
LcdShowStr(0,0," ");
LcdShowStr(0, 1,"Set_T: C");
}
else if(moshi == 2)
{
LcdShowStr(0,0," ");
LcdShowStr(0, 1,"Set_C: PPM");
}
}
}
if(jia==0)
{
Delay_Ms(10);
if(jia==0)
{
while(!jia);
if(moshi==1)
{
T_baojing++ ;
if( T_baojing>=99 )T_baojing =99;
}
if(moshi==2)
{
C_baojing++ ;
if( C_baojing>=999 )C_baojing =999;
}
}
}
if(jian == 0)
{
Delay_Ms(10);
if(jian == 0)
{
while(!jian);
if(moshi==1)
{
T_baojing-- ;
if( T_baojing<=0 )T_baojing =0;
}
if(moshi==2)
{
C_baojing-- ;
if( C_baojing<=0 )C_baojing =0;
}
}
}
if(shefang == 0)
{
Delay_Ms(10);
if(shefang == 0)
{
while(!shefang);
if(sf_flag == 0)
{
sf_flag_buff = 1;
sf_led = 0;
}
else if(sf_flag == 1)
{
sf_flag = 0;
sf_led = 1;
BUZZER = 1;
}
}
}
}
本文介绍了在设计的过程的关键点,供大家参考学习,如果有错误或者不明白的可以直接私信作者,或者添加微信biyezhan007.
其他资料
【原理介绍】
MQ-2气体传感器所使用的气敏材料是在清洁空气中电导率较低的二氧化锡(SnO2).当传感器所处环境中存在可燃气体时,传感器的电导率随空气中可燃气体浓度的增加而增大.使用简单的电路即可将电导率的变化转换为与该气体浓度相对应的输出信号.MQ-2Gas sensor for liquid gas、丙烷、The high sensitivity of hydrogen,For natural gas and other combustible vapor detection is ideal.这种传感器可检测多种可燃性气体,是一款适合多种应用的低成本传感器.封装好的气敏元件有6只针状管脚,其中4个用于信号取出,2个用于提供加热电流.基本电路如图.
【参考文献】
[1]Wen-yan tang. 传感器. 哈尔滨工业大学出版社, 2007. 15~16
[2]Read the east. Microcontroller based practical tutorial. 中国地质大学出版社, 2005
[3]赵茂泰. 智能仪器原理及应用. 电子工业出版社,1999. 43~46
[4]Wu Zhengjiang. Single-chip microcomputer control infrared burglar alarm. Jinzhou teachers college journal, 2001, 27(12): 55~59
[5]Song Wenxu. 传感器与检测技术. 高等教育出版社, 2004
[6]李全利. 单片机原理及接口技术. 北京航空航天大学出版社, 2004. 75~78
[7]Xue are righteous. Yan-bin zhang. MCS-51Series single chip microcomputer and its application. 西安交通大学出版社, 2005
[8]康华光. 电子技术基础(模拟部分). 高等教育出版社, 2004
[10]徐爱钧, 彭秀华. 单片机高级语言C51应用程序设计. 北京: 北京航空航天大学出版社, 2006. 97~99
[11]邓凯. The application of intelligent residence security system. Metallurgy mine design and construction, 2000. 98~99
[12]赵晶. Prote199高级应用.北京: 人民邮电出版社, 2000. 101~103
[13]Zhen-hong wang,李洋.基于DTMFSignal transceiver chipMT8880The direct interface design[M],Electronics and automation,1999,5(2):23-56.
[14]刘波,Han Xianzhong.MT8880In the application of the machine room monitoring system[J],Journal of hebei academy of sciences,1999, 16(4):53-56.
[15]XinDeQiang.X25045与8051的接口技术[J],电子技术应用,2002,4(12):20-22.
[16]石波,Chen Zichun.Single-chip microcomputer is used to implement voice prompt、报警系统[J],Coal mine automation,2001,6 (5):43-44.
[17]Pan Guizhong,Ding Yi,JiLan flowers.The design of microcomputer automatic dialing burglar alarm[J],The modern electric in the technology,2003,8 ( 1 ):67-69.
[18]Li Guihua.The design of the home security alarm system[J],计算机应用,2000,6 (9):31-33.
未经作者允许,不得抄袭转载,转载或有问题请私信或微信作者.
边栏推荐
- Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
- #yyds dry goods inventory# Interview must brush TOP101: the entry node of the ring in the linked list
- 网络安全--通过握手包破解WiFi(详细教程)
- TestCafeSummary
- [QNX Hypervisor 2.2用户手册]9.14 set
- Istio introduction
- Talking about the algorithm security of network security
- Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios
- The old music player WinAmp released version 5.9 RC1: migrated to VS 2019, completely rebuilt, compatible with Win11
- The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
猜你喜欢
Unity-通过预制件和克隆方法动态实现各个UGUI下控件的创建和显示
How to debug TestCafe
Redis Overview: Talk to the interviewer all night long about Redis caching, persistence, elimination mechanism, sentinel, and the underlying principles of clusters!...
面试突击69:TCP 可靠吗?为什么?
Implementing a Simple Framework for Managing Object Information Using Reflection
Audio alignment using cross-correlation
Chapter VII
The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
Flex layout in detail
Binary tree non-recursive traversal
随机推荐
A few permanent free network transmission, convenient and simple (Intranet through tutorials)
BOW/DOM (top)
如何减少软件设计和实现之间鸿沟
ThreadLocal
Niuke.com brush questions (1)
10大主流3D建模技术
flowable workflow all business concepts
【ACM】2022.7.31训练赛
Pytorch lstm time series prediction problem stepping on the pit "recommended collection"
TestCafeSummary
LeetCode 第 304 场周赛
Several methods of mysql backup table
@JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
Audio alignment using cross-correlation
NVIDIA has begun testing graphics products with AD106 and AD107 GPU cores
Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
-xms -xmx(information value)
利用反射实现一个管理对象信息的简单框架
UOS统信系统 - WindTerm使用
Golang must know the Go Mod command