Alarm Notification Blynk
Alarm Notification Blynk
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/317370136
CITATIONS READS
0 11
1 author:
M. Todica
Babe-Bolyai University
81 PUBLICATIONS 252 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
IR and Raman Investigation of Some Poly(acrylic) Acid Gels in Aqueous and Neutralized State View
project
Serwo and RGB led feedback with smartphone and Blynk View project
All content following this page was uploaded by M. Todica on 06 June 2017.
This work presents how to receive notifications on the smartphone, via internet, from
security alarm sensors working on 315/433 Mhz. No hardware or software intervention
on the original sensors is needed. The only requested condition is that the receiver of our
system should be placed in the area of radiation of the radio transmitter sensor, and in the
working area of wirelesses internet router. Notifications can be sent from any kind of
sensor, PIR, magnetic, temperature, etc. with radio transmitter. The sensors can be
connected to theirs original mother alarm system or can be managed separately, without
any connection with the alarm system. For instance in this work we use a PIR sensor,
alone, without any connection to the mother alarm system, (Fig. 1). When a motion is
detected the sensor sends the code which is received by our system and transmitted
trough internet to the smarphone. That means the
motion is detected. We need the following
materials:
One sensor with RF 315/433 Mhz transmitter, one
receiver module 315/433 Mhz and one board
NodeMCU ESP-V3 or WeMos D1-R2. Optionally
we can add RGB led to our project. The
connection of the radio module and RGB led are
shown in figure 2 for NodeMcu board, (data pin of
radio to D2), and in figure 3 for WeMos D1-R2
board, (data pin of radio to D4). As radio can be
used super heterodyne (Fig. 2), or super
regenerative modules (Fig. 3). Both can be power
Fig. 1. PIR sensor with with +3.3V, but better results are obtained with
433Mhz transmitter +5V supply. In this case the data pin of Rx
modules must be connected to pins D2
respectively D4 using a resistive divider 2/3 in order to avoid signals higher than 3.3V on
the entries of NodeMcu or WeMos boards. The RGB led is connected to GND, D7, D6
and D5 for NodeMcu, or GND, D13, D12 and D11 for WeMos. The RGB led is
controlled by widget buttons attached to digital pins D12 and D13 on Blynk. The led can
be replaced by relay if we want to send other orders to the board, for instance arming or
disarming the alarm, open or closing lights, etc. The led connected to D5 respectively to
D13 flashes every time when a radio code is received.
To do this project we must follow the next steps.
Step one. Setting Arduino to recognize and communicate with the ESP266 NodeMcu or
WeMos board. The protocol is similar with the procedure of installing ESP8266-01. A
very good tutorial can be found to the link:
http://www.instructables.com/id/Programming-ESP8266-ESP-12E-NodeMCU-Using-
Arduino-/?ALLSTEPS
Alternatively can be used the procedure described in previous work,
Controlling by smartphone via internet two relays with Blynk and ESP 8266-01
DOI: 10.13140/RG.2.2.31986.91847
We must install the library RCSwitch from the link below:
https://github.com/sui77/rc-switch/
Step two. Uploading the code. We used Arduino 1.6.8 version. After connecting the
board NodeMcu or WeMos to the computer, we upload the code below:
+Vcc GND
Antenna
Data
17 cm
The code.
////////////////////
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
SimpleTimer timer;
void setup() {
pinMode(14,OUTPUT);
//control the led connected to D13 of the board WeMos
Blynk.begin(auth, ssid, pass);
Serial.begin(9600);
mySwitch.enableReceive(4);
// Rx DATA of radio connected to D2 of NodeMcu
// Rx DATA of radio connected to D4 of WeMos
timer.setInterval(500L, sendUptime);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
void sendUptime()
{
if (mySwitch.available()) {
Serial.print("Received ");
Serial.println( mySwitch.getReceivedValue() );
//displays on PC monitor the received codes
Serial.print(" / ");
digitalWrite(14,HIGH);
//the led on D13 of WeMos board will shine if any code is received
int code=mySwitch.getReceivedValue();
Blynk.virtualWrite(12, " Code= ");
Blynk.virtualWrite(12, code);
//displays on terminal widget V12 the received code
mySwitch.resetAvailable();
}
else
{
Blynk.virtualWrite(12, " NO Code ");
Serial.println(" No Received ");
digitalWrite(14,LOW);
}
//mySwitch.resetAvailable();
}
////////////////////
End of the code
17 cm
antenn
a
References
1. http://www.instructables.com/id/Programming-ESP8266-ESP-12E-NodeMCU-Using-
Arduino-/?ALLSTEPS
2. Controlling by smartphone via internet two relays with Blynk and ESP 8266-01,
M. Todica, DOI: 10.13140/RG.2.2.31986.91847
3. https://github.com/sui77/rc-switch/
4. http://arduino.esp8266.com/package_esp8266com_index.json.
5. http://www.blynk.cc/getting-started.
6. https://www.hackster.io/mjrobot/lasercat-iot-with-nodemcu-and-blynk-27365d