Repairs Design Furniture

Creating an alarm on the Arduino motion sensor. Home alarm or using motion sensor and LCD monitor with Arduino. Key Features SIM900 SHIELD

Are special hardware platforms, on the basis of which you can create various electronic devices, including. The devices of this type are characterized by a simple design and the ability to program the algorithms of their work. Due to this, created with Arduino GSM. signaling , It can be maximally adjusted for an object that it will guard.

What is the Arduino module?

Arduino is implemented in the form of small boards that have their own microprocessor and memory. The board also contains a set of functional contacts to which various electrified devices can be connected, including the sensors used for security systems.

The Arduino processor allows you to upload a program written by the user on your own. Creating its own unique algorithm, you can provide optimal modes of operation of security alarms for different objects and for various conditions use and solved tasks.

Is it difficult to work with Arduino?

Arduino modules are highly popular among many users. This became possible due to its simplicity and accessibility.

Programs for managing modules are written using conventional C ++ and add-ons in the form of simple input / output process management functions on the module contacts. In addition, the programming can also use the ARDUINO IDE free software environment operating under Windows, Linux or Mac OS.

The Arduino modules are significantly simplified the procedure for assembling devices. GSM alarm Arduino can be created without a need for a soldering iron - the assembly occurs using a bold board, jumpers and wires.

How to create alarm with arduino?

To the basic requirements that the GSM created the alarm on Arduino must include:

  • notify the owner of the object of hacking or penetration;
  • support external systems such as sound siren, signal lights;
  • control signaling via SMS or call;
  • offline work without external food.

To create alarm, you will need:

  • arduino module;
  • a set of functional sensors;
  • or modem;
  • offline power supply;
  • external executive devices.

A distinctive feature of Arduino modules is the use of special extension boards. With their help connecting all additional devices To Arduino, which are required to build configuration security system. Such cards are installed on top of the Arduino module in the form of "sandwich", and the corresponding auxiliary devices are connected to the board themselves.

How it works?

When one of the connected sensors is triggered, the signal is transmitted to the Arduino module processor. Using the downloaded user software, the microprocessor produces its processing on a specific algorithm. As a result, a command can be formed on the operation of an external actuator, which is transmitted to it through the appropriate pairing fee.

To ensure the possibility of mandrel of warning signals to the home or apartment owner, which is guarded, to the Arduino module, through the extension fee, a special GSM module is connected. It establishes a SIM card of one of the cellular providers.

In the absence of a special GSM adapter, its role can also be performed mobile phone. In addition to sending SMS messages with alarm warning and dialing, the presence of a cellular will allow you to control GSM signaling to arduously remotely, as well as monitor the state of the object by sending special requests.

"Note!

To communicate with the owner of the object, in addition to GSM modules, conventional modems that provide communication via the Internet can be used. "

In this case, when the sensor processed by the signal processed by the processor is transmitted via a modem to a special portal or site. And already from the site automatically generates warning SMS or mailing to a tied e-mail.

conclusions

Using Arduino modules will allow users to independently design GSM alarms that can work with different function sensors and manage external devices. Due to the possibility of using various sensors, the alarm function can significantly expand and create a complex that will monitor not only the safety of the object, but for its condition. For example, it will be possible to control the temperature on the object, fix the leakage of water and gas, overlapping them in the event of an accident and much more.

This project concerns the development and improvement of the system to prevent / control any attempts to penetrate the thieves. Designed security device Uses the built-in system (turns on the hardware microcontroller using open software code and GSM modem) based on GSM technology (global mobile system).

A security device can be installed in the house. Interface sensor security alarm Also connected to the security system based on the controller.
When trying to penetrate the system transmits a warning message (for example, SMS) to the owner on a mobile phone or any pre-configured mobile phone for further processing.

The security system consists of microcontroller Arduino. Uno and standard SIM900A modem based on GSM / GPRS. The entire system can feed from any power supply / 12V 2A battery.

The following is shown in the ARDUINO security system.

The operation of the system is very simple and does not require clarification. When the system is supplied, it goes into the standby mode. When the J2 Connector conclusions are shortened, the pre-programmed warning message is transmitted to the required mobile number. You can connect any penetration detection detector (such as a light protective device or motion sensor) to the J2 input confctor. Note that the active-low (L) signal at the output 1 of the Connector J2 activates the triggering of the security alarm.

Moreover, optional "Call - Alarm" is added to the system. It activates the phone call when the user clicks the S2 button (or when another electronic unit initiates alarm). After pressing the "Call" button (S2), the call can be canceled by pressing another S3 button - the "END" button. This option can be used to feed alarm in the case of "missed call" in case of penetration.

The scheme is very flexible, so it can use any SIM900A modem (and, of course, Arduino Uno fee). Carefully read the documentation on the modem before the start of the assembly. This will make it easier and make a pleasant process manufacturing process.

List of radio elements

Designation A type Nominal number NoteScoreMy notebook
Arduino board

Arduino Uno.

1 In notebook
GSM / GPRS modemSIM900A.1 In notebook
IC1 Linear regulator

LM7805

1 In notebook
C1. 100mkp 25V.1 In notebook
C2. Electrolytic condenser10MKF 16V.1 In notebook
R1 Resistor

1 com

1 In notebook
LED1 Light-emitting diode 1 In notebook
S1. ButtonWith fixation1
Car theft over the past decade occupy one of the most significant places in the structure of crimes committed in the world. This is due not so much by the specific weight of this category of theft relative to the total number of crimes, how much the difference caused damage due to the great cost of cars. The weak efficiency of the measures taken in the field of combating thefts of vehicles by the end of the 1990s led to the creation of sustainable groups specializing in these crimes and possessing distinctive features organized crime; You probably heard the term "black auto business". The European State Automobile Park is not annually taken by ≈ 2% of machines that become subject to criminal encroachment. Therefore, I came the idea to make GSM alarms for your car based on Arduino Uno.

Let's start!

What we will collect

We must choose the heart of our system. In my opinion, there is nothing better for such alarm than Arduino Uno. The main criterion is a sufficient number of "Pins" and the price.


The main characteristics of Arduino Uno

Microcontroller - ATMEGA328.
Operating voltage - 5 V
Input voltage (recommended) - 7-12 V
Input voltage (limit) - 6-20 V
Digital inputs / Outputs - 14 (6 of which can be used as PWM outputs)
Analog inputs - 6
Permanent current through input / output - 40 mA
Permanent current for output 3.3 in - 50 mA
Flash memory - 32 KB (ATMEGA328) of which 0.5 kb are used for bootloader
RAM - 2 KB (ATMEGA328)
EEPROM - 1 KB (ATMEGA328)
Clock frequency - 16 MHz


Suitable!

Now you need to select the GSM module, because our alarm must be able to notify the owner of the car. So, you need to "google" ... Here is an excellent sensor - SIM800L, the size is simply wonderful.


I thought and ordered it from China. However, everything turned out to be not so rosy. The sensor simply refused to register the SIM card on the network. It was tested all that only possible - the result is zero.
Found kind peoplethat provided me with a sharp piece - SIM900 Shield. This is the already serious thing. In Shield and a microphone connector and headphone, a full-fledged phone.


Key Features SIM900 SHIELD

4 Operating Frequency Standard 850/900/1800 / 1900 MHz
GPRS MULTI-SLOT class 10/8
GPRS MOBILE STATION CLASS B
Complies with GSM Phase 2/2 +
Class 4 (2 W @ 850/900 MHz)
Class 1 (1 W @ 1800 / 1900MHz)
Management using AT commands (GSM 07.07, 07.05 and SIMCOM Advanced AT commands)
Low power consumption: 1.5mA (SLEEP MODE)
Operating temperature range: from -40 ° C to +85 ° C


Suitable!

OK, but you need to take readings from some sensors to notify the owner. Suddenly the car is evacuated, then the position of the car will clearly change in space. Take an accelerometer and gyroscope. Excellent. Tax, now we are looking for a sensor.

I think that the GY-521 MPU6050 is exactly suitable. It turned out that there is a temperature sensor in it. It would be necessary to use it, there will be such a "Killer Fich". Suppose that the owner of the car put it under home and left. The temperature in the car will be changed "smoothly". What will happen if the attacker tries to penetrate the car? For example, it will work out the door. The temperature in the car will begin to change rapidly, as the air in the cabin will begin to mix with the air ambient. I think that will work.


Main characteristics GY-521 MPU6050

Module 3-axis gyroscope + 3 axial accelerometer GY-521 on MPU-6050 chip. Allows you to determine the position and movement of the object in space, angular speed When rotating. The integrated temperature sensor also has. Used in various copter and aircraft model, as well as on the basis of these sensors, you can assemble the movement capture system.

Microcircuit - MPU-6050
Supply voltage - from 3.5V to 6V (DC);
Gyro range - ± 250 500 1000 2000 ° / s
The range of accelerometer - ± 2 ± 4 ± 8 ± 16g
Communication Interface - I2C
Size - 15x20 mm.
Weight - 5 g


Suitable!

The vibration sensor is also useful. Suddenly the car will try to open the "rough strength", well, or in the parking lot another car will attain your typewriter. Take the SW-420 vibration sensor (adjustable).


The main characteristics of SW-420

Supply voltage - 3.3 - 5V
Output Signal - Digital High / Low (normally closed)
Sensor used - SW-420
Used comparator - LM393
Sizes - 32x14 mm
Additionally, there is an adjusting resistor.


Suitable!

Fix the SD memory card module. We will still write a log file.


Main characteristics of the SD memory card module

The module allows you to store, read and record on the SD card data required for the device based on a microcontroller. The application of the device is relevant when storing files from dozens megabytes to two gigabytes. The SD card container is placed on the board, the power stabilizer, the plug of the interface and power lines connector. If you want to work with sound, video or other volumetric data, for example, to log event logging, sensor data or store web server information, the SD memory card module for Arduino will give the opportunity to apply an SD card for these purposes. Using the module, you can explore the features of the SD card.
Supply voltage - 5 or 3.3 V
SD card speed - up to 2 GB
Sizes - 46 x 30 mm


Suitable!

And add a servo, when the sensors are triggered, a servo drive to the DVR and to shoot a video incident. Take the MG996R servo.


The main characteristics of the MG996R servo

Stable I. reliable protection from damage
- Metal drive
- Two-row ball beads
- Wire length 300 mm
- dimensions 40x19x43mm
- weight 55 gr
- angle of rotation: 120 degrees.
- Working speed: 0.17sec / 60 degrees (4.8B without load)
- Working speed: 0.13c / 60 degrees (6V without load)
- Starting point: 9.4kg / cm with nutrition 4.8V
- Starting point: 11kg / cm when nutrition 6B
- Operating voltage: 4.8 - 7.2V
- All drive items are made of metal.


Suitable!

Collect

About connecting each sensor in Google a huge number of articles. And invent new bikes I have no desire, so I will leave links to simple and working options.

Today we will talk about how with Arduino Collect security system. Our "guard" will watch out one contour and manage one infidel.

For Arduino, this is not a problem, and, as you will see on the program code and by the device diagram, you can easily increase the number of protected access points and the number of alert or indication devices.
Security system You can apply to protect both large objects (buildings and structures) and small objects (boxes, safes), and even portable cases and suitcases. Although you need to be careful if you install the security system, for example, on a suitcase with which you decide to go on a journey, and the alert system will work in some airport, then I think you have a serious conversation with your local security service :-)

Simplified the principle of operation of the device is as follows (Fig. 1). After powering on the power, the device switches to the operating mode and waits for protection. Staging and disarming is carried out by one button. To enhance the security, this button is better to arrange inside the protected area (safe or casket). Before turning on the security mode, the door must be opened. When you turn on the security mode (pressing the button) electronic circuit Waiting until you close the door to the room (safe door, casket cover, etc.).

On the door (or door) there must be a terminal switch of any type, about it later. Climbing (or blurring), the limit switch will inform the device that the protected circuit is closed, and the device will go into the protection mode. On the transition to the protection mode, the system will notify two short signals (as in car alarms). In this mode, the device "catches" the opening of the door. After opening the door, the system is waiting for a few seconds (this is the value is customizable, for the premises of about ten seconds, for the box of one or two) shutdown of the protection mode, if this does not occur, the siren turns on. The algorithm and scheme are designed so that it is possible to disable the siren, only completely dismissed the case and turning off the power.

Device security system Very simple (Fig. 2). At the heart of the fee Arduino. The limit switches are connected as the usual button through pull-up resistors. On the contractions will stop separately. They are normally closed and normally open. You can enable the usual button as a terminal, only conventional button Very large, the play of the door is usually more. Therefore, it is necessary to come up with some pusher for the button and spring so as not to break the door button. Well, if not too lazy, you can walk to the store and buy a magnetic switch (GERCON) (Fig. 3), it is not afraid of dust and contamination.

A limit switch for auto alarms is suitable (Fig. 4). It should be noted, the program is written in German. With the door closed, its contact is closed. If you use a switch from car alarm, then with the door closed it will most likely open, and in the appropriate locations the code will need to be changed 0 on 1 and vice versa.

As a siren, we propose to use the sounding of sound PKI-1 Ivolga of Belarusian production (Fig. 5). Power supply 9 - 15 V, operating current 20 - 30 mA. This allows you to use it with battery powered. At the same time, he "issues" 95 - 105 dB.

With such characteristics from the Crohn battery, it will sound several dozen minutes. I found it on the Internet for 110 rubles. There is a geron with a magnet worth about 30 rubles. The switch from car alarm in auto parts was purchased for 28 rubles. The CT315 transistor can be taken with any letter or replace any modern low-power silicon transistor with appropriate conductivity. If the volume of one batch is not enough (who knows, maybe you want to be heard for many kilometers), you can connect several alarms in parallel or take more powerful, only in this case and the transistor must be replaced with a more powerful one (for example, a familiar transistor Assembly ULN2003). As connectors for connecting Hercon and Siren, I used the simplest connectors for audio / video devices - the price of Radiore 5 rubles. For a couple.

The device body can be glued from plastic or plywood; If a serious object is protected, it is better to make it metallic. Batteries or nutrition batteries to increase reliability and safety should be placed inside the case.

To simplify the program code, elements of energy saving were not used, and the batteries are not enough for a long time. You can optimize the code, and even better to convert radically by applying the processing of events to interrupts and sleep MC mode. In this case, nutrition from two square batteries included in series (9 V) must be enough for several months.

Now code

// Permanent
Const int button \u003d 12; // PIN for the button
Const int gerkon \u003d 3; // PIN for Herkeon
Const int sirena \u003d 2; // PIN Expirene
Const int led \u003d 13; // PIN indicator
// Variables
int buttonstate \u003d 0; // Button status
int gerkonstate \u003d 0; // State of Herkeon
int n \u003d 0; // Counter Disable Protection Button
void setup () (
// Sirena and Indicator Management - Exit
Pinmode (Sirena, Output);
Pinmode (LED, Output); // Button and Gueron - Inputs
Pinmode (Gerkon, Input);
Pinmode (Button, Input);
}
void loop () (
DigitalWrite (LED, HIGH);
while (buttonstate \u003d \u003d 0) (// Waiting cycle until you click the button
ButtonState \u003d DigitalRead (Button); // For the transition to the security mode
}
DigitalWrite (LED, LOW);
ButtonState \u003d 0; // reset the value of the button
While (gerkonstate \u003d 0) (// cycle until you close the door

}
Delay (500); // :-)
DigitalWrite (Sirena, High); // The code
Delay (100); // Indication
DigitalWrite (Sirena, Low); // Inclusion
Delay (70); // Mode
DigitalWrite (Sirena, High); // Security
Delay (100); // Alert
DigitalWrite (Sirena, Low); // Sound
While (gerkonstate \u003d 1) (// We are waiting for the opening of the door
gerkonstate \u003d DigitalRead (Gerkon);
}
for (int i \u003d 0; i<= 5; i++){ // 7,5 секунды на нажатие
ButtonState \u003d DigitalRead (Button); // Secret Button
if (buttonstate \u003d \u003d high) (// track your own - someone else's
N \u003d n + 1;
}
Delay (1500); // Secret Fich :-)))
}
if (n\u003e 0) (// Most importantly
DigitalWrite (Sirena, Low); // do not turn on siren
}
ELSE (
DigitalWrite (Sirena, High); // or turn on siren
}
DigitalWrite (LED, HIGH); // Turn on the indicator N \u003d 0;
ButtonState \u003d 0;
Delay (15000); // Reminder "Teapots", which like
DigitalWrite (LED, LOW); // put pressure on the buttons without interruption Delay (1000);

Good day! Again, a multi-review of Chinese electronic components, as usual of everything we gradually, I will try to shorter, but will it work? So, meet, GSM alarm cost up to 700 ₽. Interesting? I ask for "Cut"!

Baister! Before starting, I recommend to look into this, less components and large autonomy. So, "technical education", basic alarm requirements:

1) Notify when the sensors are triggered.
2) In the event of a power off, some autonomy should be provided.
3) Alarm management via SMS and calls.

Due to the fact that the alarm creation process was delayed for several months and some sellers no longer sell those components that were purchased from them, links will be updated on goods of other sellers who have the maximum or close to the maximum number of sales of goods and best price. Prices in the review are relevant at the date of his writing.

A list of what will need:

List of changes

Gsm_03_12_2016-14-38.hex - Fixed the operation of the device with the M590 modem.
Gsm_05_12_2016-13-45.hex - Added MemTest Console Command, Optimization of RAM.
GSM_2016_12_06-15-43.HEX - Added the output of command results to the console, memory optimization. Busy: 49% sram.
Gsm_2016_12_07-10-59.hex - Now the phone numbers are added and removed correctly. Busy: 49% SRAM, 74% Flash Memory.
Gsm_2016_12_07-15-38.hex - Added the ability to connect the motion sensor, connects to Pin A0 (in this case, PIN A0 is used as digital). Added SMS - commands Piron., Piroff.. Busy: 48% SRAM, 76% Flash Memory.
GSM_2016_12_08-13-53.HEX - Now after the successful execution of the command, which in response does not send an SMS message, the device flashes a blue LED once. Now, after the incorrect execution of the command, which in response does not send an SMS message, the device flashes the blue LED twice. Now, after initializing the parameters of the device, if "quiet" mode is enabled (sendsms \u003d 0), the device is often blinking with a blue LED for 2 seconds. Fixed a bug due to which the number was not always deleted from the DELETEPHONE command. Busy: 48% SRAM, 78% Flash Memory.
Gsm_2016_12_11-09-12.hex - Added AddPhone and Deletephone Console Commands, Syntax is similar to SMS commands. Memory optimization. Busy: 43% SRAM, 79% Flash Memory.
GSM_2017_01_03-22-51.HEX - Implemented support and similar input / output extension extensors on the PCF8574 chip, to connect additional 8 sensors, including gerks. Automatic search Addresses and automatic module setup. Standard sensor names and the logical level of their response varies using the EditSensor command. Changed the content of alarm SMS for the main sensor (PIN D0) "ALARM! Main Sensor! " and motion sensor (IDU A0) "ALARM! Pir Sensor! ". Added editsensor and i2cscan commands. Busy: 66% SRAM, 92% Flash Memory.
GSM_2017_01_15-23-26.HEX - Support modem A6_mini. Control of external power supply (PIN D7). Added SMS WatchpowerOn, WatchPowerOff commands. Added ListConfig, ListSensor Console Commands. Now SMS command EditSensor works correctly. Slightly "trimmed" with debug information into the port monitor. Busy: 66% SRAM, 95% Flash Memory.
Gsm_2017_01_16-23-54.hex - Now in the response message to the SMS command "Info" also consists of the state of the motion sensor. Fixed a bug due to which the empty response SMS messages were sent. Now the device is not only not only about shutdown, but also on the resumption of external nutrition. All modems became less than chatting, now in the port monitor, it became a little cleaner. Busy: 66% SRAM, 95% Flash Memory.
Gsm_2017_02_04-20-23.hex - Fixed "Watch the Power ON" error. Now after removing the protection, the "alarming PIN" turns off. Now, after deleting the number in the console, the correct information is displayed. It may be fixed a bug due to which empty response SMS messages were sometimes sent. Busy: 66% SRAM, 90% Flash Memory.
GSM_2017_02_14-00-03.HEX - Now the SMS messages are sent by default, the sendsms parameter is again equal to 1. Now, when contacting the contacts of the main generic sensor (closing the door), the device flashes in a blue LED for 2 seconds, signaling about the normal operation of the sensor. Busy: 66% SRAM, 90% Flash Memory.
GSM_2017_03_01-23-37.HEX - The WatchpowerOn command is removed. Added WatchPowerOff console command, identical to the SMS command. Added commands Watchpoweron1, Watchpoweron2. WatchPowerOn1 - External power monitoring is enabled if the alarm is armed, Watchpoweron2 - EXTERNAL POWER monitoring is always enabled. Implemented function of arming and disarming by external devices, for this, conclusions A1 (D15) and A2 (D16) are used. Alarm set / removes protection when the A1 (D15) appears on the output high level + 5V or on the output A2 (D16) of the low level GND. The output A1 (D15) is tightened to the GND, the output A2 (D16) is pulled up to + 5V through resistors 20 (10) com. Added GuardButtonon and Guardbuttonoff commands. Now, after placing protection, the red LED flashes until the integrity of the loop of the main generic sensor is checked. If the outline lights the red LED. Busy: 66% SRAM, 95% Flash Memory.
Gsm_2017_03_12-20-04.hex - Now the console has become even cleaner, but if the Teston test mode is enabled, additional information is displayed in the console. Fixed the "Sent!" Bug, now information about sending messages is properly displayed. Fixed a bug "Re-false call". Now the balance request must work correctly on all modems. Busy: 67% SRAM, 95% Flash Memory.
GSM_2017_04_16-12-00.HEX - Fixed. Now the INFO and Money commands will always send a response SMS. The GuardButtonon command is replaced by the GuardButtonon1 and GuardButtonon2 commands. Busy: 67% SRAM, 99% Flash Memory.
GSM_2017_04_21-09-43.Hex - Not recommended for use, only as testing, thanks for the identified errors :) - Now the SENDSMS parameter does not affect the sending of an electrical network monitoring messages. Added SMS Team DelayBeforeguard responsible for delay when arming, the value cannot exceed 255 seconds. Added SMS command DelayBeforeAlarm responsible for delayed sending notifications and inclusion of "alarm pine" when the sensors are triggered, the value cannot exceed 255 seconds. Clearsms commands are deleted, now messages are removed automatically after receiving. Busy: 68% SRAM, 100% Flash Memory.
GSM_2017_04_22-20-42.hex - Fixed multiple errors. Clearsms commands are again present in the firmware. Memory optimization. Busy: 68% SRAM, 98% Flash Memory.
GSM_2017_04_23-17-50.HEX. - Now the balance request must work correctly on all modems. Staging and disarming with external devices is now working correctly. Response messages SMS command Info should not be empty. Memory optimization. Busy: 68% SRAM, 98% Flash Memory.
Gsm_2017_04_24-13-22.hex - Now the transmission of console commands in the GSM module is performed only if the test mode is enabled. Now there is no separation on SMS commands and console commands, all existing commands can be transmitted both through SMS and through the console. Perhaps fixed bug with the info command. Memory optimization. Busy: 68% SRAM, 94% Flash Memory.
GSM_2017_04_25-20-54.hex - Fixed the bug in which the ListConfig command has changed the value of the last event. Now, when you enter commands through the Cap, unnecessary SMS messages are sent. Perhaps fixed bug with the info command. Memory optimization. Busy: 66% SRAM, 94% Flash Memory.
Gsm_2017_04_30-12-57.hex - temporarily included with for more information In the console when sending SMS messages and form a response to the Info command. Perhaps fixed bug with the info command. Memory optimization. Busy: 66% SRAM, 92% Flash Memory.
GSM_2017_05_06-11-52.hex - Fixed with the DelayBeforealarm function. Busy: 66% SRAM, 93% Flash Memory.
GSM_2017_05_23-21-27.HEX - slightly changed the output of information into the console. Added support for port expansion modules on PCF8574A with addresses from 0x38 to 0x3F inclusive. Fixed bug c. Now the device restarts automatically after FullReset commands, ResetConfig, ResetPhone and in case of successful execution of the MemTest command. Added WatchPowerTime command. Now it is possible to set the time after which the SMS will be sent to disconnect the external power source. Busy: 67% SRAM, 94% Flash Memory.
Gsm_2017_05_26-20-22.hex - Fixed initialization of the memory sensors of the extension board. ADDPHONE command syntax is changed. Added editmainphone command. The principle of operation of the notification system is changed, when the sensor is triggered, SMS will first be sent, after which voice calls will be performed. Alarm SMS messages will be sent to phone numbers with a sign "S" (SMS). Voice calls will be performed on the numbers with the sign "R" (Ring). Dispensing / enabling messages will be sent to phone numbers with a "P" feature (POWER). Added command Ringtime. Now it is possible to set the duration of alarm voice call, the parameter may be from 10 to 255 seconds. Now the Ringon / Ringoff command globally includes / disables voice call alert. Added command ResetSensor. Busy: 68% SRAM, 99% Flash Memory.
GSM_2017_06_02-17-43.HEX - AddPhone and Editmainphone commands Added parameter "I" (INFO), which is responsible for the SMS notification of the formulation or deregistration of the device. Now after adding the main number, the device automatically reboots. Now you can make the same number in the device. When adding the second and subsequent duplicate numbers, the attributes "M", "S", "P" and "I" will automatically be removed. These numbers will be used to repeat voice call when the sensors are triggered. Fixed the bug of the output curve to the console after executing the AddPhone command, now the information is not displayed automatically after the number is added. Added Reboot command. Busy: 69% SRAM, 99% Flash Memory.
Gsm_2017_06_11-00-07.hex - Now again, when contacting the contacts of the main generic sensor (closing the door), the device flashes a blue LED for 2 seconds, signaling about the normal operation of the sensor, and the device is not taken into account or removed. Ringon / Ringoff commands are removed. Now the device can be removed from the protection during an alarm call, now they are performed in the background. Busy: 69% SRAM, 99% Flash Memory.
GSM_2017_07_04-21-52.HEX - Now the PAUSE command does not send a response SMS. Deleted Teston and Testoff commands. All numbers removed a sign of Management. Busy: 68% SRAM, 96% Flash Memory.
Gsm_2017_07_24-12-02.hex - Added ReeDSWITCHON / REEDSWITCHOFF command to monitor the main germovgo sensor, now it can be turned on / off the same way as the motion sensor. Fixed in the info team bug. Teston and TestOff commands are present in the firmware. Busy: 68% SRAM, 96% Flash Memory.
Gsm_2017_07_26-10-03.hex - Added command modemid. Automatic modem definition is carried out only if the value of this parameter is 0. After setting the parameter value of 0, the device is automatically rebooted. Busy: 68% SRAM, 98% Flash Memory.
GSM_2017_08_03-22-03.Hex - Now the alarm can control external devices. For control, an analog output A3 is used (D17 - used as digital). The logical level of output (+ 5V or GND) can be changed, after changing the level through the setup command, the device will automatically be rebooted. The duration of the external control signal can be changed. Added ExtDeviceLevellow, ExtDeviceLevelHigh, ExtDeviceTime, Open commands. Some changes in the logic of the management teams. Memory optimization. Busy: 68% SRAM, 99% Flash Memory.
GSM_2017_08_10-12-17.HEX - SMSON / SMSOFF, ReeDSWITCHON / REEDSWITCHOFF, Piron / Piroff commands are removed and all connected with them. The DelayBeForeAlarm team is replaced by advanced commands. Changed the output of the info command. Optimized ListConfig command output into the console. Now any digital sensors with a high or low level of response can be connected to Pins D6 and A0, including Herkes. Pins D6 and A0 must be attracted to the ground (GND) through resistance 10 (20) com. If the sensor is configured to a low response level (enabled in Herrock mode), the integrity of the chain is checked. The logical response level of the inputs D6 and A0 (+ 5V or GND) can be changed, after changing the logical level, the device will automatically be rebooted. For each of the sensors (MAIN, SECOND, PCF extension cards), when triggered, it can be installed on which a notification will be notified (SMS and / or voice call). "PIR SENSOR" is renamed to SECOND SENSOR. Fixed the operation of the extension board, the error due to which the device has always notified about the triggering of the sensors, regardless of whether the device is supplied or not. Now you can select the mode of operation in which the device can monitor the extension board sensors in both the guardon mode and when the GuardOff) is turned off. Added PCFForceon / PCFforceoff commands, MainsensorlevelHigh / Mainsensorlevellow / Mainsensorleveloff, SecondsensorlevelHigh / Secondsensorlevellow / Secondsensorleveloff, MaindelayBeforealarm, SeconddelayBeforealarm, PCFDELAYBEFOREALARM. Busy: 68% SRAM, 99% Flash Memory.

* Subsequent versions of firmware include changes in previous versions.


Used Ports Arduino Nano V3

D4. - The output of the "alarm" Pina, when the sensor is triggered, the high-level signal is installed on this pin.
D5. - Inverse output "Alarm" Pina, when the sensor is triggered, a low level signal is installed on this pin.

D6. - Herkeless sensor. Starting from the version GSM_2017_08_10-12-17.Hex to Pin D6, any digital sensors with a high or low level of response can be connected, including hosts. PIN D6 must be attracted to the ground (GND) through resistance 10 (20) com.
D7 - connected to the voltage divider from the external power source + 5V. Upper shoulder 2.2 com, the lower 3,3 com.

Voltage divider


D8. - TX modem
D9 - modem RX.

D10 - Red LED
D11 - Blue LED
D12. - Green LED

Connection of the periphery:
A0. - Motion Sensor . Starting from the GSM_2017_08_10-12-17.Hex version, any digital sensors with a high or low response level can be connected to a Pin A0, including the German. PIN A0 must be attracted to the ground (GND) through resistance 10 (20) com.

A1. - Entry for external control. The alarm set / removes protection when the high level appears at the input + 5V.
A2. - Inverse input for external control. Alarm sets / removes protection when the low level of GND appears at the input.

A3. - Customizable (+ 5V or GND) Exit for managing external devices. When the control command is received, the value at this output varies depending on which one was set at the set time interval.

A4. - SDA I2C.
A5. - SLC I2C.
, To connect an additional 8 sensors.


Control commands for hex - firmware

Attention! Distressed teams in bold Can only be performed from the main number, as they are responsible for the configuration of the device. The remaining commands can be made from the numbers with the "Management" feature.

SMS - control commands are not sensitive to register:
Addphone - Add phone number. Not more than 9 numbers can be added + 1 The main number that is automatically saved in memory when the first call to the device after resetting to the factory settings commands ResetPhone. or Fullreset.. Those. Who first called the device after its discharge on the factory settings, the same and the "main", this number is entered into the first memory cell and it is impossible to change or remove via SMS. Unable to add two identical numbers.
Sample team:



Team syntax:

Addphone - team
: - delimiter
5 - Write to the fifth memory cell
+71234567890 - phone number
Prior to GSM_2017_05_26-20-22.hex:
A - the "Alarm" parameter - the numbers with this parameter will be sent to the SMS messages about the alarm and message messaging messages or messages.
Starting with the version GSM_2017_05_26-20-22.hex:
M - parameter "Management" - Alarm Management is allowed
S - parameter "SMS" - SMS message will be sent when sensors are triggered
R - the "Ring" parameter - the voice call will be made when the sensors are triggered
P - POWER parameter - SMS message will be sent when / disconnecting external power
i - parameter "info" - SMS message will be sent when setting or disarmed
In the absence of parameters "M", "S", "R", "P", "I", the phone is entered into memory, but not used.


Deletephone - Delete phone number.
Sample team:

Team syntax:

DELETEPHONE - Team
: - delimiter
+71234567891 - phone number


Editmainphone - change the parameters "S", "R", "P", "I" of the main phone, this number is entered into the first memory cell.
Sample team:

Team syntax:

Editmainphone - team
: - delimiter
SRPI - Parameters


BalanceNum. - Changing the balance query number and processing the query response length. Default value for Beeline: # 100 # L22.
Sample team:

Team syntax:

Balancenum - team
: - delimiter
# 103 # - Balance Request Number
L24 - Length (LEN) of the response response 24 symbol, cut spam from the balance query.


Editsensor - change the name of the sensor and the logical level of triggering. There may be no more than 8 additional sensors. After changing the parameters, a restart of the device is required.
Sample team:
Editsensor: 1 + Datchik Dvizheniya V Koridore # H

Team syntax:

Editsensor - team
: - delimiter
1 - Write in the first memory cell
+ - separator
Datchik Dvizheniya V Koridore - the name of the sensor cannot exceed 36 characters, including spaces.
#h - a sign of a high logical level from the sensor, upon receipt of which the alarm will work. If there is no "#h", the alarm will be triggered upon receipt from a low logical level sensor.


Sleeptime. - The time of "falling asleep" alarm when receiving an SMS command "PAUSE", indicated in minutes. The default value: 15 cannot be less than 1 or more than 60.
Sample team:

Team syntax:

Sleeptime - team
: - delimiter
20 - 20 minutes "sleep".


Alarmpintime. - the time for which the alarm / inverse PIN is turned on / off is indicated in seconds. The default value is: 60, there can be no less than 1 second and more than 43200 seconds (12 hours).
Sample team:

Team syntax:

Alarmpintime - team
: - delimiter
30 - 30 seconds of turning on / off alarm.


DELAYBEFOREGUARD. - Time to set the device for protection, after receiving the relevant team.
Sample team:

Team syntax:

DELAYBEFOREGUARD - Team
: - delimiter
25 - 25 seconds before arming


DelayBeforealarm. - The time after which will be sent "alarm" SMS notification, if during this period of time the alarm was not removed from the protection. Replaced with advanced commands starting from version GSM_2017_08_10-12-17.hex
Sample team:

Team syntax:

DelayBeforealarm - team
: - delimiter
40 - 40 seconds before sending "alarming" notice


WatchpowerTime. - Time in minutes after which the SMS message will be sent to disconnect the external power supply. If the external power is restored before the set time expires, the message will not be sent.
Sample team:

Team syntax:

WatchPowerTime - team
: - delimiter
5 - 5 minutes before sending SMS message


Ringtime - Duration of alarm voice call, the parameter may be from 10 to 255 seconds.
Sample team:

Team syntax:

Ringtime - team
: - delimiter
40 - 40 Call duration will be 40 seconds, after which the next subscriber will be called.


Modemid. - Forced installation of the modem used model. Possible values: 0 - Modem Auto Detection, 1 - M590, 2 - SIM800L, 3 - A6_MINI.
Sample team:

Team syntax:

Modemid - team
: - delimiter
2 - ID modem.


ExtDevicetime. - The number of seconds to which the signal level will change at the output of the external device.
Sample team:

Team syntax:

ExtDeviceTime- Team
: - delimiter
5 - 5 seconds


ExtDevicelevlow. - The external device connected to the output A3 is controlled by a low signal level (GND). At the default output there will be a high level + 5V, until the external control command is received.
ExtDeviceLevelHigh - The external device connected to the output A3 is controlled by a high level of signal (+ 5V). At the default output there will be a low GND level until the external control command is received.

ResetSensor. - Reset port expander sensor parameters

ResetConfig - Reset settings for factory settings

ResetPhone. - Delete from the memory of all phone numbers

Fullreset. - Reset settings, delete all phone numbers from the memory, restore the default value of the BalanceNum command.

Ringon. - Enable the call notification to the "main" number recorded in the first memory cell when the sensor is triggered. Remote from version GSM_2017_06_11-00-07.hex
Ringoff - Turn off the call notification when the sensor is triggered. Remote from version GSM_2017_06_11-00-07.hex

SMSon. - Enable SMS notification when the sensor is triggered. Remote from version GSM_2017_08_10-12-17.HEX
SMSOFF. - Turn off the SMS notification when the sensor is triggered. Remote from version GSM_2017_08_10-12-17.HEX

Piron. - Enable motion sensor processing
Piroff. - Turn off the processing of the motion sensor

Reedswitchon - Enable the processing of the main generic sensor
Reedswitchoff - Turn off the processing of the main generic sensor

Watchpoweron - Enable External Power Control, SMS Power Disabling Power SMS will be sent under the condition that the alarm is armed. Removed from version GSM_2017_03_01-23-37.

Watchpoweron1 - Enable External Power Control, SMS Power Disabling Power SMS will be sent under the condition that the alarm is armed.
Watchpoweron2. - Enable external power control, SMS message about external power off in any case will be sent

WatchpowerOff - Turn off external power control

GuardButtonon - The signaling control by external devices or the button is turned on, starting from the GSM_2017_04_16-12-00 version.
GuardButtonon1 - Function setting or removing Protection by external devices or the button is enabled
GuardButtonon2. - Function only settings On the protection of external devices or the button is enabled, removal from security is made by call to the device or using an SMS command.
GuardButtonoff - control signaling by external devices or the off button

PCFforceon. - Permanent monitoring of a group of all expansion module sensors
Pcfforceoff - Monitoring of a group of all sensors of the expansion module only when setting a device for security

MainsensorLevelHigh - Alarm notification will be sent when a high-level signal appears (+5 V) at the input (D6) from the sensor
MainsensorLevelow. - The alarm notification will be sent when the low level signal appears (GND) at the input (D6) from the sensor
MainsensorLeveloff - the processing of the sensor at the input (D6) is disabled

SecondSensorlevelHigh - Alarm notification will be sent when a high-level signal appears (+5 V) at the input (A0) from the sensor
SecondSensorLevelow. - Alarm notification will be sent when a low level signal appears (GND) at the input (A0) from the sensor
SecondSensorLeveloff - the processing of the sensor at the input (A0) is disabled

MaindelayBeforealarm. - The time after which will be sent "alarm" SMS notification when the main sensor is triggered (D6), if for this period of time the alarm was not removed from the protection. Syntax is similar to the DelayBeforeAlarm command.
SeconddelayBeforealarm. - time after which will be sent "alarm" SMS notification when triggered additional sensor (A0), if during this period of time the alarm was not removed from the protection. Syntax is similar to the DelayBeforeAlarm command.
PcfdelayBeforealarm. - The time after which will be sent "alarm" SMS notification when the expansion fee sensors are triggered (PCF8574), if during this period of time the alarm has not been removed from protection. Syntax is similar to the DelayBeforeAlarm command.

Guardon - put on guard
Guardoff - Remove Guard

Open - External Device Management Team

Info - Check the status, in response to this message will be sent SMS with information about from which number was turned on / off guard

Pause - suspends the system of the system for a time set by the SleepTime command in minutes, the system does not respond to the sensor response.

Teston - Test mode turns on, blinking with a blue LED.
Testoff - Test mode is turned off.

LEDOFF - turns off the standby LED.
LEDON - Includes the standby LED.

Money - Balance Request.

Clearsms - Delete all SMS from memory

Console Commands (up to version GSM_2017_04_24-13-22.Hex) - Entered in the Arduino IDE port monitor:

ADDPHONE - ADDPHONE SMS SMS

DELETEPHONE - similar to SMS command Deletephone

EditSensor - similar to the EDITSENSOR SMS

ListPhone - output to the list of the list of the list saved in the phone's memory

ResetConfig - similar to the RESETCONFIG SMS command

ResetPhone - similar to the RESETPHONE SMS command

Fullreset - Fullreset SMS SMS

Clearsms - similar to SMS command clearsms

Watchpoweron1 - similar to the SMS command Watchpoweron1
WatchpowerOn2 - similar to the WatchPowerOn2 SMS command
WatchPowerOff - Similar to the WatchPowerOff SMS

GuardButtonon is similar to the GUARDBUTTONON SMS command. Remote from version GSM_2017_04_16-12-00
GuardButtonon1 - similar to SMS team GuardButtonon1
GuardButtonon2 - The GUARDBUTTONON2 SMS command
GuardButtonoff - similar to the SMS team GuardButtonoff

MemTest is a test of non-volatile device memory, all device settings will be reset, similar to the Fullreset command.

I2cscan - search and initialization of supported devices on the I2C bus.

ListConfig - output to the port monitor of the current device configuration.

ListSensor - output to the port monitor of the current sensor configuration.

UPD. When using motion sensor, To eliminate false positives when working modem, you need between Pina GND. and A0. Arduino. put resistance, thanks talk to a friend
AllowPhone \u003d ("70001234501", "70001234503", "70001234504", "70001234505") - numbers which are allowed to control the protection.
ALARMPHONE \u003d ("70001234501", "70001234502") - numbers for sending SMS notifications when the sensor is triggered and notified for the removal or arming. The first number in the list will be called when the sensor is triggered if the Ringon command is executed, the default option is enabled. This is done because SMS messages can come with some delay, and the call must go right away.

If you have received a call from a permitted number or an SMS message with the Guardon / Guardoff command, then, depending on the current security status, an SMS message on the stage or removal from security to the numbers listed in the Alarmphone array will also be sent to the SMS message to the number from which he received a call.

When triggered the sensor SMS messages are sent to all numbers from the massif (list) of alarmphone and will be called voice call to the first number from this array.

Light indication:
The LED glows in red - put on guard.
LED glows green color - Disabled with security, turns on / off the SMS command LEDON / LEDOFF.
The LED constantly flashes in blue - signals that C arduino is all right, the fee does not depend, is used exclusively for debugging, it turns on / TestOff SMS command.
* The code is present in the code LEDTest (), it flashes the blue LED, is made only to monitor Arduino, flashes - it means it does not blink - it hung. It has not yet hung :)

Not relevant!

Connecting 2 or more sensors for open firmware (only for this firmware Sketch_02_12_2016.ino)
To connect additional generic sensors, use free digital pins d2, d3, d5 or d7. Connection diagram with an additional sensor on D7.

Necessary changes in the firmware
... #define Doorpin 6 // input number connected to the main sensor int8_t doorstate \u003d 0; // variable for storing the state of the main sensor int8_t doorflag \u003d 1; // Variable for storing the status of the main sensor #define Backdoorpin 7 // Input number connected to an additional int8_t backdoorstate \u003d 0; // Variable for storing the status of an additional sensor INT8_T Backdoorflag \u003d 1; // Variable for storing the status of an additional sensor ...
Void Setup () (... Pinmode (Doorpin, Input); Pinmode (Backdoorpin, Input); ...
... void detect () (// Read the values \u200b\u200bfrom the DOORSTATE \u003d DIGITALREAD sensors; BackdoorsTate \u003d DigitalRead; // Processing the main sensor if (doorstate \u003d\u003d low && doorflag \u003d\u003d 0) (doorflag \u003d 1; Delay (100); if (ledon \u003d\u003d 1) DigitalWrite (GLED, LOW); ALARM ();) if (doorstate \u003d\u003d high && doorflag \u003d\u003d 1) (doorflag \u003d 0; delay (100);) // Processing Additional IF Sensor (BackdoorsTate \u003d\u003d Low && Backdoorflag \u003d\u003d 0) (backdoorflag \u003d 1; delay (100); if (ledon \u003d\u003d 1) DigitalWrite (GLED, LOW); Alarm ();) if (backdoorstate \u003d\u003d high && Backdoorflag \u003d\u003d 1) (backdoorflag \u003d 0; delay (100);)) ...

And one more thing:
1. The diodes are better to use 2 A current, as the module infects the current at 1 A and we still need to feed the Arduino and the modem. This instance uses 1N4007 diodes, if we fail to replace 2 A.
2. All resistors for the LED used on 20 com, in order not to light the entire corridor at night.
3. On the armless sensor between the GND pin and pin D6 also hung the resistor on 20 com.

That's all. Thanks for attention! :)

I plan to buy +207 Add to favourites I liked the review +112 +243