Reader small image

You're reading from  ESP8266 Home Automation Projects

Product typeBook
Published inNov 2017
PublisherPackt
ISBN-139781787282629
Edition1st Edition
Tools
Right arrow
Authors (2):
Catalin Batrinu
Catalin Batrinu
author image
Catalin Batrinu

Catalin Batrinu graduated from the Politehnica University of Bucharest in Electronics, Telecommunications, and Information Technology. He has been working as a software developer in telecommunications for the past 16 years. He has worked with old protocols and the latest network protocols and technologies, so he has experienced all transformations in the telecommunication industry. He has implemented many telecommunications protocols, from access adaptations and backbone switches to high-capacity, carrier-grade switches on various hardware platforms from Wintegra and Broadcom. Internet of Things came as a natural evolution for him and now he collaborates with different companies to construct the world of tomorrow that will make our life more comfortable and secure. Using the ESP8266, he has prototyped devices such as irrigation controllers, smart sockets, window shutters, Digital Addressable Lighting Controls, and environment controls, all of them controlled directly from a mobile application over the cloud. An MQTT broker with bridging and a WebSockets server was even developed for the ESP8266. Soon, all those devices will be part of our daily life, so we will all enjoy their functionality.
Read more about Catalin Batrinu

View More author details
Right arrow

Chapter 5. Using ESP8266 to Build a Security System

We all are interested in knowing what is happening at home when we are not in. Either it is about security or critical elements such as gas, fire, or water. Knowing in the moment when something wrong is happening is vital to minimizing the eventual damage. In this chapter, we will focus on the PIR sensor, but the same principles apply to other sensors, such as moisture, gas, or smoke sensors.

 

Passive infrared sensor


PIR is the most common sensor used in the indoor and outdoor alarm systems. It is also used in automated doors and automated lights systems.

How PIRs work

The functionality of the PIR sensor is based on radiation emitted by human bodies. Objects generate heat as infrared radiation and those objects include animals and the human body whose radiation is strongest at a wavelength of 9.4 μm.

When a human passes the front of the sensor, the temperature from the PIR sensor point of view changes from the background value to the human value. The sensor detects this change in the infrared radiation and changes its output voltage, signaling the detection.

To increase the sensitivity of the PIR sensor, a Fresnel lens is mounted in front of it. A sensor is in fact a FET transistor with a source pin connected with a pull down to ground. We can see this setup in the following figure:

In the following image, we can see a Fresnel lens made from plastic:

The sensor itself is located under...

Summary


Now you can build a security system in no time, but the security is not limited to PIR sensors, you can add other sensors to it, such as CO2 or gas, or sensors for detecting water leaks or smoke, and you can create a dependency between them. For example, if you have a broken pipe in the house and the water leak sensor detects water you will be notified in the Blynk application, but also another ESP8266 that is subscribing to the leak topic can close the main valve so the damage is limited by the time you arrive home.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
ESP8266 Home Automation Projects
Published in: Nov 2017Publisher: PacktISBN-13: 9781787282629
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Catalin Batrinu

Catalin Batrinu graduated from the Politehnica University of Bucharest in Electronics, Telecommunications, and Information Technology. He has been working as a software developer in telecommunications for the past 16 years. He has worked with old protocols and the latest network protocols and technologies, so he has experienced all transformations in the telecommunication industry. He has implemented many telecommunications protocols, from access adaptations and backbone switches to high-capacity, carrier-grade switches on various hardware platforms from Wintegra and Broadcom. Internet of Things came as a natural evolution for him and now he collaborates with different companies to construct the world of tomorrow that will make our life more comfortable and secure. Using the ESP8266, he has prototyped devices such as irrigation controllers, smart sockets, window shutters, Digital Addressable Lighting Controls, and environment controls, all of them controlled directly from a mobile application over the cloud. An MQTT broker with bridging and a WebSockets server was even developed for the ESP8266. Soon, all those devices will be part of our daily life, so we will all enjoy their functionality.
Read more about Catalin Batrinu