0% found this document useful (0 votes)
13 views38 pages

Ilovepdf Merged

The document provides an overview of the NodeMCU ESP8266 and Arduino Uno microcontroller boards, detailing their specifications, features, and configurations for IoT applications. It explains the power pins, GPIO mapping, communication interfaces, and typical usage guidelines for both boards. The Arduino Uno is highlighted for its versatility in electronic projects and ease of programming, making it suitable for beginners and experienced developers alike.

Uploaded by

themajestic27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

Ilovepdf Merged

The document provides an overview of the NodeMCU ESP8266 and Arduino Uno microcontroller boards, detailing their specifications, features, and configurations for IoT applications. It explains the power pins, GPIO mapping, communication interfaces, and typical usage guidelines for both boards. The Arduino Uno is highlighted for its versatility in electronic projects and ease of programming, making it suitable for beginners and experienced developers alike.

Uploaded by

themajestic27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

GOVT ENGG COLLEGE BANKA

ADITYA KUMAR
24155134902
ABSTRACT

➢ NodeMCU ESP8266 Board


➢ Arduino Uno
➢ Setup and Configuration of
NodeMCU for IoT Application

ADITYA KR
SEM-5TH
CSE(IOT)
BATCH - 2023-27
ROLL NO-D-24640
adityaraj4296@[Link]
1. Overview of NodeMCU ESP8266 Board

T
he NodeMCU ESP8266 is a Wi-Fi-enabled microcontroller development board based on the

ESP-12E module, which contains the ESP8266EX SoC and 4 MB external flash memory.
It exposes the ESP8266 GPIO pins, power pins, and communication interfaces on two rows of 15
header pins, making it easy to connect sensors, actuators, and other modules on a breadboard.
The board includes a USB-to-Serial interface, voltage regulator, reset circuitry, and
auto-programming logic so it can be programmed directly from a computer using a micro-USB
cable.

NodeMCU ESP8266 (ESP-12E) – Technical Description

1. Overview

The NodeMCU ESP8266 is a Wi-Fi-enabled development board based on the ESP-12E module, which
integrates an ESP8266EX microcontroller and external flash memory.
It exposes power pins, digital GPIO pins, one analog input, and communication interfaces on two
15-pin headers, making it easy to use with breadboards and external modules.
The board includes a USB-to-Serial converter, 3.3 V regulator, reset and enable circuitry, and
auto-programming logic, so it can be programmed directly via a micro-USB cable from a PC.
2. Power Pins and Electrical Characteristics

Vin

• External power input pin.

• Recommended input: about 4.6 V to 9 V; 5 V is commonly used for stable operation and
lower heat.

• Connected to an onboard linear regulator that generates the 3.3 V rail used by the ESP8266
and 3V3 pins.

3V3 (3.3 V)

• Output of the onboard 3.3 V regulator.

• Used to power 3.3 V sensors and modules.

• Regulator can typically supply up to around 600 mA total; the ESP8266 itself can draw 200–
300 mA peaks during Wi-Fi activity, so remaining current for external devices is limited.

GND

• Multiple ground pins on both sides.

• Act as the common reference for all power and signal lines.

• External modules must share ground with the NodeMCU for reliable communication.

EN (Enable)

• Chip enable input.

• Must be held HIGH (3.3 V) for normal operation; pulling EN LOW powers down the ESP8266.

RST (Reset)

• Hardware reset input.

• Momentarily pulling RST LOW resets the microcontroller; typically wired to the “RST”
push-button on the board.

Power consumption (typical)

• Active Wi-Fi transmission: approximately 70–200 mA depending on mode and RF conditions.

• Sleep modes (modem-sleep and deep-sleep) can reduce current down to a few milliamps or
less than 1 mA for battery-powered designs.

3. Analog Input

A0 (ADC0)

• Single analog-to-digital input channel.

• 10-bit resolution, returning values from 0 to 1023.


• The ESP8266 core expects 0–1.0 V, but the NodeMCU includes a resistor divider so A0 can
accept up to about 3.3 V directly on most NodeMCU boards.

• Commonly used for analog sensors such as potentiometers, light sensors (LDR), and some
analog temperature sensors.

4. Digital I/O Pins and GPIO Mapping

The labels printed on the board (D0–D8, RX, TX) map to internal GPIO numbers used in code.
In the Arduino IDE, the “NodeMCU 1.0 (ESP-12E Module)” board definition lets you use the D-labels
directly, but knowing the GPIO mapping is important for advanced use.

4.1 Digital Pin Mapping

• D0 → GPIO 16 – general-purpose I/O; supports wake from deep-sleep, but no hardware


interrupt.

• D1 → GPIO 5 – safe at boot; commonly used as I²C SCL or general-purpose I/O.

• D2 → GPIO 4 – safe at boot; commonly used as I²C SDA or general-purpose I/O.

• D3 → GPIO 0 – boot-strapping pin; must be HIGH at boot for normal startup; LOW at boot
enters flash mode.

• D4 → GPIO 2 – boot-strapping pin; must be HIGH at boot; usually connected to the onboard
blue LED (LED ON when pin is LOW).

• D5 → GPIO 14 – safe at boot; often used as SPI SCK or general-purpose I/O.

• D6 → GPIO 12 – safe at boot; often used as SPI MISO or general-purpose I/O.

• D7 → GPIO 13 – safe at boot; often used as SPI MOSI or general-purpose I/O.

• D8 → GPIO 15 – boot-strapping pin; must be LOW at boot for normal startup; typically used
as SPI CS when wired carefully.

• RX → GPIO 3 – UART0 RX; used for serial receive and programming; can act as a
general-purpose input if serial is not required.

• TX → GPIO 1 – UART0 TX; used for serial transmit and programming; can act as a
general-purpose output when serial is not required.

Safest general-purpose pins


For most sensors, buttons, and modules, the safest pins that avoid boot conflicts are D1 (GPIO 5), D2
(GPIO 4), D5 (GPIO 14), D6 (GPIO 12), and D7 (GPIO 13).

5. Internal Flash / SD Pins and Reserved Pins

The left-side header also includes pins labeled SD3, SD2, SD1, CMD, SD0, CLK, and two RSV pins.
These are primarily used internally by the ESP8266 to interface with the onboard SPI flash memory.

• SD3 → GPIO 10 – flash/SD data line 3.

• SD2 → GPIO 9 – flash/SD data line 2.


• SD1 → GPIO 8 – flash/SD data line 1.

• SD0 → GPIO 7 – flash/SD data line 0.

• CMD → GPIO 11 – flash command / chip-select.

• CLK → GPIO 6 – flash clock.

Most practical guides strongly recommend not using these signals for external circuitry, because
interfering with them can corrupt flash communication and prevent the board from booting.
Pins marked RSV (reserved) should also remain unconnected in user designs.

6. Communication Interfaces

6.1 I²C (Software I²C)

The ESP8266 implements I²C via software bit-banging; there are no fixed hardware I²C pins.
By convention, on NodeMCU the default I²C pins are:

• SDA: D2 (GPIO 4)

• SCL: D1 (GPIO 5)

These defaults are used by many libraries and tutorials, but software I²C can be configured to use
other GPIOs if necessary.

6.2 SPI

The ESP8266 provides hardware SPI for high-speed peripherals such as displays and external storage.
On NodeMCU, the user-accessible SPI pins are typically:

• SCLK: D5 (GPIO 14)

• MISO: D6 (GPIO 12)

• MOSI: D7 (GPIO 13)

• CS: D8 (GPIO 15), or any spare GPIO as chip-select

When using D8 as CS, ensure it remains LOW during boot to avoid changing the boot mode.

6.3 UART (Serial)

The board integrates a USB-to-Serial converter (CP2102 or CH340) connected to UART0 of the
ESP8266.

• TX0: GPIO 1 (TX header pin).

• RX0: GPIO 3 (RX header pin).

These pins handle sketch uploads and serial debugging, typically at 115200 baud or higher.

7. Boot Mode Considerations and “Problem” Pins


Some GPIO pins determine how the ESP8266 boots, so incorrect wiring can stop the board from
starting your program.

• GPIO 0 (D3): Must be HIGH at reset for normal boot; LOW puts chip into flash programming
mode.

• GPIO 2 (D4): Must be HIGH at boot; also drives the onboard LED; avoid external circuits that
force it LOW at reset.

• GPIO 15 (D8): Must be LOW at boot; avoid pull-ups or active-HIGH signals during reset.

Because of these requirements, for simple projects the recommended approach is to use only D1,
D2, D5, D6, and D7 for general connections, and reserve D3, D4, and D8 for advanced use when you
fully understand the boot-mode behavior.

8. Typical Usage Guidelines

Digital sensors and relays

• Connect to D1, D2, D5, D6, or D7.

• Use GND and 3V3 for power, and ensure relay or motor driver modules are 3.3 V compatible
or use proper level shifting.

Analog sensors

• Connect sensor output to A0 with a maximum voltage of 3.3 V.

• If the sensor outputs higher voltage, use a resistor divider to scale it down.

I²C modules (OLED, MPU6050, etc.)

• SDA → D2 (GPIO 4), SCL → D1 (GPIO 5).

• Use pull-up resistors to 3.3 V if the module does not already include them.

SPI modules (TFT, external SD card)

• Use D5, D6, D7 for SCLK, MISO, MOSI and select a suitable CS pin (often D8 or another GPIO).

Programming and debugging

• Keep TX/RX free if continuous serial debugging is required.

• In Arduino IDE, select “NodeMCU 1.0 (ESP-12E Module)” as the board, choose the correct
COM port, and upload sketches via the micro-USB connection.
ARDUNIO UNO

Arduino Uno is a popular microcontroller board widely used in electronic projects and
prototyping. It is based on the ATmega328P microcontroller and is designed to facilitate
easy programming and integration for both beginners and experienced developers. The
Arduino Uno board provides a simple platform for controlling sensors, motors, lights, and
other electronic components, making it an essential tool in the field of embedded systems
and Internet of Things (IoT).

Key features of the Arduino Uno include:

• Microcontroller: ATmega328P
• Operating Voltage: 5V
• Input Voltage (recommended): 7-12V
• Digital I/O Pins: 14 (of which 6 can be used as PWM outputs)
• Analog Input Pins: 6
• Flash Memory: 32 KB (of which 0.5 KB is used by bootloader)
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
The Arduino Uno is used for a wide range of applications, including robotics, automation,
sensor data collection, and educational purposes. Its open-source nature allows users to
modify and expand its capabilities through various shields and modules. The board is
compatible with the Arduino IDE, a user-friendly programming environment that simplifies
coding and uploading programs to the microcontroller.

In summary, the Arduino Uno is a versatile and accessible microcontroller platform that serves as an
excellent starting point for learning electronics, developing prototypes, and creating innovative
electronic solutions.

ARDUNIO UNO PIN CONFIGURATION

Arduino Uno R3 Specifications

The Arduino Uno R3 board includes the following specifications.

• It is an ATmega328P based Microcontroller

• The Operating Voltage of the Arduino is 5V

• The recommended input voltage ranges from 7V to 12V


• The i/p voltage (limit) is 6V to 20V

• Digital input and output pins-14

• Digital input & output pins (PWM)-6

• Analog i/p pins are 6

• DC Current for each I/O Pin is 20 mA

• DC Current used for 3.3V Pin is 50 mA

• Flash Memory -32 KB, and 0.5 KB memory is used by the boot loader

• SRAM is 2 KB

• EEPROM is 1 KB

• The speed of the CLK is 16 MHz

• In Built LED

• Length and width of the Arduino are 68.6 mm X 53.4 mm

• The weight of the Arduino board is 25 g

Arduino Uno R3 Pin Diagram

The Arduino Uno R3 pin diagram is shown below. It comprises 14-digit I/O pins. From these pins, 6-
pins can be utilized like PWM outputs. This board includes 14 digital input/output pins, Analog
inputs-6, a USB connection, quartz crystal-16 MHz, a power jack, a USB connection, resonator-
16Mhz, a power jack, an ICSP header an RST button.

Arduino Uno Pin Diagram


Power Supply

The power supply of the Arduino can be done with the help of an exterior power supply otherwise
USB connection. The exterior power supply (6 to 20 volts) mainly includes a battery or an AC to DC
adapter. The connection of an adapter can be done by plugging a center-positive plug (2.1mm) into
the power jack on the board. The battery terminals can be placed in the pins of Vin as well as GND.
The power pins of an Arduino board include the following.

Vin: The input voltage or Vin to the Arduino while it is using an exterior power supply opposite to
volts from the connection of USB or else RPS (regulated power supply). By using this pin, one can
supply the voltage.

5Volts: The RPS can be used to give the power supply to the microcontroller as well as components
which are used on the Arduino board. This can approach from the input voltage through a regulator.

3V3: A 3.3 supply voltage can be generated with the onboard regulator, and the highest draw current
will be 50 mA.

GND: GND (ground) pins

Memory

The memory of an ATmega328 microcontroller includes 32 KB and 0.5 KB memory is utilized for the
Boot loader), and also it includes SRAM-2 KB as well as EEPROM-1KB.

Input and Output

We know that an arguing Uno R3 includes 14-digital pins which can be used as an input otherwise
output by using the functions like pin Mode (), digital Read(), and digital Write(). These pins can
operate with 5V, and every digital pin can give or receive 20mA, & includes a 20k to 50k ohm pull up
resistor. The maximum current on any pin is 40mA which cannot surpass for avoiding the
microcontroller from the damage. Additionally, some of the pins of an Arduino include specific
functions.

Serial Pins

The serial pins of an Arduino board are TX (1) and RX (0) pins and these pins can be used to transfer
the TTL serial data. The connection of these pins can be done with the equivalent pins of the
ATmega8 U2 USB to TTL chip.

External Interrupt Pins

The external interrupt pins of the board are 2 & 3, and these pins can be arranged to activate an
interrupt on a rising otherwise falling edge, a low-value otherwise a modify in value

PWM Pins

The PWM pins of an Arduino are 3, 5, 6, 9, 10, & 11, and gives an output of an 8-bit PWM with the
function analog Write ().

SPI (Serial Peripheral Interface) Pins

The SPI pins are 10, 11, 12, 13 namely SS, MOSI, MISO, SCK, and these will maintain the SPI
communication with the help of the SPI library.

LED Pin
An arguing board is inbuilt with a LED using digital pin-13. Whenever the digital pin is high, the LED
will glow otherwise it will not glow.

TWI (2-Wire Interface) Pins

The TWI pins are SDA or A4, & SCL or A5, which can support the communication of TWI with the help
of Wire library.

AREF (Analog Reference) Pin

An analog reference pin is the reference voltage to the inputs of an analog i/ps using the function like
analog Reference().

Reset (RST) Pin

This pin brings a low line for resetting the microcontroller, and it is very useful for using an RST
button toward shields which can block the one over the Arduino R3 board.

Communication

The communication protocols of an Arduino Uno include SPI, I2C, and UART serial communication.

UART

An Arduino Uno uses the two functions like the transmitter digital pin1 and the receiver digital pin0.
These pins are mainly used in UART TTL serial communication.

I2C

An Arduino UNO board employs SDA pin otherwise A4 pin & A5 pin otherwise SCL pin is used for I2C
communication with wire library. In this, both the SCL and SDA are CLK signal and data signal.

SPI Pins

The SPI communication includes MOSI, MISO, and SCK.

MOSI (Pin11)

This is the master out slave in the pin, used to transmit the data to the devices

MISO (Pin12)

This pin is a serial CLK, and the CLK pulse will synchronize the transmission of which is produced by
the master.

SCK (Pin13)

The CLK pulse synchronizes data transmission that is generated by the master. Equivalent pins with
the SPI library is employed for the communication of SPI. ICSP (in-circuit serial programming) headers
can be utilized for programming ATmega microcontroller directly with the boot loader.

Arduino Uno R3 Programming

• The programming of an Arduino Uno R3 can be done using IDE software. The microcontroller
on the board will come with pre-burned by a boot loader that permits to upload fresh code
without using an exterior hardware programmer.

• The communication of this can be done using a protocol like STK500.


• We can also upload the program in the microcontroller by avoiding the boot loader using the
header like the In-Circuit Serial Programming.

Arduino Uno R3 Projects

The applications of Arduino Uno mainly involves in Arduino Uno based projects which include the
following

• Visitor Alarm in Office using Arduino Uno

• Arduino Uno based Soccer Robot

• Arduino Uno based Automatic Medication Reminder

• Motion Detecting with Static Electricity

• Arduino Uno based Taxi with Digital Fare Meter

• Arduino Uno based Smart Stick

• Robot Car Controlled by Smartphone and Arduino

Thus, this is all about Arduino Uno R3 datasheet. From the above information finally, we can
conclude that it is the most frequently used board. UNO is a great choice for first Arduino due to its
features like it is relatively cheap; we can replace the microcontroller & very easy to set up. Here is a
question for you, what are the applications of an Arduino Uno R3?

Study of Setup and Configuration of NodeMCU for IoT Application.

Introduction

NodeMCU is an open-source IoT development board based on the ESP8266 Wi-Fi module. It
integrates a microcontroller with built-in Wi-Fi capability, making it suitable for Internet of Things
(IoT) projects such as smart home systems, remote monitoring, automation, and cloud-based control
systems.

NodeMCU can be programmed using:

• Arduino IDE

• Lua firmware

• MicroPython

For most academic and beginner IoT applications, Arduino IDE is commonly used because of its
simplicity and extensive library support.

Hardware Required

NodeMCU ESP8266 board

Micro USB cable

Computer/Laptop

Internet connection

Software Required
• Arduino IDE (latest stable version)

• USB driver (if required, depending on CP2102 or CH340 chip)

Theory

NodeMCU works on the ESP8266 Wi-Fi SoC (System on Chip). It contains:

• 32-bit microcontroller

• Built-in TCP/IP stack

• 2.4 GHz Wi-Fi

• GPIO pins

• ADC (Analog to Digital Converter)

• PWM support

Unlike traditional microcontrollers such as Arduino Uno (which require an external Wi-Fi module),
NodeMCU has inbuilt Wi-Fi, making it compact and cost-effective for IoT systems.

Procedure: Setup and Configuration

Step 1: Install Arduino IDE

1. Download Arduino IDE from the official website.

2. Install it on the system.

3. Open the Arduino IDE.

Step 2: Add ESP8266 Board to Arduino IDE


1. Open Arduino IDE.

2. Go to File → Preferences.

3. In “Additional Board Manager URLs” add:

4.

5. Click OK.

Step 3: Install ESP8266 Package

1. Go to Tools → Board → Boards Manager.

2. Search for “ESP8266”.

3. Install “ESP8266 by ESP8266 Community”.

Step 4: Select Board and Port

1. Go to Tools → Board → NodeMCU 1.0 (ESP-12E Module).


2. Connect NodeMCU to PC using USB cable.

3. Go to Tools → Port and select the correct COM port.

Step 5: Upload Test Program


Experiment 8
AIM: To perform TCP and UDP connection check in the system.

INTRODUCTION:
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are communication protocols used in
computer networks. TCP is reliable and connection-oriented, while UDP is faster and connectionless.

THEORY:
TCP establishes a connection before transferring data and ensures reliable communication. UDP sends data
without establishing a connection and does not guarantee delivery.

COMPARISON BETWEEN TCP AND UDP:


TCP UDP
Connection-oriented Connectionless
Reliable Unreliable
Slower Faster
Used in Web Browsing Used in Streaming

COMMANDS USED:

1. netstat -a → Displays all active connections and listening ports.


2. netstat -an → Displays active connections in numerical format.
3. netstat -c → Continuously monitors network connections.
4. netstat -r → Displays routing table.
5. netstat -t → Displays TCP connections.
6. netstat -l → Displays listening ports.
7. netstat -p → Displays process ID using the connection.
8. netstat -all → Displays all network statistics.
9. netstat -af | findstr :80 → Finds connections using port 80.
10. netstat -n | findstr established → Displays established connections.

PROCEDURE:
1. Open Command Prompt or Terminal.
2. Connect the system to the internet.
3. Execute different Netstat commands.
4. Observe active TCP and UDP connections.
5. Analyze listening ports and established sessions.

OBSERVATION:
• TCP displayed reliable and established connections.
• UDP displayed active ports without connection establishment.
• Active ports and routing details were successfully observed.

RESULT:
TCP and UDP connection checks were successfully performed using Netstat commands.

CONCLUSION:
The experiment successfully demonstrated the working of TCP and UDP protocols and various Netstat commands
used in networking analysis.

You might also like