Basic project 085g Ai Thinker A6 GSM GPRS module, ESP8266 ESP-12E module, Reed switch – intruder detection system


Basics: Project 085g

Project name:  Ai Thinker A6 GSM GPRS module, ESP8266 ESP-12E module, Reed switch – intruder detection system

Tags: Arduino, A6 GSM GPRS module, GSM GPRS module, A6, Ai Thinker, ESP8266 ESP-12E module, Motion detection, Nodemcu v3, Lolin, PIR sensor HC – SR 501 or HC – SR 505, reed switch, magnetic door switch, DC-DC ADJUSTABLE VOLTAGE STEP DOWN MODULE LM2596S, velleman VMA404,

Attachments: sketch

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1. Ai Thinker A6 GSM GPRS module 1 pc

A6 GSM GPRS module

2. Arduino IDE ( you can download it from here  )

3. Jumper cables  F-F, F-M or wires

A6 GSM GPRS module

4. Micro USB cable 1 pc

A6 GSM GPRS module

5. Micro SIM card 1 pc (unlocked)

A6 GSM GPRS module

6. GSM GPRS antenna 1 pc

7. 6 VDC 2A power wall adapter 1pc

A6 GSM GPRS module

8. Mini PIR Motion Sensor Module SC0322 1pc

A6 GSM GPRS module

9. ESP8266 ESP-12E module with micro USB cable 1pc

A6 GSM GPRS module

10. LED 1 pc

led

11. Resistor 2 pcs (10 KOhm 1 pc, 220 Ohm 1 pc)

resistor

12. Velleman VMA404 (DC DC adjustable step down module) 1 pc

a6 gsm module

13.Switch slide SPDT 200MA 30V 1 pc

switch electrical

14. Terminal block with 2 connectors 2 pcs

terminal block

15. Terminal block with 4 connectors 2 pcs

terminal block

16. Prototyping board 1 pc

General

We will learn how to build the intruder detection system with Ai Thinker A6 GSM GPRS module and ESP8266 ESP-12E module using motion sensor and reed switch.

Understanding the Reed switch

You can read more about it here.

Understanding the PIR sensor module

You can read more about it here.

Understanding the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)

You can read more about it here.

Understanding the A6 GSM GPRS module

You can read more about it here.

You can find A6 datasheet, manuals, AT commands, schematics here.

Signals and connections of the PIR sensor module

A6 GSM GPRS module
A6 GSM GPRS module
A6 GSM GPRS module

We are goinig to use Mini PIR Motion Sensor Module SC0322 in this project.

Signals and connections of the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)

A6 GSM GPRS module

TX – transmit pin. GPIO pin

RX  – receive pin.  GPIO pin

3V3 (or 3V or 3.3V)- power supply pin (3-3.6V). 

GND ( or G) – ground pin.

RST – reset pin. Keep it on high (3.3V) for normal operation. Put it on 0V to reset the chip.

EN – Chip enable. Keep it on high (3.3V) for normal operation.

Vin – External power supply 5VDC.

D0-D8 – GPIO (General Purpose Input Output) pins 

D5-D8 – SPI interface

D1-D2– I²C/TWI Interface

SC (or CMD) – (Chip Select) – the pin that the master can use to enable and disable specific devices. GPIO pin

SO (or SDO) – Master In Slave Out (MISO) – SPI communication. The Slave line for sending data to the master. GPIO pin

SK (or CLK) – SCK (Serial Clock) – SPI communication.The clock pulses which synchronize data transmission generated by the master. GPIO pin

S1 (or SD1) – Master Out/Slave In (MOSI). SPI communication. The Master line for sending data to the peripherals. GPIO pin

S2 (or SD2) – GPIO pin

S3 (or SD3) – GPIO pin

VU (or VUSB) – external power 5VDC.

A0 – ADC output.

RSV – reserved

Signals and connections of the A6 GSM GPRS module

A6 GPS/GPRS IC pinout:

A6 IC
A6 GSM GPRS module

EN – module power control enable pin (can control power switch, default high level enable)

VCC_IN – External power supply (3.4V-4.2V ) maximum power supply current 2A

PWR – used for turning module ON/OFF programmatically. For doing this you must pull it HIGH for a moment (less than 500 ms or around).

INT – used to control the module to enter low-power mode, high exit low level access, in this mode the standby current <1mA ( in this mode the serial port cannot be used)

GND – ground pin. this module has 2 ground pins

U_RXD – serial port for AT commands (receive pin)

U_TXD – serial port for AT commands (transmit pin)

H_TXD – firmware update pin (transmit pin), pin power level 2.8V

H_RXD – firmware update pin (receive pin), pin power level 2.8V

R232_TX – RS232 level control (transmit pin)

R232_RX – RS232 level control (receive pin)

MIC- – microphone –

MIC+ – microphone+

REC- – loudspeaker –

REC+ – loudspeaker +

Wiring

a6 gsm gprs module

We used terminal blocks with 4 connectors for (3VDC, GND, TX, RX, GND, D5, D6), terminal block with 2 connectors to connect the power supply. Switch slide attached in case if you want to use another power supply and need to adjust output voltage, you can also power off the intruder detection system without disconnecting from power supply. Please note that you can have the power supply from 6-40 VDC with max current 2A – you will need to just the output voltage to 5 VDC with adjustable resistor on Velleman VMA404.

a6 gsm gprs module

A6 GSM GPRS module Nodemcu 1.0

GND G (GND)

U_RXD TX (GPIO1)

Nodemcu 1.0 PIR sensor

G (GND) GND

3V VIN (3.3VDC)

D5 (GPIO14) SIGNAL

Nodemcu 1.0 Reed switch

G (GND) first wire connected to ground with 10 KOhm resistor

3V second wire

D6 (GPIO12) first wire

Step by Step instruction

1. Adding ESP8266 platform to Arduino IDE

The Arduino environment has to be set up to make it compatible with the ESP8266 ESP-12E module. We are using PC with Windows 7 64 bit OS.

Download and install the Arduino IDE. You can download it here 

Open Arduino IDE. 

Open the Preferences window from the Arduino IDE. Go to File -> Preferences.

A6 GSM GPRS module

Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field and click the “OK” button. If you already have a URL in there, and want to keep it, you can separate multiple URLs by placing a comma between them. (Arduino 1.6.5 added an expanded text box, separate links in here by line.)

A6 GSM GPRS module

Open Boards manager. Go to Tools -> Board -> Boards Manager…

A6 GSM GPRS module

There should be a couple new entries in addition to the standard Arduino boards. Look for esp8266. or scroll down to the ESP8266 entry (usually at the bottom). Select the ESP8266 entry. When you click it an install option will appear. Select the latest version and click install

A6 GSM GPRS module

The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other reasonably large, compiled binaries, so it may take a few minutes to download and install (the archived file is ~110MB). Once the installation has completed, an Arduino-blue “INSTALLED” will appear next to the entry.

A6 GSM GPRS module
A6 GSM GPRS module

2. Uploading sketch to ESP8266 ESP-12E development board

If you’re using an ESP-12E NodeMCU Kit, uploading the sketch is very simple, since it has built-in programmer. 

Before use ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3), you need to download the manufacture’s driver (CH340)  for this chip and install it in your PC. Here is the link. See the description of driver installation package below: CH340 / CH341 USB to serial WINDOWS driver installation package that supports 32/64 bit Windows 10 / 8.1 / 8/7 / VISTA / XP, SERVER 2016/2012/2008/2003, 2000 / ME / 98, through Microsoft digital signature authentication, support USB to 3-wire and 9-wire serial port, with the product release To the end user. Applicable scope: CH340G, CH340C, CH340B, CH340E, CH340T, CH340R, CH341A, CH341T, CH341H chips.

If you have CP2102 chip then  you need to download the manufacture’s driver for this chip and install it in your PC. Driver for MacWindowsLinux or more.. 

  1. Do wiring.
  2. Attach GSM GPRS antenna to A6 GSM GPRS module.
  3. Insert a active unlocked SIM card to SIM card slot of A6 GSM GPRS module.The workings of the SIM card socket can take some getting used to. To unlock the latch, push the top part of the assembly towards micro USB connector, and then lift it up. Place the SIM card into the bottom part of the socket with the SIM’s notch pointing away from the micro USB connector. Then fold the arm back into the body of the socket, and gently push it forward towards the “LOCK” position.
  4. We power up A6 GSM GPRS module with external power supply 5VDC 2A through micro USB port.
  5. Open Arduino IDE.
  6. Plug your ESP8266 ESP-12E module into your PC USB port.
  7. Choose your NodeMCU board. Go to Tools -> Board -> NodeMCU 1.0 (ESP-12E Module)
  8. Select the correct com port.
  9. Modify the sketch with your cell(mobile) number, verify and upload it to your ESP8266 ESP-12E module.
  10. When the motion detected with PIR sensor you will get the message on your smartphone – Motion detected, when the door opens – Door opened.
a6 gsm gprs module

Summary

We have learnt how to build the intruder detection system with Ai Thinker A6 GSM GPRS module and ESP8266 ESP-12E module using motion sensor and reed switch.

Thank you for reading and supporting us.

Libraries:

  • None

Project resources:

  • See attachments on the beginning of this project description

AcoptexCom

Leave a Reply

Your email address will not be published.