GSM Home Security Alarm Based on ATmega16

Publisher:真诚相伴Latest update time:2011-11-15 Source: 互联网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: At present, people have an increasing demand for home fire prevention, anti-theft and remote control of household appliances. At the same time, mobile phones have become a communication tool that residents carry with them. Based on this, an automatic SMS security alarm system based on the GSM module is designed, which can remotely control household appliances through mobile phones and integrates fire and intrusion alarms. The system is controlled by an AVR ATmega16 microcontroller with an external GSM module as the control host, and is operated by SMS with passwords. It can set 8 groups of user phone numbers, can send Chinese SMS alarms, and has an infrared microwave dual-detection anti-theft and fire detection wireless communication interface. There are 2 wireless control relay output terminals, which can be linked to power supply, video recording, etc. Finally, the actual test shows that the system has a good detection effect.
Keywords: home security alarm; ATmega16; GSM; dual identification

0 Introduction
With the construction of a large number of modern residential areas in China, people's demand for fire prevention, anti-theft and remote power on and off of household appliances is increasing. In the current society, mobile phones have become a communication tool that residents carry with them every day. Based on this, this paper designs a security alarm system based on the GSM module, which can remotely control the power on and off of household appliances through mobile phones, integrates fire and intrusion alarms, and can automatically send Chinese alarm text messages to the owner.

1 System Structure
As shown in Figure 1, the schematic diagram of the GSM security alarm system, this system uses an AVR ATmega16 microcontroller with an external GSM module as the control host. The host is operated by SMS with passwords, and 8 groups of user phone numbers can be set. Chinese SMS alarm, the system has 3 wireless detectors (infrared microwave anti-theft, smoke alarm) wireless communication interface, and 2 wireless control relay output terminals, which can be linked to power supply, video recording, etc. The 3 wireless detectors are composed of infrared pyroelectric sensors, microwave sensors, smoke sensors and wireless transceiver modules. Infrared pyroelectric sensors and microwave sensors together constitute a microwave infrared composite intrusion detector, and the smoke sensor is mainly used for fire detection. Once the system is turned on by the owner through a mobile phone text message, if an illegal intrusion or a fire is detected, the system will immediately send a text message to the owner of the set user number (up to 8 mobile phone numbers). At the same time, in order to facilitate the owner to control the power on and off of household appliances when leaving home, this system also provides two wireless switches for remote control on and off, and users can control the remote wireless switches through text message commands.


As shown in the system host structure diagram in Figure 2, the system host is mainly composed of MCU (ATmega16 microcontroller), GSM (TC35i) and level conversion module, delay interface circuit (monostable trigger) and display module (12865LCD), 315 MHz transmitting circuit, 315 MHz and 433 MHz receiving circuit and power adapter module (AMS1117-3.3 and KIS3RR3 step-down module).

1.1 GSM and level conversion module
The GSM module uses Siemens industrial-grade GSM module TC35i. Since the level of TC35I UART is 2.9V TTL level, it cannot be directly connected to ATmega16. Therefore, as shown in the level conversion circuit in Figure 3, two simple NOT gates are used for level conversion at the RXD end and a current limiting resistor is connected in series at the TXD end. Since TC35I has high requirements for power supply (it will reset if the voltage drops more than 400 mV), and the current peak value during data transmission will reach 2.5 A, 3 300μF large-capacity electrolytic capacitors are connected in parallel near TC35I to reduce the requirements for power supply.


1.2 Delay interface circuit and display module
This system receives external wireless signals in the form of inquiries. In order to prevent signal loss and to be compatible with wireless modules with the same encoding on the market, this paper designs a monostable delay interface circuit. The schematic diagram of the circuit is shown in Figure 4. When the base of Q1 is at a high level, the power stored in C2 is released, and the comparator outputs a high level. When the base drops from a high level to a low level, C2 is charged through R3, and the potential of the inverting terminal of the comparator rises slowly. Once the voltage of C2 is higher than Vref, the comparator flips and outputs a low level, thereby achieving the purpose of delay.


The display part is composed of ST7920LCD, and the LCD is connected to the MCU using SPI. When a button is pressed, the LCD backlight is triggered. In the wireless interface part, since the probability of the anti-theft alarm, smoke alarm, and SMS remote control being triggered at the same time is very small, the entire system does not need to use too many frequencies for communication. The host uses a 315 MHz wireless module to control the wireless switch, while the pyroelectric infrared and microwave displacement sensors use two different frequencies of 315MHz and 433MHz to send alarm signals to the host, so that the alarms do not interfere with each other. The smoke sensor uses a frequency of 315MHz to send signals to the host.
1.3 Host wireless transceiver module
The wireless transceiver module is mainly composed of a wireless encoding chip SC2262, a wireless decoding chip PT2272, a 315MHz transmitting module, and a receiving module. When the host controls the wireless switch, the wireless encoding chip SC2262 is used. The address setting is consistent with the receiving part PT2272, and the oscillation resistor should be matched. When the MCU is powered on or the host receives a remote control text message, the MCU first changes the PD4~PD7 level according to the wireless switch status stored in the EEPROM, and then the MCU will send a low-level pulse with a width of 1s to the 16th pin (TE) of PT2262, so that SC2262 encodes the data of PD4~PD7 and then outputs it from the 17th pin to the 315 MHz transmitter module.
Since some detection sensors on the market only send a high level "1" when the wireless transmitter module is triggered, the host decoding chip cannot use the latched PT2272L4, otherwise the data output by PT2272L4 will always be high level, which will always generate false alarms. Therefore, in order to better be compatible with market products, the wireless receiving part of the host of this system uses a non-latched PT2272M4 chip to connect to the 315 MHz and 433 MHz receiving modules respectively. In this way, when someone invades and triggers the alarm, the signals sent by the two alarms will not interfere with each other because they are on the same frequency, resulting in decoding errors, thus avoiding the situation where someone invades but the host does not alarm. The smoke alarm receiving part and the microwave alarm use the same PT2272 M4 and receiving module. Since the signals emitted when the infrared, microwave, and smoke alarms are triggered are discontinuous and asynchronous, the received signal will be made high level for 3 s by the 3-way monostable trigger, which improves the accuracy of MCU sampling judgment.

2 System software flow
The system software flow chart is shown in Figure 5.



3 System test
Microwave sensors and infrared sensors are installed against the wall at a height of 3 to 5 m. The infrared sensor is tested from three different angles, namely, facing, 30° to the right of the front, and 45° to the right of the front. The effective sensing distances are shown in A, B, and C in Figure 6. The microwave sensor is tested from three different angles, namely, facing, 30° to the right of the front, and 135° to the right of the front. The effective sensing distances are shown in A, B, and C in Figure 7. The maximum sensing straight-line distance of the infrared sensor is 7m, the optimal use distance is 6m, and the sensing angle is 90°. The maximum sensing straight-line distance of the microwave sensor is 9m, and it is effective in all directions at close range, and the optimal use distance is 5m.



4 Conclusion
The automatic SMS security alarm system designed in this paper adopts pyroelectric infrared and microwave dual sensors, which greatly reduces false alarms and missed alarms, and improves the reliability of the security alarm system application. The AVR ATmega16 microcontroller is connected to a GSM module as the control host. As long as it is within the GSM network range, the user can remotely alarm no matter where he is; SMS with password operation increases the security of the system; 8 groups of user phone numbers can be set, and Chinese SMS alarms can be sent; it has an infrared microwave dual-detection anti-theft wireless communication interface, provides remote wireless switch function, and has 2 wireless control relay output terminals, which can be linked to power supply, video recording, etc. The design of this paper improves the performance of security products and reduces the cost of the system.

Reference address:GSM Home Security Alarm Based on ATmega16

Previous article:Design of accelerated life test system for electromagnetic relay
Next article:Discussion on the Engineering Design Method of Harmonic Suppression

Recommended ReadingLatest update time:2024-11-16 19:27

Source code of program-controlled filter based on ATmega16 microcontroller
#include avr/io.h #include avr/signal.h #include avr/interrupt.h #include util/delay.h #define uint unsigned int #define uchar unsigned char static uchar interrupt ,count; static uchar b; forget to; SIGNAL(SIG_OVERFLOW1)/*Overflow interrupt*/ {      TCNT1H=0X7F;    TCNT1L=0XFC;    interrupt++;    if(interrupt==a)
[Microcontroller]
ATmega16 calculator code (digital tube display)
The microcontroller source program is as follows: /**********************************************************************/     /**Counter button**              (1) (2) (3) (4)         (5) (6) (7) (8)         (9) (0) (C) (=)         (+) (-) (*) (/)                  10: Clear 11: Confirm 12: Add 13: Subtract 14: Mult
[Microcontroller]
Design of residual current protection device detection system based on GSM
0 Introduction Residual current action protector is an important protection device in low-voltage power grid. Real-time status monitoring of residual current action protector in the intelligent transformation of rural power grid can greatly improve work efficiency and save labor costs. In view of the large and scatter
[Microcontroller]
Design of residual current protection device detection system based on GSM
ATMEGA16 realizes the production of switching power supply
A switching power supply is a power supply that uses modern power electronics technology to control the time ratio of the switch on and off to maintain a stable output voltage. With the ATMEGA16 microcontroller as the control core, a switching power supply with adjustable output voltage step was designed and manuf
[Power Management]
ATMEGA16 realizes the production of switching power supply
Design of wireless measurement and control system based on microprocessor LPC2131 and GSM module
1 Introduction With the development of embedded computer technology and communication technology, people's requirements for wireless measurement and control technology are also constantly increasing. Measurement and control technology also relies on the development of powerful network communication technology and is a
[Microcontroller]
Design of wireless measurement and control system based on microprocessor LPC2131 and GSM module
Design and implementation of voice recording and playback system based on ATMEGA16
cutting edge   The method of using magnetic tape to record, store and restore analog voice signals has a long history. Electronic products based on this method can be seen everywhere. Moreover, these products are very large and are subject to certain limitations in terms of scope of use. The single-chip voice record
[Microcontroller]
Design and implementation of voice recording and playback system based on ATMEGA16
ATmega16 fuse settings
1. Factory settings of M16 Internal RC oscillator 1MHz 6 CK + 65 ms CKSEL=0001 SUT=10 JTAGEN=1 By default, JTAG is programmed (i.e. PC2-PC5 is high and cannot be pulled down). If PC2- PC5 is to be used as a normal IO port, you need to cancel JTAG programming, or execute the following command at the beginning of the pr
[Microcontroller]
ATmega16 fuse settings
CAN bus and RS-232 converter circuit based on single chip ATMega16 control
    CAN (Controller Area Network) bus is a serial data communication protocol developed by BOSCH of Germany to solve the data exchange between many controls and tests in modern automobiles. It is a multi-master serial communication bus. CAN bus is an open, digital, multi-point communication control system local area n
[Microcontroller]
CAN bus and RS-232 converter circuit based on single chip ATMega16 control
Latest Power Management 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号