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

Node MCU Programs

The document outlines the study of the NodeMCU ESP32 microcontroller, detailing its features, specifications, and a basic program for testing its functionality. It includes instructions for establishing serial communication between the ESP32 and a computer using USB, along with sample code and procedures for setup. The results confirm successful testing of the ESP32's capabilities and data exchange via serial communication.

Uploaded by

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

Node MCU Programs

The document outlines the study of the NodeMCU ESP32 microcontroller, detailing its features, specifications, and a basic program for testing its functionality. It includes instructions for establishing serial communication between the ESP32 and a computer using USB, along with sample code and procedures for setup. The results confirm successful testing of the ESP32's capabilities and data exchange via serial communication.

Uploaded by

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

Exp no: Study of NodeMCU - ESP32 Features

Aim:

To study the features, specifications, and architecture of the NodeMCU ESP32 microcontroller
and demonstrate a basic program using the ESP32 development board.

Components Required:

1. NodeMCU ESP32 Development Board


2. USB Cable (Micro USB or Type-C, depending on model)
3. Computer with Arduino IDE installed
4. Internet connection (for downloading libraries, if required)

Introduction to NodeMCU ESP32:

NodeMCU-ESP32 is an open-source IoT platform that integrates Wi-Fi and Bluetooth


functionalities. It is a powerful microcontroller designed for low-power applications and wireless
communication.

Key Features of ESP32:

● Processor: Dual-core Xtensa LX6 @ 240 MHz


● RAM: 520 KB SRAM
● Flash Memory: Typically 4 MB
● Wireless Connectivity: Wi-Fi 802.11 b/g/n, Bluetooth v4.2 (Classic + BLE)
● GPIOs: 34 programmable GPIO pins
● ADC: 12-bit, up to 18 channels
● DAC: 2 channels, 8-bit resolution
● PWM: Supported on multiple pins
● Communication Interfaces: UART, SPI, I2C, I2S, CAN
● Operating Voltage: 3.3V
● Power Consumption: Ultra-low power mode for battery applications
Pin Connections:

Pin Function Description

3V3 Power 3.3V Output

GND Ground Ground Pin

GPIO0 Boot Used for flashing the board

GPIO1, GPIO3 UART Serial Communication (TX/RX)

GPIO21, GPIO22 I2C SDA & SCL for I2C


Communication

GPIO34 - GPIO39 ADC Analog Inputs

GPIO25, GPIO26 DAC Digital-to-Analog Output

EN Enable Enable/Reset the Board

Basic Code to Test ESP32:

Upload the following code to check ESP32 functionality.

void setup() {
[Link](115200); // Initialize serial communication
[Link]("ESP32 is ready!");
}

void loop() {
[Link]("Hello from ESP32!");
delay(1000); // Delay of 1 second
}

Procedure:

1. Install Drivers: Ensure that CP210x or CH340 drivers are installed for USB-to-serial
communication.
2. Connect ESP32: Use a USB cable to connect ESP32 to the computer.
3. Open Arduino IDE:
○ Go to Tools → Board → ESP32 Dev Module.
○ Select the correct Port under Tools → Port.
4. Upload Code:
○ Copy and paste the given code into Arduino IDE.
○ Click on Upload to flash the program onto ESP32.
5. Open Serial Monitor:
○ Go to Tools → Serial Monitor.
○ Set the baud rate to 115200.
6. Observe Output: The serial monitor will display "ESP32 is ready!" followed by "Hello
from ESP32!" every second.

Result:The basic functionality of the ESP32 board was successfully tested, and its features were
studied.

Exp no: Serial Communication via USB using ESP32

Title:
Interfacing ESP32 with a Computer via USB for Serial Communication

Aim:

To establish serial communication between an ESP32 microcontroller and a computer using a


USB connection, and to send/receive data using the Arduino Serial Monitor.

Components Required:

1. ESP32 Development Board


2. USB Cable (Micro USB or Type-C, depending on ESP32 model)
3. Computer with Arduino IDE installed

Pin Connections:

For basic serial communication via USB, no external wiring is needed. The USB connection
itself handles serial communication. The TX (GPIO1) and RX (GPIO3) pins of the ESP32 are
used internally.

Code:

void setup() {

// Initialize Serial communication at 115200 baud rate

[Link](115200);

[Link]("ESP32 Serial Communication Started!");

void loop() {

// Check if data is available to read from Serial

if ([Link]()) {

// Read the incoming data

String receivedData = [Link]('\n');

[Link]("Received: ");

[Link](receivedData);
// Echo the received data back to the sender

[Link]("Echo: ");

[Link](receivedData);

Procedure:
1. Install Drivers (if necessary): Ensure that the CP210x or CH340 USB-to-serial driver is
installed on your computer.

2. Connect ESP32 to PC: Use a USB cable to connect the ESP32 board to the computer.

3. Open Arduino IDE:

○ Go to Tools → Board → ESP32 Dev Module.

○ Select the correct Port under Tools → Port.

4. Upload the Code: Click the Upload button to flash the code to the ESP32.

5. Open Serial Monitor:

○ Go to Tools → Serial Monitor.

○ Set the baud rate to 115200.

6. Test Serial Communication:

○ Type a message in the Serial Monitor input box and press Send.

○ The ESP32 will read and display the received message in the Serial Monitor.

Sample Output (in Serial Monitor):


ESP32 Serial Communication Started!
Received: Hello ESP32
Received: Testing Serial Communication
Result:

Successfully interfaced the ESP32 with a computer via USB for serial communication, enabling
data exchange between the ESP32 and the Serial Monitor in Arduino IDE.

You might also like