IOT Home Appliances Control Using Blynk Application
by samiobi in Circuits > Arduino
472 Views, 1 Favorites, 0 Comments
IOT Home Appliances Control Using Blynk Application
Home IOT (internet of things) technology becomes more in use everyday, interacting with the home gives the user more flexibility to utilize wisely his appliances as needed, even more it advice the user in case of any threat or danger which can be a life saving. However using IOT at homes needs good understanding because this technology will continue in the future and understanding it will prevent security threats in the future.
Supplies
Node MCU esp8266
Relay module
Fan 24V
Transistor 2N2222
2x 1k ohm resistors
jumper cables
Concept of Operation
This system is used to control any home devices weather its an electronic or electric appliance, it operates within the home Wi-Fi coverage. Moreover the system controls a relay module that can handle high power units such as water pump , light or even air condition. The system sends and receives data using Blynk IOT application through the internet, eventually from a smart phone the user can switch on or off or check the status of any device at home at any time and from anywhere. The authentication key allow Blynk server to route the information to the user's account for this reason its important to ensure the key is correct .Although this system may sound a simple project but it enhances the user understanding of home IOT systems, also it can be used to build up a complete smart home system. Blynk application is a useful IOT software platform, in addition it has many of libraries that can support number of projects. similarly it is capable of integrating with many hardware's such as Arduino, Esp8266 and so on. For simplicity the design of the system is to control a relay module that connect to a FAN , then a button at blynk app controls the fan by switching on and off.
Block Diagram
The block diagram of the system is connected to two sources of power, first one is connected to 24V sources (power station), and the second one is the 5V source (adapter) for the reset of the circuit. The Node MCU is in not connected direct to the relay module, but instead it goes to a transistor switch circuit that triggers the relay, note that output of the Node MCU is 12mA current which is not enough to trigger the relay module. The output of the transistor circuit goes to IN1 relay module. However the 24V supply positive side goes to the positive side of the fan and the negative side is connected to one side of the normally open side and the common of the relay is connected to the negative terminal of the source.
The connection table is one the image above.
Hardware Connection of the System
1. Connect the Transistor circuit with the 1K ohm resistor at the base and 1K ohm resistor at the collector, then connect positive terminal to the collector and negative terminal to emitter.
2. Make positive and negative rails to power the reset of the circuit by the 5V adapter.
3. Connect the Node MCU and relay module positive and negative terminals of the rails.
4. Connect Node MCU pin D1 to the transistor circuit base and connect the relay module IN1 with relay circuit collector.
5. Connect the positive 24V source to the positive terminal of the FAN and the negative terminal of the source to the relay output and the fan negative terminal to the common side.
Pre Coding
In order to start with the coding make sure that ESP8266 Node MCU is configured in your IDE Arduino software, first go to file / preferences and in the additional board manger URL copy the link then press OK (as in the first figure)
"http://arduino.esp8266.com/stable/package_esp8266com_index.json"
Second go to tool / boards/ board manger/ type in esp8266 then install (as in the second figure), third install Blynk library go to sketch / include library / manage libraries then type in Blynk and install (as in the third figure).
After that go to tools boards and select the type of board will be working on Node MUC 1.0 (depends on the version used if it did not work select 0.9) sometimes the version is deferent if this information is not visual on the board (as in the fourth figure).
Coding
The code is simple just copy the the codes and past in the Arduino IDE, replace the XXX with the required information. Then load the code in the ESP8266 Node MCU.
CODE
#define BLYNK_PRINT Serial
#include
#include
char auth[] = "XXXXXX"; // replace xxx with auth key
char ssid[] = "XXXX"; // replace with your ssid
char pass[] = "XXXX"; // replace with your password
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop() {
Blynk.run();
}
Installing Blynk Applicaiton in the Smart Phone
Install Blynk App in your smart phone then create an account, after signing in the app select new project (the authentication key will be sent to your email). Next on the new project page type in the project name (for example SMART HOME ) and select the type of device used for the project select NODE MCU and on the connection type select WIFI.
Now the platform is ready, press on the work space to select a button and align it on the workspace. Then select the button and call it FAN and select the input as digital D1. The figures above explains the process of configuring Blynk pages. There are some parameters that can be altered as user wish such as the type of switch and color.
Finally Connect Everything and Run
Finally connect all the units and run the code, through the Blynk app press the button to switch on the fan and press the button again to switch off the fan. Because the system circuit is connected to a relay module the relay can operate with high power devices, so try something else and tell us about your experience.
Hope you enjoy the project. please do not hesitate to send if you face any issue.
Best regards