M2M alarm system
In the previous chapters, we looked at the different ways of achieving M2M communication between two ESP8266 boards. In this recipe, we will look at how to implement M2M communication in an IoT project. To do that, we will create a simple M2M alarm system with one ESP8266 board connected to a DHT11 sensor and the other connected to a buzzer. The alarm will be triggered when the temperature reading drops below 20 degrees Celsius.
Getting ready
You will need the following hardware components:
ESP8266 board
USB cable
DHT11 temperature/humidity sensor (https://www.sparkfun.com/products/10167)
10 kΩ resistor
Buzzer
Breadboard
Jumper wires
The DHT11 pin configuration is shown in the following figure:
First, mount the ESP8266 board and the DHT11 sensor onto the breadboard.
Connect a 10 kΩ pull up resistor to the DHT11 data pin and connect the VCC pin and GND pin to the 3V pin and GND pin of the ESP8266 board, respectively.
Finally, connect the data pin of the DHT11 to GPIO2 of the ESP8266 board...