Introduction
In this week’s assignment, I learned the basics of networking and communication in embedded systems. I understood how devices such as microcontrollers, sensors, and actuators exchange data using wired and wireless communication methods, including UART, I²C, SPI, Wi-Fi, and Bluetooth. This helped me understand how connected devices communicate, monitor data, and automate tasks in IoT applications.
Group assignment
Task:
Communication B/W two microcontroller boards.
Individual assignment
Task:
Design and connect wired or wireless node(s) with network and local input or output devices.
Networking and communications

Networking and communication enable electronic devices to exchange data and work together. Devices such as computers, microcontrollers, sensors, and PCBs communicate through wired or wireless connections to share information and perform tasks efficiently.
Devices can communicate through wired or wireless methods. Wired communication uses physical connections, such as UART with TX and RX pins, while wireless communication transfers data without cables using technologies like Wi-Fi and Bluetooth.
Networking and communication are essential because they allow devices to exchange data quickly and reliably. They enable real-time monitoring, remote control, and automation, making embedded systems more efficient and intelligent. Learning these concepts helped me understand how connected devices work together in modern IoT applications.
Embedded Networking
Embedded networking is the communication between embedded devices, such as microcontrollers, sensors, and actuators, through wired or wireless networks. It enables devices to exchange data, monitor systems, and control operations in real time. Embedded networking is widely used in IoT, smart homes, industrial automation, and healthcare applications.
Embedded networking uses both wired and wireless communication to connect embedded devices. Wired communication includes protocols such as UART, I²C, and SPI, while wireless communication uses technologies like Wi-Fi and Bluetooth. These communication methods are widely used in IoT, industrial automation, smart homes, and other intelligent systems.
Embedded devices, such as microcontrollers, sensors, and PCB-based systems, communicate by exchanging digital data through communication protocols. These protocols define how information is transmitted, received, and interpreted between devices. By using protocols like UART, I²C, and SPI, different electronic components can share data and work together efficiently, enabling reliable and coordinated operation in embedded systems.
Communication protocols allow embedded devices to exchange data efficiently. UART uses TX and RX pins for serial communication, I²C uses SDA and SCL to connect multiple devices on the same bus, and SPI uses MOSI, MISO, SCLK, and CS for high-speed data transfer. These protocols are commonly used to connect microcontrollers, sensors, displays, and other components in embedded systems.
What is a Communication Protocol?
A communication protocol is a set of rules that defines how data is transmitted and received between electronic devices. It ensures that devices communicate reliably and systematically by specifying the format, timing, and method of data exchange. Different communication protocols are used depending on the application, devices, and communication requirements.
Types of communication:-
- Wired communication
- Wireless communication
Wired communication
Wired communication transfers data through physical cables or wires. It is generally reliable, fast, and less affected by external interference. Common wired communication protocols include UART, I²C, SPI, and One-Wire.
Examples:
- UART
- I²C
- SPI
- One-Wire
Wireless Communication
Wireless communication transfers data without using physical wires. It uses radio waves or electromagnetic signals to exchange information between devices. Wireless communication is widely used in IoT, home automation, and remote monitoring applications.
Examples:
- Wi-Fi
- Bluetooth
- Zigbee
- LoRa
Serial vs Parallel Communication

Serial communication:
Serial Communication sends data one bit at a time using a single communication line, making it simple, cost-effective, and suitable for long-distance communication.
Parallel communication:
Parallel Communication sends multiple bits simultaneously using multiple data lines, providing higher speed but requiring more wires and being suitable for short-distance communication.
Transmission modes:

1.Simple mode:
Data flows in only one direction from the sender to the receiver. Example: TV broadcasting.
2.Full-duplex mode:
Data flows in both directions at the same time. Example: mobile phone communication.
3.Half-duplex mode:
Half-Duplex Communication: Data flows in both directions, but not at the same time. Devices take turns transmitting and receiving data. Example: CB (Citizen Band) radio communication.
Synchronous vs Asynchronous Communication

Synchronous Communication
Synchronous Communication: Data is transmitted with a shared clock signal, ensuring both devices send and receive data in perfect synchronization.
Asynchronous Communication
Asynchronous Communication: Data is transmitted without a shared clock signal, using start and stop bits to synchronize communication.
1. UART

UART (Universal Asynchronous Receiver/Transmitter) is a serial communication protocol used to exchange data between two electronic devices, such as microcontrollers, sensors, computers, and development boards. It transfers data one bit at a time without using a clock signal, making it a simple and widely used communication method in embedded systems.
Key Features
- Uses two communication pins: TX (Transmit) and RX (Receive).
- Supports full-duplex communication, allowing devices to send and receive data simultaneously.
- Simple, reliable, and easy to implement.
Applications
- Communication between microcontrollers.
- Connecting GPS, Bluetooth, Wi-Fi, and GSM modules.
- Debugging using the Serial Monitor in Arduino IDE.
- Data exchange between a microcontroller and a computer.
2. I²C

I²C (Inter-Integrated Circuit) is a serial communication protocol used to connect a microcontroller with multiple devices such as sensors, and other integrated circuits. It uses only two wires: SDA (Serial Data) for data transfer and SCL (Serial Clock) for synchronization. I²C supports multiple devices on the same communication bus using a master-slave architecture, making it simple and efficient for embedded systems.
Key Features
- Uses only 2 wires: SDA and SCL
- Supports multiple devices
- Uses master-slave communication
- Commonly used in embedded and IoT systems
Applications
- OLED and LCD displays
- Temperature and humidity sensors
- Real-Time Clock (RTC) modules
SDA: SDA (Serial Data Line) is the data line used in the I²C (Inter-Integrated Circuit) communication protocol. It carries the data exchanged between the master device (such as a microcontroller) and one or more slave devices (such as sensors, displays, or memory chips). SDA works together with the SCL (Serial Clock Line) to enable reliable communication over the I²C bus.
SCL: SCL (Serial Clock Line) is the clock line used in the I²C (Inter-Integrated Circuit) communication protocol. It provides the clock signal that synchronizes data transfer between the master device and one or more slave devices. The master generates the clock pulses, while the SDA (Serial Data Line) transfers the actual data.
3. SPI

SPI (Serial Peripheral Interface) is a high-speed serial communication protocol used to transfer data between a microcontroller (master) and one or more peripheral devices (slaves), such as sensors, displays, memory chips, and SD cards. It uses four communication lines: MOSI (Master Out Slave In), MISO (Master In Slave Out), SCLK (Serial Clock), and SS/CS (Slave Select/Chip Select). SPI provides fast and reliable communication, making it ideal for embedded systems that require high-speed data transfer.
Key Features
- Uses 4 communication lines: MOSI, MISO, SCLK, and SS/CS.
- Supports high-speed, full-duplex communication.
- Uses a master-slave architecture.
- Faster than UART and I²C.
Applications
- SD card modules
- Flash memory
- Sensors and embedded systems
MISO: MISO (Master In Slave Out) is a data line used in the SPI (Serial Peripheral Interface) communication protocol. It carries data from the slave device back to the master device. MISO is one of the four main communication lines in SPI and enables the master to receive data from connected peripherals.
MOSI: MOSI (Master Out Slave In) is a data line used in the SPI (Serial Peripheral Interface) communication protocol. It carries data from the master device (such as a microcontroller) to the slave device (such as a sensor, display, or memory chip). MOSI is one of the four main SPI communication lines.
SCLK: SCLK (Serial Clock) is the clock line used in the SPI (Serial Peripheral Interface) communication protocol. It provides the clock signal that synchronizes data transfer between the master and slave devices. The master device generates the clock pulses, ensuring that data is transmitted and received at the correct time.
CS/SS: CS/SS (Chip Select/Slave Select) is a control line used in the SPI (Serial Peripheral Interface) communication protocol. It is used by the master device to select a specific slave device for communication. When the CS/SS pin is set LOW, the selected slave becomes active and communicates with the master. When it is HIGH, the slave remains inactive.
Comparison of UART, I²C and SPI
| Feature | UART | I²C | SPI |
|---|---|---|---|
| Full Form | Universal Asynchronous Receiver/Transmitter | Inter-Integrated Circuit | Serial Peripheral Interface |
| Communication Type | Asynchronous | Synchronous | Synchronous |
| Clock Signal | No external clock | Uses SCL (Clock) | Uses SCLK (Clock) |
| Number of Wires | 2 (TX, RX) | 2 (SDA, SCL) | 4 (MOSI, MISO, SCLK, CS/SS) |
| Master/Slave | No master/slave concept | Supports Master-Slave | Supports Master-Slave |
| Number of Devices | Point-to-point (2 devices) | Multiple devices on same bus | Multiple devices using separate CS pins |
| Data Speed | Up to a few Mbps | Standard: 100 kbps, Fast: 400 kbps, High-Speed: 3.4 Mbps | Can exceed 10 Mbps (depends on hardware) |
| Duplex Mode | Full Duplex | Half Duplex | Full Duplex |
| Addressing | No addressing | Uses 7-bit or 10-bit addresses | No addressing; uses Chip Select (CS) |
| Complexity | Simple | Moderate | Moderate |
| Hardware Cost | Low | Low | Higher (more wires) |
| Best For | PC communication, Bluetooth, GPS, GSM | Sensors, EEPROM, RTC, OLED displays | SD cards, TFT displays, ADC/DAC, high-speed sensors |
Summary
UART: Simple communication between two devices
I²C: Connecting multiple low-speed peripherals with only two wires
SPI: High-speed communication where performance is important
Group Assignment
As part of this week’s group assignment, we explored communication between two microcontroller boards using both wired and wireless methods. For wireless communication, we used two ESP32 boards connected through Wi-Fi to exchange data without physical cables. For wired communication, we used two Seeed XIAO ESP32-C3 boards and established communication using serial protocols. Through this activity, we learned how different communication methods enable reliable data exchange between embedded devices and gained practical experience in networking concepts used in IoT and automation systems.


Communication protocol
Wireless Communication between two boards of ESP32
we established wireless communication between two ESP32 development boards using their built-in Wi-Fi capability. Both boards were connected to the same Wi-Fi network, and communication was performed using their IP addresses. One ESP32 acted as the sender, while the other acted as the receiver to exchange data over the network. It also helped us understand the basics of IoT communication using TCP/IP over Wi-Fi.


I used below codes for communication
Sender code
#include <WiFi.h>
const char* ssid = "YOUR_HOTSPOT_NAME";
const char* password = "YOUR_PASSWORD";
const char* serverIP = "192.168.43.100"; // Change to Receiver ESP32 IP
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nConnected");
}
void loop() {
WiFiClient client;
if (client.connect(serverIP, 80)) {
client.println("Hello from ESP32");
client.stop();
}
delay(2000);
}
Receiver code
#include <WiFi.h>
const char* ssid = "YOUR_HOTSPOT_NAME";
const char* password = "YOUR_PASSWORD";
WiFiServer server(80);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nConnected");
Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
String msg = client.readStringUntil('\n');
Serial.print("Received: ");
Serial.println(msg);
}
}
client.stop();
}
}
After entering the same Wi-Fi SSID and password on both ESP32 boards, they successfully connected to the network and established wireless communication using their IP addresses.


Experience
We learned how to connect ESP32 boards to a Wi-Fi network and identify their IP addresses for communication. I understood how data can be transmitted wirelessly between two microcontrollers using the TCP/IP protocol.
We also tried wired communication of XIAO ESP32-C3 two boards
We explored wired communication between two XIAO ESP32-C3 development boards using serial communication. The TX (transmit) pin of the first board was connected to the RX (receive) pin of the second board, and the RX pin of the first board was connected to the TX pin of the second board, allowing two-way communication. After uploading the transmitter and receiver programs, both boards successfully exchanged data through the serial monitor.


I used below codes for communication
Board 1
#include <HardwareSerial.h>
HardwareSerial mySerial(1);
void setup() {
Serial.begin(115200);
mySerial.begin(9600, SERIAL_8N1, 20, 21); // RX, TX
Serial.println("Type a message and press Enter:");
}
void loop() {
// Send message typed in Serial Monitor
if (Serial.available()) {
String msg = Serial.readStringUntil('\n');
msg.trim();
mySerial.println(msg);
Serial.print("You: ");
Serial.println(msg);
}
// Receive reply
if (mySerial.available()) {
String reply = mySerial.readStringUntil('\n');
reply.trim();
Serial.print("Board2: ");
Serial.println(reply);
}
}
Board 2
#include <HardwareSerial.h>
HardwareSerial mySerial(1);
void setup() {
Serial.begin(115200);
mySerial.begin(9600, SERIAL_8N1, 20, 21); // RX, TX
Serial.println("Ready");
}
void loop() {
// Receive message
if (mySerial.available()) {
String msg = mySerial.readStringUntil('\n');
msg.trim();
Serial.print("Board1: ");
Serial.println(msg);
}
// Send reply typed in Serial Monitor
if (Serial.available()) {
String reply = Serial.readStringUntil('\n');
reply.trim();
mySerial.println(reply);
Serial.print("You: ");
Serial.println(reply);
}
}

Experience
Through this we learned how to connect two XIAO ESP32-C3 boards using TX and RX pins for serial communication. I understood the importance of crossing the TX and RX connections and using a common ground for successful data transfer.
Individual Assignment
In this individual assignment, I explored wireless control and IoT-based monitoring using different embedded platforms. I first created a mobile application using MIT App Inventor to control an LED connected to an ESP32 over Wi-Fi. Next, I interfaced a DHT22 temperature and humidity sensor with the ESP32 and uploaded the sensor data to ThingSpeak for real-time cloud monitoring and chart visualization. Finally, I implemented LED ON/OFF control using an Arduino and an HC-06 Bluetooth module, wireless control through Bluetooth.
Control LED using bluetooth
In this individual assignment, I developed a Bluetooth-based LED control system using an Arduino and an HC-06 Bluetooth module. I created a mobile application to send ON and OFF commands, allowing wireless control of the LED.
Bluetooth-based LED control system using an Arduino Uno and an HC-06 Bluetooth module. The HC-06 module was connected to the Arduino through serial communication, allowing it to receive commands from a mobile phone. I used a Bluetooth terminal/mobile application to send ON and OFF commands, which controlled the LED connected to the Arduino. When the ON command was sent, the Arduino turned the LED on, and when the OFF command was received, it switched the LED off. This project demonstrated a simple and effective method of wireless communication between a smartphone and a microcontroller using Bluetooth.


Code I used as follows:
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); // RX, TX
const int ledPin = 13;
char command;
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.begin(9600);
BT.begin(9600);
Serial.println("Bluetooth LED Control Ready");
}
void loop() {
if (BT.available()) {
command = BT.read();
Serial.print("Received: ");
Serial.println(command);
if (command == '1') {
digitalWrite(ledPin, HIGH);
BT.println("LED ON");
}
if (command == '0') {
digitalWrite(ledPin, LOW);
BT.println("LED OFF");
}
}
}
Experience
This helped me understand how the HC-06 Bluetooth module communicates with an Arduino through serial communication. I learned how to pair a mobile phone with the module and control an LED wirelessly using a custom mobile application. It improved my knowledge of Bluetooth-based embedded system applications.
Monitoring DHT22 Data on ThingSpeak
In my individual assignment, I used a DHT22 temperature and humidity sensor with an ESP32 to monitor environmental data on the ThingSpeak IoT platform. The DHT22 sensor was connected to the ESP32 to measure temperature and humidity. The ESP32 collected the sensor readings and transmitted the data to ThingSpeak through Wi-Fi. The temperature and humidity values were displayed on the ThingSpeak dashboard using graphs. This activity helped me understand sensor interfacing, ESP32 Wi-Fi communication, cloud-based data monitoring, and IoT data visualization.
About Thingspeak
ThingSpeak is an IoT cloud platform that stores and displays sensor data from devices such as the ESP32. In my project, I used ThingSpeak for cloud-based communication between my boards and the internet. The ESP32 uploaded sensor data to a ThingSpeak channel over Wi-Fi. The platform displayed the data as real-time graphs for easy monitoring. This helped me access and analyze the sensor readings remotely.
The process I followed:
First, I searched for ThingSpeak on the internet and opened the platform.

Then, I clicked “Get Started for Free” to create a free ThingSpeak account.

Next, I signed in and created a ThingSpeak account using my email ID and password to securely store and manage my IoT project data.



Click on new channel and create a channel

After this I saved the channel.

Then I went to the API Keys section and copied the Write API Key.

We use the ThingSpeak API key and Wi-Fi SSID/password in the code to securely connect the ESP32-C3 to the internet and send sensor data to ThingSpeak.

You also need the Channel ID to identify the specific ThingSpeak channel where the data is stored.
Code I used:-
#include <WiFi.h>
#include <DHT.h>
#include <ThingSpeak.h>
// ===== Wi-Fi Details =====
const char* ssid = "Pandu";
const char* password = "pranaygoud1115";
// ===== ThingSpeak Details =====
unsigned long channelID = YOUR_CHANNEL_ID;
const char* apiKey = "YOUR_WRITE_API_KEY";
// ===== DHT22 =====
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
// ===== Wi-Fi =====
WiFiClient client;
void setup() {
Serial.begin(115200);
dht.begin();
// Connect to Wi-Fi
WiFi.begin(ssid, password);
Serial.print("Connecting to Wi-Fi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("Wi-Fi Connected!");
Serial.print("ESP32 IP Address: ");
Serial.println(WiFi.localIP());
// Start ThingSpeak
ThingSpeak.begin(client);
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
// Check sensor readings
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Failed to read from DHT22 sensor!");
delay(2000);
return;
}
// Display readings
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
// Send data to ThingSpeak
ThingSpeak.setField(1, temperature);
ThingSpeak.setField(2, humidity);
int response = ThingSpeak.writeFields(channelID, apiKey);
if (response == 200) {
Serial.println("Data sent successfully to ThingSpeak!");
} else {
Serial.print("Error sending data. Code: ");
Serial.println(response);
}
Serial.println("----------------------");
// ThingSpeak requires at least 15 seconds between updates
delay(20000);
}



Experience
In this activity, I learned how to connect a DHT22 sensor with an ESP32 to measure temperature and humidity. I programmed the ESP32 to connect to Wi-Fi and send the sensor readings to the ThingSpeak cloud platform. I used the Channel ID and Write API Key to upload the data securely. I also learned how to view and monitor the collected temperature and humidity values through graphs. This activity gave me practical experience in sensor interfacing, IoT, wireless communication, cloud monitoring, and data visualization.
Week Summary
In Week 5, I learned about Networking and Communication and gained practical experience with different communication methods. I worked on wired communication between two XIAO ESP32-C3 boards using UART, as well as wireless communication using Bluetooth and Wi-Fi. I also created a mobile application using MIT App Inventor to control an LED connected to an ESP32. In another assignment, I used a DHT22 sensor with an ESP32 to measure temperature and humidity and send the data to ThingSpeak for online monitoring. These activities helped me understand how microcontrollers communicate with each other, how mobile applications can control electronic devices, and how sensor data can be monitored through IoT cloud platforms. Overall, Week 5 improved my practical knowledge of UART, Bluetooth, Wi-Fi, IoT, MIT App Inventor, and ThingSpeak, while also strengthening my programming, communication, and troubleshooting skills.