# Simple and advanced infrared security system

**URL:** https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601
**Category:** Share Your Projects
**Created:** [11 October 2019 12:33 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601 "2019-10-11T12:33:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [11 October 2019 12:33 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/1 "2019-10-11T12:33:03Z")

</div>

Just finished writing a tutorial on how to build a very simple and a more advanced infrared security system.

The system can be activated & deactivated using Alexa and can also send status-messages to your mobile phone using the Telegram node.

[IR Security - Tutorial guide](http://resources-area.co.uk/node-red-flows/ir_security_tutorial.pdf)  
[IR Security - Node-RED flow](http://resources-area.co.uk/node-red-flows/ir_security_flow.json)  
[IR Security - ESP-Easy (Wemos D1 Mini, ESP8266) rules](http://resources-area.co.uk/node-red-flows/ir_security_rules.txt)

PS:  
The tutorial has been updated to explain how to monitor the power-bank's output voltage (nominally +5V) with a simple voltage divider (two 10K resistors in series across the power pins) rather than checking the 3V3 pin on the Wemos.

---

<div class="post-metadata">

### Author: ![miker256](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miker256/32/13042_2.png) [@miker256](https://discourse.nodered.org/u/miker256)
#### Post date: [11 October 2019 21:15 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/2 "2019-10-11T21:15:24Z")

</div>

This is really cool @dynamicdave. I'm going to try and build this myself thanks for sharing this. 👍

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [12 October 2019 09:54 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/3 "2019-10-12T09:54:26Z")

</div>

David,  
Probably a stupid question, but here I go:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a0d94c55e56e07d1a5bb8defe7eefa8077ebde8d.png)

I assume the teacher (= you) has preinstalled some stuff already? Because the way you describe it, it seems so suspicious easy 🤔 Probably the Wemos have passed your magical hands to get them ready to go?  
Bart

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [12 October 2019 10:07 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/4 "2019-10-12T10:07:36Z")

</div>

David does setup the semis’s For his class, but installing ESPeasy is not that hard and once you do it once, upgrades can be done OTA and -of course - you will have a file with your notes with the exact syntax used to do the install...right 🤣

I have all my notes in a file at home and I’m visiting my grandsons (7 hours away) and had to reflash the semis I brought for him (wrong wireless password) and was able to dig up the instructions on the net without too much trouble AND this is on a MAC where I had to do it via the terminal.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [12 October 2019 12:04 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/5 "2019-10-12T12:04:14Z")

</div>

Hi Bart,  
The Wemos D1 Minis (WiFi ESP8266 based) I purchase from China come flashed with Lua.  
I re-flash them with ESP-Easy, which as Paul says, is very easy.

> **[letscontrolit/ESPEasy](https://github.com/letscontrolit/ESPEasy/releases)**
>
> Easy MultiSensor device based on ESP8266. Contribute to letscontrolit/ESPEasy development by creating an account on GitHub.

I know quite a few people on this forum use these devices.

The beauty of ESP-Easy is most of the device-drivers you'll need are built-in.  
e.g. GPIO pins for LEDs & relays, switch input, temp & humidity sensors, servo motor control, LCD panel control and of course MQTT communication.  
The unit is WiFi-enabled so connecting to a home network is a breeze.  
The other thing I like about the Wemos is it is inexpensive, so if any of my students should have an accident with them - nobody is going to get upset.

Let me know if you require any further information.

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [12 October 2019 12:40 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/6 "2019-10-12T12:40:07Z")

</div>

> [@dynamicdave](#):
>
> The Wemos D1 Minis (WiFi ESP8266 based) I purchase from China come flashed with Lua.

Ah, from your notes I hoped you bought some that were flashed with ESPeasy already...

> [@dynamicdave](#):
>
> Let me know if you require any further information.

Perhaps I have some time in the winter... But I am using that sentence year already many years, but I never have time 🤣 Too many interesting things for a single life ...

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [12 October 2019 13:06 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/7 "2019-10-12T13:06:06Z")

</div>

> [@BartButenaers](#):
>
> Too many interesting things for a single life

Too true, oh too true!

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [15 November 2019 07:35 UTC](https://discourse.nodered.org/t/simple-and-advanced-infrared-security-system/16601/8 "2019-11-15T07:35:28Z")

</div>

Please note:  
The versions of ESP Easy mega, released from Oct'2019 onwards, now need a single quote placed around the json string to delimit the double quotes and commas in the rule-sets. eg. '{"blah": "blah"}'

```auto
On publishReading Do
   publish,node24/ir_detector,'{"node_number":"node%unit%","ssid":"%ssid%","rssi":[rssi#strength],"level":[ir#state],"battery_voltage":[analog#voltage],"temperature":[ds18b20#temperature]}'
   If [ir#state]=1
      timerSet,1,5
   EndIf
EndOn

```
