Getting Started
Getting Started
DESCRIPTION
➢ In this project the LED was operated using Node Mcu and Moblie, through
an App (Application) developed with the help of MIT App Inventor.
➢ By installing this App in your Android Phone you can able to control the
LED.
Overview
➢ ESP8266 WiFi Module has been a main figure in the IoT market.
➢ There are several IoT Projects based on ESP8266 WiFi Module but Home
Automation i.e. controlling different electrical appliances through WiFi (or
Internet) has always been a trending and in demand project.
➢ So, in this project, We’ll show you how to interface a LED to the ESP8266
WiFi Module and also how control a LED on&off state’s using ESP8266.
➢ For this project, We’ll also create an Android App using which you can use
for controlling purpose.
Hardware Components Required
➢ NodeMCU
➢ LED
➢ Resistor (220K)
➢ Breadboard
➢ Connecting wires
• NodeMCU
• Arduino IDE
▪ The Arduino integrated development environment (IDE) is a cross-
platform application (for Windows, macOS, Linux) that is written in
the programming language Java. ... The Arduino IDE supplies a
software library from the Wiring project, which provides many
common input and output procedures.
• Firebase
▪ Firebase is a mobile and web application development platform
developed by Firebase, Inc. in 2011, then acquired by Google in 2014.
As of October 2018, the Firebase platform has 18 products which are
used by 1.5 million apps.
BLOCK DIAGRAM
CIRCUIT DIAGRAM
HARDWARE CONNECTIONS
▪ LED Anode pin(+) is connected with Node Mcu (D0) pin via
Resister(220k).
STEP 2:
STEP 3:
7. Copy the url from the notepad & paste to firebase url
box,also copy the secret code & paste to firebase token
box.
8. After this process go to block window.
11. Select the math block as per the below the step.
12. Merge the math block with firebase block &
change the (tag) name and (value to store)name as per
the below step.
ARGUING IDE
1.Go to tools and select the Node mcu1.0
(ESP8266module) board.
2.Copy the below program paste it into the Arduino.
#include <Firebase.h>
#include <FirebaseArduino.h>
#include <FirebaseError.h>
#include <FirebaseHttpClient.h>
#include <FirebaseCloudMessaging.h>
#include <FirebaseObject.h>
#include <ESP8266WiFi.h>
void setup()
{
pinMode (D0,OUTPUT);
Serial.begin(115200);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("connecting");
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("connected: ");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.set("LED STATUS",0);
}
void firebasereconnect()
{
Serial.print("Trying to reconnect");
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop()
{
int LED;
if (Firebase.failed())
{
Serial.print("setting number failed:");
Serial.print(Firebase.error());
firebasereconnect();
return;
}
LED=Firebase.getString("LED STATUS").toInt();
if(LED==0)
{
digitalWrite(D0,0);
Serial.println("LED OFF");
}
else if(LED==1)
{
digitalWrite(D0,1);
Serial.println("LED ON");
}
3.Compile the program.
➢ In this project the we monitor the temperature using temperature sensor &
ESP8266 and mobile through an App (Application) developed by the help of
MIT App Inventor.
➢ By installing this App in your Android Phone, you can able to monitor the
temperature of atmosphere .
• Lm35
▪ LM35 is a 3 pin temperature sensor which requires a VCC and GND
and in return the remaining third pin gives us an analog output.
▪ This output is then provided to the ADCs present in AtMega 16 IC
which according to a formula calculate the temperature in °C format.
▪ The LM35 series are precision integrated-circuit temperature sensors,
whose output voltage is linearly proportional to the Celsius
(Centigrade) temperature.
▪ The LM35 thus has an advantage over linear temperature sensors
calibrated in ° Kelvin.
Circuit Diagram
HARDWARE CONNECTIONS
SOFTWARE
STEP 2:
STEP 3:
2.
15. Click the Value then select the “get value block”.
16.Set the block’s as per the below step.
Arduino IDE
1.Open the Arduino IDE & Select the Node Mcu
board write the below program.
#include <Firebase.h>
#include <FirebaseArduino.h>
#include <FirebaseError.h>
#include <FirebaseHttpClient.h>
#include <FirebaseCloudMessaging.h>
#include <FirebaseObject.h>
#include <ESP8266WiFi.h>
void setup()
{
pinMode(A0,INPUT);
Serial.begin(115200);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("connecting");
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("connected: ");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.set("Temperature",0);
}
void firebasereconnect()
{
Serial.print("Trying to reconnect");
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop()
{
float n;
Serial.println("in void loop");
if (Firebase.failed())
{
Serial.print("setting number failed:");
Serial.print(Firebase.error());
firebasereconnect();
return;
}
n=analogRead(A0);
float mv = ( n/1024.0)*5000;
float cel = mv/10;
Firebase.set("Temperature",cel);
Serial.print("Temperature=");
Serial.println(cel);
}