SlideShare a Scribd company logo
NODEMC
U
1
3
4
We will now have connectivity for anything. From
any time, any place connectivity for anyone!!!
5
Various Names, One Concept
For over a decade after the introduction of the term
Internet-of-Things,different organizations and
working groups have been providing various
definitions.
• M2M (Machine to Machine)
• “Internet of Everything” (Cisco Systems)
• “World Size Web” (Bruce Schneier)
• “Skynet” (Terminator movie)
• Cloud of Things
• Web of Things
6
7
What is NodeMCU?
 The NodeMCU (Node MicroController Unit) is an open
source software and hardware development environment
that is built around a very inexpensive System-on-a-Chip
(SoC) called the ESP8266.
 An Arduino-like device
 Main component: ESP8266 With
programmable pins And built-in
wifi
 Power via USB
 Low cost
8
What you can do with it?
 Program it via C or LUA
 Access it via wifi (ex. HTTP)
 Connect pins to any device
(in or out)
9
Main Component
10
Pin Description
11
ESP8266 Block Diagram
Figure : ESP8266EX Block Diagram
12
Types of ESP8266
13
Download and install the Arduino Software
14
Programming an Arduino
• The Arduino software
consists of a development
environment (IDE) and the
core libraries.
• The IDE is written in Java
and based on
the processing environment.
• The core libraries are
written in C and C++ and
compiled using avr-gcc
compiler.
15
Arduino environment
16
Program Structure
Setup( )
{
// A function that runs once at the start of a program and is used to
set //pinMode or initialize serial communication
}
loop( )
{
// This function includes the code to be executed continuously – reading
inputs, //triggering outputs, etc.
// This function is the core of all Arduino programs and does the bulk of
the //work.
}
17
BREAD BOARD
18
Nodemcu assembling on Breadboard
19
LED (Light emitting diode)
20
Activity 1.1
Type : Team of 2 Duration : 20 Minutes
Single LED blink program using web
.
Anode of LED Cathode of
LED
21
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
const char* ssid = "XXXX"; //Mention SSID
const char* password = "XXXX"; //Mention password
int ledPin = 5; //pin D1 of nodemcu
WiFiServer server(80);
void setup() {
Serial.begin(115200);
delay(10);
22
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
// Connect to WiFi network
Serial.println();
Serial.println();
WiFi.mode(WIFI_AP);
/* You can remove the password parameter if you
want the AP to be open. */
Serial.print("Connecting to ");
Serial.println(ssid);
23
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// Start the server
server.begin();
Serial.println("Server started");
24
// Print the IP address
Serial.print("Use this URL to connect: ");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.println("/");
}
25
void loop()
{
// Check if a client has connected
WiFiClient client = server.available();
if (!client)
{
return;
}
// Wait until the client sends some data
Serial.println("new client");
while (!client.available())
{
delay(1);
}
26
// Read the first line of the request
String request = client.readStringUntil('r');
Serial.println(request);
client.flush();
// Match the request
int value = LOW;
if (request.indexOf("/LED=ON") != -1) {
digitalWrite(ledPin, HIGH);
value = HIGH;
}
if (request.indexOf("/LED=OFF") != -1) {
digitalWrite(ledPin, LOW);
value = LOW;
}
27
// Return the response
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println(""); // do not forget this one
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.print("Led pin is now: ");
if (value == HIGH) {
client.print("On");
} else {
client.print("Off");
}
client.println("<br><br>");
client.println("<a href="/LED=ON""><button>Turn On </button></a>");
client.println("<a href="/LED=OFF""><button>Turn Off </button></a><br
/>");
client.println("</html>");
28
delay(1);
Serial.println("Client disonnected");
Serial.println("");
}
29
Interfacing with NodeMCU
30
Activity 1.2
Type : Team of 2 Duration : 20 Minutes
Two LEDs blink program using web
31
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
const char* ssid = "xxxx"; //Mention SSID
const char* password = "xxxx"; //Mention password
int ledPin = 5; //pin D2 of nodemcu
int ledPin1 = 4; //pin D1 of nodemcu
WiFiServer server(80);
void setup() {
Serial.begin(115200);
delay(10);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
32
// Connect to WiFi network
Serial.println();
Serial.println();
WiFi.mode(WIFI_AP);
/* You can remove the password parameter if you want the AP to be open. */
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// Start the server
server.begin();
Serial.println("Server started");
33
// Print the IP address
Serial.print("Use this URL to connect: ");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.println("/");
}
void loop()
{
// Check if a client has connected
WiFiClient client = server.available();
34
if (!client)
{
return;
}
// Wait until the client sends some data
Serial.println("new client");
while (!client.available())
{
delay(1);
}
// Read the first line of the request
String request = client.readStringUntil('r');
Serial.println(request);
client.flush();
35
// Match the request
int value = LOW;
if (request.indexOf("/LED=ON") != -1) {
digitalWrite(ledPin, HIGH);
value = HIGH;
}
if (request.indexOf("/LED=OFF") != -1) {
digitalWrite(ledPin, LOW);
value = LOW;
}
if (request.indexOf("/LED1=ON") != -1) {
digitalWrite(ledPin1, HIGH);
value = HIGH;
}
if (request.indexOf("/LED1=OFF") != -1) {
digitalWrite(ledPin1, LOW);
value = LOW;
}
36
// Return the response
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println(""); // do not forget this one
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.print("Led pin is now: ");
if (value == HIGH) {
client.print("On");
} else {
client.print("Off");
}
37
client.println("<br><br>");
client.println("<a href="/LED=ON""><button>Turn On
</button></a>");
client.println("<a href="/LED=OFF""><button>Turn Off
</button></a><br />");
client.println("<br><br>");
client.println("<a href="/LED1=ON""><button>Turn On1
</button></a>");
client.println("<a href="/LED1=OFF""><button>Turn Off1
</button></a><br />");
client.println("</html>");
delay(1);
Serial.println("Client disonnected");
Serial.println("");
}
38
Serial communication
What is serial communication ?
39
The word serial means "one after the other."
 What is Baud rate ?
Number of symbols transferred per sec
40
Serial Display Functions
 Serial.begin(baud_rate)
//baud rate(characters per sec) between computer and
board is typically 9600 although you can work with
other speeds by changing settings of COM Port
 Serial.print(value),
//value could be any data and even string
 Serial.println(value)
//print in new line
41
Eg. Print INDIA on serial monitor
void setup( )
{
Serial.begin(9600);// 9600 is default baud rate of serial com
port of a computer
}
void loop( )
{
Serial.println(“INDIA”); // Send the value “INDIA”
}
42
Serial Monitor
43
Activity 1.3
Type : Team of 2 Duration : 20 Minutes
Wi-Fi Network Scanning by NodeMCU
44
#include <ESP8266WiFi.h>
void setup()
{
Serial.begin(115200); // Set WiFi to station mode
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("scan start");
int n = WiFi.scanNetworks(); // WiFi.scanNetworks will
return the number of networksfound
Serial.println("scan done");
45
if (n == 0)
Serial.println("no networks found");
else
{
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i)
{
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " :
"*");
delay(10);
}
46
}
Serial.println("");
delay(5000);
}
47
Learning Outcomes
At the end of the workshop the student should be able to
1. Explain the importance of platform based development
2. Understand The importance of NodeMCU and demonstrate
its interfacing with various devices and sensors.
48
For more information contact:
amarjeetsinght@gmail.com
linkedin.com/in/amarjeetsingh-thakur-54915955
49
50

More Related Content

What's hot

Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
Dr M Muruganandam Masilamani
 
FPGA
FPGAFPGA
Presentation on home automation
Presentation on home automationPresentation on home automation
Presentation on home automation
Subhash Kumar Yadav
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
Selvaraj Seerangan
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
Ravi Phadtare
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
Santosh Verma
 
Comparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLDComparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLD
Gowri Kishore
 
Temperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingTemperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring using
Jagannath Dutta
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
Gagandeep Singh
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
Edgefxkits & Solutions
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
Nishant Kayal
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino
ArduinoArduino
Arduino
vipin7vj
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123
Victor Sue
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
Pantech ProLabs India Pvt Ltd
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
Arvind Singh
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
soma saikiran
 
System On Chip
System On ChipSystem On Chip
System On Chipanishgoel
 

What's hot (20)

Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
FPGA
FPGAFPGA
FPGA
 
Presentation on home automation
Presentation on home automationPresentation on home automation
Presentation on home automation
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 
Comparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLDComparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLD
 
Temperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingTemperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring using
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino
ArduinoArduino
Arduino
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 
System On Chip
System On ChipSystem On Chip
System On Chip
 

Similar to Introduction to Node MCU

NodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDENodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDE
Subhadra Sundar Chakraborty
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
Amarjeetsingh Thakur
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
Jong-Hyun Kim
 
Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
handson28
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Concurrent networking - made easy
Concurrent networking - made easyConcurrent networking - made easy
Concurrent networking - made easy
Amazing Applications AB
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
bishal bhattarai
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
Svet Ivantchev
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IO
Jingfeng Liu
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
Jingfeng Liu
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of things
Raghav Shetty
 
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in LinuxBare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
Alexander Vanwynsberghe
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
Hackito Ergo Sum
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
Charles A B Jr
 
Android 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and NetworkAndroid 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and Network
Caio Pereira
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
hussain0075468
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
srknec
 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kit
Research Design Lab
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
Stefano Sanna
 
Embedded software development using BDD
Embedded software development using BDDEmbedded software development using BDD
Embedded software development using BDD
Itamar Hassin
 

Similar to Introduction to Node MCU (20)

NodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDENodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDE
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
 
Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Concurrent networking - made easy
Concurrent networking - made easyConcurrent networking - made easy
Concurrent networking - made easy
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IO
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of things
 
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in LinuxBare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
 
Android 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and NetworkAndroid 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and Network
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kit
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
Embedded software development using BDD
Embedded software development using BDDEmbedded software development using BDD
Embedded software development using BDD
 

More from Amarjeetsingh Thakur

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
Amarjeetsingh Thakur
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry Pi
Amarjeetsingh Thakur
 
Arduino programming part 2
Arduino programming part 2Arduino programming part 2
Arduino programming part 2
Amarjeetsingh Thakur
 
Arduino programming part1
Arduino programming part1Arduino programming part1
Arduino programming part1
Amarjeetsingh Thakur
 
Python openCV codes
Python openCV codesPython openCV codes
Python openCV codes
Amarjeetsingh Thakur
 
Python Numpy Source Codes
Python Numpy Source CodesPython Numpy Source Codes
Python Numpy Source Codes
Amarjeetsingh Thakur
 
Steemit html blog
Steemit html blogSteemit html blog
Steemit html blog
Amarjeetsingh Thakur
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
Amarjeetsingh Thakur
 
Adafruit_IoT_Platform
Adafruit_IoT_PlatformAdafruit_IoT_Platform
Adafruit_IoT_Platform
Amarjeetsingh Thakur
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
Amarjeetsingh Thakur
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
Amarjeetsingh Thakur
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
Amarjeetsingh Thakur
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
Amarjeetsingh Thakur
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motor
Amarjeetsingh Thakur
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
Amarjeetsingh Thakur
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
Amarjeetsingh Thakur
 

More from Amarjeetsingh Thakur (20)

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry Pi
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry Pi
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry Pi
 
Arduino programming part 2
Arduino programming part 2Arduino programming part 2
Arduino programming part 2
 
Arduino programming part1
Arduino programming part1Arduino programming part1
Arduino programming part1
 
Python openCV codes
Python openCV codesPython openCV codes
Python openCV codes
 
Python Numpy Source Codes
Python Numpy Source CodesPython Numpy Source Codes
Python Numpy Source Codes
 
Steemit html blog
Steemit html blogSteemit html blog
Steemit html blog
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
 
Adafruit_IoT_Platform
Adafruit_IoT_PlatformAdafruit_IoT_Platform
Adafruit_IoT_Platform
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motor
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 

Recently uploaded

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 

Recently uploaded (20)

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 

Introduction to Node MCU

  • 2. 3
  • 3. 4
  • 4. We will now have connectivity for anything. From any time, any place connectivity for anyone!!! 5
  • 5. Various Names, One Concept For over a decade after the introduction of the term Internet-of-Things,different organizations and working groups have been providing various definitions. • M2M (Machine to Machine) • “Internet of Everything” (Cisco Systems) • “World Size Web” (Bruce Schneier) • “Skynet” (Terminator movie) • Cloud of Things • Web of Things 6
  • 6. 7
  • 7. What is NodeMCU?  The NodeMCU (Node MicroController Unit) is an open source software and hardware development environment that is built around a very inexpensive System-on-a-Chip (SoC) called the ESP8266.  An Arduino-like device  Main component: ESP8266 With programmable pins And built-in wifi  Power via USB  Low cost 8
  • 8. What you can do with it?  Program it via C or LUA  Access it via wifi (ex. HTTP)  Connect pins to any device (in or out) 9
  • 11. ESP8266 Block Diagram Figure : ESP8266EX Block Diagram 12
  • 13. Download and install the Arduino Software 14
  • 14. Programming an Arduino • The Arduino software consists of a development environment (IDE) and the core libraries. • The IDE is written in Java and based on the processing environment. • The core libraries are written in C and C++ and compiled using avr-gcc compiler. 15
  • 16. Program Structure Setup( ) { // A function that runs once at the start of a program and is used to set //pinMode or initialize serial communication } loop( ) { // This function includes the code to be executed continuously – reading inputs, //triggering outputs, etc. // This function is the core of all Arduino programs and does the bulk of the //work. } 17
  • 18. Nodemcu assembling on Breadboard 19
  • 19. LED (Light emitting diode) 20
  • 20. Activity 1.1 Type : Team of 2 Duration : 20 Minutes Single LED blink program using web . Anode of LED Cathode of LED 21
  • 21. #include <ESP8266WiFi.h> #include <WiFiClient.h> const char* ssid = "XXXX"; //Mention SSID const char* password = "XXXX"; //Mention password int ledPin = 5; //pin D1 of nodemcu WiFiServer server(80); void setup() { Serial.begin(115200); delay(10); 22
  • 22. pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); // Connect to WiFi network Serial.println(); Serial.println(); WiFi.mode(WIFI_AP); /* You can remove the password parameter if you want the AP to be open. */ Serial.print("Connecting to "); Serial.println(ssid); 23
  • 23. WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); // Start the server server.begin(); Serial.println("Server started"); 24
  • 24. // Print the IP address Serial.print("Use this URL to connect: "); Serial.print("http://"); Serial.print(WiFi.localIP()); Serial.println("/"); } 25
  • 25. void loop() { // Check if a client has connected WiFiClient client = server.available(); if (!client) { return; } // Wait until the client sends some data Serial.println("new client"); while (!client.available()) { delay(1); } 26
  • 26. // Read the first line of the request String request = client.readStringUntil('r'); Serial.println(request); client.flush(); // Match the request int value = LOW; if (request.indexOf("/LED=ON") != -1) { digitalWrite(ledPin, HIGH); value = HIGH; } if (request.indexOf("/LED=OFF") != -1) { digitalWrite(ledPin, LOW); value = LOW; } 27
  • 27. // Return the response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(""); // do not forget this one client.println("<!DOCTYPE HTML>"); client.println("<html>"); client.print("Led pin is now: "); if (value == HIGH) { client.print("On"); } else { client.print("Off"); } client.println("<br><br>"); client.println("<a href="/LED=ON""><button>Turn On </button></a>"); client.println("<a href="/LED=OFF""><button>Turn Off </button></a><br />"); client.println("</html>"); 28
  • 30. Activity 1.2 Type : Team of 2 Duration : 20 Minutes Two LEDs blink program using web 31
  • 31. #include <ESP8266WiFi.h> #include <WiFiClient.h> const char* ssid = "xxxx"; //Mention SSID const char* password = "xxxx"; //Mention password int ledPin = 5; //pin D2 of nodemcu int ledPin1 = 4; //pin D1 of nodemcu WiFiServer server(80); void setup() { Serial.begin(115200); delay(10); pinMode(ledPin1, OUTPUT); pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); 32
  • 32. // Connect to WiFi network Serial.println(); Serial.println(); WiFi.mode(WIFI_AP); /* You can remove the password parameter if you want the AP to be open. */ Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); // Start the server server.begin(); Serial.println("Server started"); 33
  • 33. // Print the IP address Serial.print("Use this URL to connect: "); Serial.print("http://"); Serial.print(WiFi.localIP()); Serial.println("/"); } void loop() { // Check if a client has connected WiFiClient client = server.available(); 34
  • 34. if (!client) { return; } // Wait until the client sends some data Serial.println("new client"); while (!client.available()) { delay(1); } // Read the first line of the request String request = client.readStringUntil('r'); Serial.println(request); client.flush(); 35
  • 35. // Match the request int value = LOW; if (request.indexOf("/LED=ON") != -1) { digitalWrite(ledPin, HIGH); value = HIGH; } if (request.indexOf("/LED=OFF") != -1) { digitalWrite(ledPin, LOW); value = LOW; } if (request.indexOf("/LED1=ON") != -1) { digitalWrite(ledPin1, HIGH); value = HIGH; } if (request.indexOf("/LED1=OFF") != -1) { digitalWrite(ledPin1, LOW); value = LOW; } 36
  • 36. // Return the response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(""); // do not forget this one client.println("<!DOCTYPE HTML>"); client.println("<html>"); client.print("Led pin is now: "); if (value == HIGH) { client.print("On"); } else { client.print("Off"); } 37
  • 37. client.println("<br><br>"); client.println("<a href="/LED=ON""><button>Turn On </button></a>"); client.println("<a href="/LED=OFF""><button>Turn Off </button></a><br />"); client.println("<br><br>"); client.println("<a href="/LED1=ON""><button>Turn On1 </button></a>"); client.println("<a href="/LED1=OFF""><button>Turn Off1 </button></a><br />"); client.println("</html>"); delay(1); Serial.println("Client disonnected"); Serial.println(""); } 38
  • 38. Serial communication What is serial communication ? 39
  • 39. The word serial means "one after the other."  What is Baud rate ? Number of symbols transferred per sec 40
  • 40. Serial Display Functions  Serial.begin(baud_rate) //baud rate(characters per sec) between computer and board is typically 9600 although you can work with other speeds by changing settings of COM Port  Serial.print(value), //value could be any data and even string  Serial.println(value) //print in new line 41
  • 41. Eg. Print INDIA on serial monitor void setup( ) { Serial.begin(9600);// 9600 is default baud rate of serial com port of a computer } void loop( ) { Serial.println(“INDIA”); // Send the value “INDIA” } 42
  • 43. Activity 1.3 Type : Team of 2 Duration : 20 Minutes Wi-Fi Network Scanning by NodeMCU 44
  • 44. #include <ESP8266WiFi.h> void setup() { Serial.begin(115200); // Set WiFi to station mode WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); Serial.println("Setup done"); } void loop() { Serial.println("scan start"); int n = WiFi.scanNetworks(); // WiFi.scanNetworks will return the number of networksfound Serial.println("scan done"); 45
  • 45. if (n == 0) Serial.println("no networks found"); else { Serial.print(n); Serial.println(" networks found"); for (int i = 0; i < n; ++i) { // Print SSID and RSSI for each network found Serial.print(i + 1); Serial.print(": "); Serial.print(WiFi.SSID(i)); Serial.print(" ("); Serial.print(WiFi.RSSI(i)); Serial.print(")"); Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " : "*"); delay(10); } 46
  • 47. Learning Outcomes At the end of the workshop the student should be able to 1. Explain the importance of platform based development 2. Understand The importance of NodeMCU and demonstrate its interfacing with various devices and sensors. 48
  • 48. For more information contact: amarjeetsinght@gmail.com linkedin.com/in/amarjeetsingh-thakur-54915955 49
  • 49. 50