Smart Extension Box With ESP-NOW Protocol
Introduction: Smart Extension Box With ESP-NOW Protocol
In the previous Instructable we saw how to implement a gesture detection algorithm for our esp8266 based fitness watch, Where we were able to detect different hand gestures and display them on the OLED screen. In this Instructable we’ll take that gesture detection feature one step ahead and also make a complimentary hardware called "Smart Extension Box" which will let us control multiple home appliance devices connected to it with our watch. Get the below supplies and let's the build!
Supplies
These are the list of products which can help you do this project with ease
(Affiliate Link)
* Esp12E: https://amzn.to/3h3b37s
* OLED display: https://amzn.to/2VcEATc
* MPU6050: https://amzn.to/2J8E06T
* Haptic motor(exact one): https://amzn.to/2J8E06T
* Haptic motor(alternative): https://amzn.to/2J8E06T
* 3.3V regulator: https://amzn.to/2J8E06T
* 105mah battery: https://amzn.to/2J8E06T
* Velcro: https://amzn.to/2J8E06T
* Header Pins: https://amzn.to/2J8E06T
* Angled Header Pins: https://amzn.to/2J8E06T
* Wires: https://amzn.to/2J8E06T
* FTDI: https://amzn.to/2J8E06T
* Male USB: https://amzn.to/2J8E06T
* PCB: https://amzn.to/2J8E06T
* Soldering Gun: https://amzn.to/2J8E06T
* Soldering Lead: https://amzn.to/2J8E06T
* Foam sheets: https://amzn.to/2J8E06T
* Hi-link: https://amzn.to/3dsAQHM
* Extension Box: https://amzn.to/3sf2pZ4
* Relay 5V : https://amzn.to/37zvCpK
* screw terminal: https://amzn.to/3qHwVKP
* Transistor: https://amzn.to/3kcfrnE
* Diode : https://amzn.to/3kdewTJ
* Resistor : https://amzn.to/2ZCruRu
Step 1: ESP NOW
It’s a proprietary protocol by Espressif. It’s a very clever little protocol where data is transferred from one to another without actually making a connection between each other. It sounds confusing but here me out.
Unlike bluetooth or wifi it doesn’t need any pairing or handshake to establish a connection between devices. 382
Instead it uses something called a vendor action frame to transfer data. You can check their official documentation to know more about how it works.
Because I’m more interested in the advantages and limitations of this ESP NOW protocol, so we’ll have a better understanding why we are using this in our project.
Step 2: Why ESP NOW
Limitations
One of the big downside to this protocol will be, it can transfer only 250Byets of data at once so the transfer data is quite limited when compared to WiFi, bluetooth or LORA. Since it’s not making any sort of connection like wifi, it cannot access the Internet to get any additional information and Finally only 20 devices can be connected to one master device.
Advantages
Even though the data and devices are limited. In our case it should be good for just transferring ON and OFF signals. Because the protocol has other upsides like, it doesn't need any router or DHCP server so it can be used anywhere just by using 2 ESP device and it doesn't take much time to pair or connect to another device, So data can be transferred in very less time, and the device can go to sleep to save power after the data is transferred.
Step 3: Different Modes of ESP NOW
There are three modes in ESP-NOW protocol, Controller mode which can only send data, Slave mode which can receive only data and finally combo mode which can send as well as receive data. For our purpose we just need to send the data from the watch, so we can use controller mode for the watch and for the home appliance device we’ll use the slave mode. 977