Intro: Machine to Machine Talk Using ESP8266
Machine to Machine talk is a subpart of IoT(Internet Of Things) in which a machine gives a command or signal to another machine for doing some task.And in this article, I’ll be teaching you how you can make a simple yet useful project on M2M technology using you very own ESP8266 01 module.
Step 1: How This All Started?
I was facing one problem with the structure and location of my room. I wanted to know if anyone is coming in my room so that I can hide my private stuffs ;-P. I have made one video on what problem I was facing and why I wanted to make this project. Watch out this video to know the story behind this project.
Step 2: Possible Solutions of My Problem
In the Intro video of this project, I asked all my viewers to comment the possible solution that comes in their mind which can solve my problem. Many of my viewers gave their views in the comment of that video. I reviewed all that projects and gave my views regarding their ideas. I also made a video on Reviewing Comments. Watch out this video if you want to know other similar projects for my problem.
Step 3: Components Required
For making this project you’ll require,
- 2 x ESP8266 01 WiFi Modules
- 2 x 9V Batteries
- 2 x 3.3V Regulator IC (AMS 1117)
- 1 X PIR motion sensor module
- 1 X Piezo Buzzer
Step 4: Logic Behind This Project
Here, out of two ESP one is acting as an Access Point and other will try to connect to the first one. Hence, this will avoid the use of external router in between our ESPs. The first ESP which is an Access point, is acting as a server and it will be doing nothing until one particular link is requested from any device connected with this access point. And that particular link is,
As soon as it receives this link, it will buzz the buzzer 5 times with some delay in between. Now the other ESP which is acting as a client will first get connected to the ESP acting as a server and then it will request this link(192.168.4.1/pir) whenever PIR sensor, which is attached with client ESP detects any motion. Conclusion:- Whenever any motion is detected by PIR sensor, the client ESP module will talk to server ESP module and server ESP module will let you know that someone is coming in my room by buzzing the buzzer 5 times.
Step 5: Making of the Project
For making this project, you first need to code your ESP boards. You can code it with your USB to TTL convertor or with your Arduino Board its upto you. If you don’t know how to program your ESP boards with Arduino Firmware, then watch out my video tutorial on that,
Code of both Server and Client are available on my github account. You can download it from there. https://github.com/techiesms/M2M-Talk-Project
> Circuit Diagram
Circuit diagram of ESP as a Server and Client is attached
I have also made tutorial video on the same project in both Hindi and English language. Watch out this video to see my project in action.