Hello Guys ,In this post we learn about how Electronic devices used without Internet in Arduino for nodemcu etc.
Let start it:-
*Parts Required
|
*Software apps Use
1. Blynk
2. Ardunio Ide
3. Bluetooth Automation
*Introduction
Numerous IoT based Home Automation projects crashes when the Internet speed goes down. Thus, inside this task, I attempted to fabricate such an IoT model that can computerize the Home when Internet speed is great as well as when Internet speed goes down. In this task, I will utilize OSH NodeMCU V1.0 ESP8266 Development Board and Bluetooth HC-05 Module for correspondence and control of 4 AC loads associated with NodeMCU with Blynk Android App and my hand crafted Bluetooth Automation App. Blynk App can be utilized when Internet speed is acceptable on the two sides and Bluetooth Automation App can be utilized when you are close to the venture and not have the web by any means.
You can add a hand-off module to control real electrical machines like water siphons, fountains, LED bulbs, Fans, and so on For giving a 5V stock to an undertaking I have associated Arduino Uno's +5V and GND pin to the Vin and GND pin of NodeMCU board, rather than IC 7805 and Battery.
NodeMCU:
NodeMCU is a minimal expense open-source IoT stage. It at first included firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems and equipment which depended on the ESP-12 module. Afterward, support for the ESP32 32-bit MCU was added. NodeMCU is an open-source firmware for which open-source prototyping board plans are accessible. The name "NodeMCU" consolidates "hub" and "MCU" (miniature regulator unit).The term "NodeMCU" rigorously talking alludes to the firmware instead of the related advancement packs. Both the firmware and prototyping board plans are open source.
The firmware utilizes the Lua prearranging language. The firmware depends on the Lua project and based on the Espressif Non-OS SDK for ESP8266. It utilizes many open source projects, for example, lua-json and SPIFFS. Because of asset requirements, clients need to choose the modules applicable to their undertaking and assemble a firmware custom fitted to their necessities. Backing for the 32-bit ESP32 has likewise been carried out.
The prototyping equipment regularly utilized is a circuit board working as a double in-line bundle (DIP) which incorporates a USB regulator with a more modest surface-mounted board containing the MCU and recieving wire. The decision of the DIP design considers simple prototyping on breadboards. The plan was at first depended on the ESP-12 module of the ESP8266, which is a Wi-Fi SoC incorporated with a Tensilica Xtensa LX106 center, generally utilized in IoT applications (see related activities).
Voltage: 3.3V
Wi-Fi Direct (P2P), delicate AP
Current utilization: 10uA~170mA
Streak memory connectable: 16MB max (512K ordinary)
Incorporated TCP/IP convention stack
Processor: Tensilica L106 32-bit
Processor speed: 80~160MHz
Smash: 32K + 80K. • GPIOs: 17 (multiplexed with different capacities)
Simple to Digital: 1 contribution with 1024 stage goal
+19.5dBm yield power in 802.11b mode
802.11 help: b/g/n
Greatest simultaneous TCP associations: 5
HC-05 Bluetooth Module
The Bluetooth module HC-05 is a MASTER/SLAVE module. As a matter of course, the manufacturing plant setting is SLAVE. The Role of the module (Master or Slave) can be arranged simply by AT COMMANDS. The slave modules can't start an association with another Bluetooth gadget yet can acknowledge associations. The expert module can start an association with different gadgets. The client can utilize it just for a sequential port substitution to build up an association among MCU and GPS, PC to your installed project, and so forth The HC-05 Bluetooth module is the most prudent and simplest approach remote (through Bluetooth).
*Blynk App
-Download Blynk app from playstore.
Introduce the Blynk Android App and open it. Sign in to Blynk App with email address and make a venture by tapping on "New Project "as "IoT Home Automation", select board as NodeMCU, association type as Wi-Fi, select dim or light subject and snap on make. -Copy The following code in ardunio ide
/*********
-Tech Gyan Creative
Complete project details at https://techgyancreative.blogspot.com/
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*********/
// Import required libraries/*
This is the code for the project called
"IoT based Home Automation with & without Internet"
The demonstration Video for the project is uploaded on YouTube channel.
Youtube Video Link - https://youtu.be/ubuC9jBywi0
Project Link - https://www.hackster.io/pranavkhatale/iot-based-home-automation-with-without-internet-bf633c
by Pranav Khatale
*/
// Including the required libraries
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
int LED1 = D1; //Red LED is connected to pin D1 of NodeMCU Board
int LED2 = D2; //Yellow LED is connected to pin D2 of NodeMCU Board
int LED3 = D3; //Green LED is connected to pin D3 of NodeMCU Board
int LED4 = D4; //Blue LED is connected to pin D4 of NodeMCU Board
char auth[] = "JKBTZ9MWsITQqY9YIdwwIJyzk-98quwZ"; // Put your Blynk Authentication token received on email
char ssid[] = "Dlink"; // Put the Wi-Fi network's SSID here
char pass[] = "12341234"; // Put the Wi-Fi network's Password here
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(LED1, pinValue);
// process received value
}
BLYNK_WRITE(V2)
{
int pinValue = param.asInt(); // assigning incoming value from pin V2 to a variable
digitalWrite(LED2, pinValue);
// process received value
}
BLYNK_WRITE(V3)
{
int pinValue = param.asInt(); // assigning incoming value from pin V3 to a variable
digitalWrite(LED3, pinValue);
// process received value
}
BLYNK_WRITE(V4)
{
int pinValue = param.asInt(); // assigning incoming value from pin V4 to a variable
digitalWrite(LED4, pinValue);
// process received value
}
void setup()
{
pinMode(LED1, OUTPUT); // Declaring LED1 as output
pinMode(LED2, OUTPUT); // Declaring LED2 as output
pinMode(LED3, OUTPUT); // Declaring LED3 as output
pinMode(LED4, OUTPUT); // Declaring LED4 as output
Serial.begin(9600); /* Define baud rate for serial communication */
Blynk.begin(auth, ssid, pass); // Blynk starts by providing essential details
}
void loop()
{
Blynk.run();
if (Serial.available()) /* If data is available on serial port */
{
char data_received;
data_received = Serial.read(); /* Data received from bluetooth */
if (data_received == '1')
{
digitalWrite(LED1, HIGH); // LED1 pin is given a HIGH logic
Blynk.virtualWrite(V1, 1); // Blynk App receives the HIGH logic
Serial.write("LED1 turned ON\n");
}
else if (data_received == '2')
{
digitalWrite(LED1, LOW);
Blynk.virtualWrite(V1, 0);
Serial.write("LED1 turned OFF\n");
}
else if (data_received == '3')
{
digitalWrite(LED2, HIGH);
Blynk.virtualWrite(V2, 1);
Serial.write("LED turned ON\n");;
}
else if (data_received == '4')
{
digitalWrite(LED2, LOW);
Blynk.virtualWrite(V2, 0);
Serial.write("LED2 turned ON\n");;
}
else if (data_received == '5')
{
digitalWrite(LED3, HIGH);
Blynk.virtualWrite(V3, 1);
Serial.write("LED3 turned ON\n");
}
else if (data_received == '6')
{
digitalWrite(LED3, LOW);
Blynk.virtualWrite(V3, 0);
Serial.write("LED3 turned ON\n");
}
else if (data_received == '7')
{
digitalWrite(LED4, HIGH);
Blynk.virtualWrite(V4, 1);i
Serial.write("LED4 turned ON\n");
}
else if (data_received == '8')
{
digitalWrite(LED4, LOW);
Blynk.virtualWrite(V4, 0);
Serial.write("LED4 turned ON\n");
}
else
{
}
}
}
-Enjoy













