Introduction
During Week 5, I learned about Networking and Communication in embedded systems. I understood how different devices can communicate with each other and exchange data. I learned the basic concepts of wired and wireless communication and why communication is important in IoT projects.I also learned how to use MIT App Inventor. It is a simple platform for creating Android applications using drag-and-drop blocks. I created a basic mobile app and learned how to design the user interface and add different functions. This helped me understand how a mobile app can communicate with embedded devices such as the ESP32.
This week improved my understanding of networking, communication, and mobile app development. It also gave me practical experience in building simple Android applications for IoT projects.
What is Network
A network is a group of two or more connected devices that communicate and share data with each other. These devices can include computers, smartphones, microcontrollers, sensors, and other electronic systems. A network allows devices to exchange information, work together, and perform tasks more efficiently.
Networks can be connected using wired communication (such as Ethernet or USB) or wireless communication (such as Wi-Fi or Bluetooth). In embedded systems and IoT, networks enable devices like the ESP32 to send and receive data, making remote monitoring and control possible.

Embedded Networking
Embedded networking is the process of connecting embedded devices, such as microcontrollers, sensors, and actuators, so they can communicate and share data with each other. These devices can be connected using wired communication (UART, I2C, SPI, Ethernet) or wireless communication (Wi-Fi, Bluetooth, Zigbee, LoRa).
Embedded networking allows devices to work together as a complete system. It is widely used in IoT, smart homes, industrial automation, healthcare, smart agriculture, and remote monitoring applications, where devices exchange data and perform tasks automatically.

Synchronous & Asynchronous Communication

Synchronous Communication
Synchronous communication is a communication method in which the sender and receiver use a common clock signal. The clock keeps both devices synchronized, allowing data to be transmitted accurately and at high speed. Protocols such as SPI and I2C use synchronous communication.
Applications
- Communication between microcontrollers
- Sensor interfacing
- LCD and OLED displays
- SD card communication
- EEPROM and Flash memory
- Industrial automation systems
Advantages
- High-speed data transfer
- More accurate and reliable communication
- No start and stop bits are required
- Suitable for real-time applications
- Efficient for transferring large amounts of data
Disadvantages
- Requires a common clock signal
- Hardware design is more complex
- More wiring is needed than asynchronous communication
- Not suitable for long-distance communication in some applications
Asynchronous Communication
Asynchronous communication is a communication method in which the sender and receiver do not share a common clock signal. Instead, data is sent using start and stop bits to indicate the beginning and end of each data packet. UART is the most common example of asynchronous communication.
Applications
- Serial communication between microcontrollers
- Bluetooth modules (HC-05, HC-06)
- GPS modules
- GSM modules
- Communication between Arduino and a computer
- Serial Monitor and Serial Terminal applications
Advantages
- Simple and easy to implement
- Does not require a common clock signal
- Requires fewer wires
- Low hardware cost
- Suitable for short-distance communication
Disadvantages
- Slower than synchronous communication
- Uses start and stop bits, which increase data overhead
- Less efficient for transferring large amounts of data
- Data errors may occur at high transmission speeds
Diffrence between Synchronous & Asynchronous
| Feature | Synchronous Communication | Asynchronous Communication |
|---|---|---|
| Clock Signal | Uses a common clock signal | Does not use a common clock signal |
| Synchronization | Sender and receiver are synchronized | Sender and receiver are not synchronized |
| Data Transfer | Continuous and faster | Data is sent one byte at a time |
| Speed | High | Moderate |
| Accuracy | More accurate | Less accurate than synchronous |
| Extra Bits | No start or stop bits | Uses start and stop bits |
| Complexity | More complex | Simple and easy to use |
| Hardware Requirement | Requires clock line | No clock line required |
| Examples | SPI, I2C | UART |
| Applications | Sensors, displays, memory modules | Bluetooth modules, GPS modules, Serial communication |
What is IoT (Internet of Things)?
IoT (Internet of Things) is a network of physical devices that are connected to the internet and can collect, send, and receive data. These devices use sensors, microcontrollers, and communication technologies such as Wi-Fi, Bluetooth, or LoRa to communicate with each other.
IoT allows devices to be monitored and controlled remotely through mobile applications or web platforms. It is widely used in smart homes, healthcare, agriculture, industrial automation, smart cities, and environmental monitoring to improve efficiency and automation.

Applications
- Smart home automation
- Healthcare monitoring
- Smart agriculture
- Industrial automation
- Smart cities
- Environmental monitoring
Advantages
- Enables remote monitoring and control
- Saves time and energy
- Improves efficiency and automation
- Provides real-time data
- Reduces manual work
Disadvantages
- Security and privacy risks
- Requires an internet connection
- Higher setup cost
- Depends on network availability
- Device maintenance and updates are required
What is Communication
Communication is the process of exchanging information or data between two or more devices. It allows devices to send and receive messages so they can work together and perform tasks efficiently.
In embedded systems and IoT, communication enables microcontrollers, sensors, and other devices to share data using wired or wireless technologies such as UART, I2C, SPI, Wi-Fi, and Bluetooth. Good communication helps devices respond quickly, make decisions, and work as a complete system.

Types of Communication
- Wired communication
- Wireless commmunication
Wired communication
Wired communication is a method of transferring data between two or more devices using physical cables or wires. The devices are connected through a communication cable, which provides a stable and reliable connection for data transmission.
In embedded systems, wired communication protocols such as UART, I2C, SPI, USB, and Ethernet are commonly used to exchange data between microcontrollers, sensors, displays, and other electronic devices. Wired communication is fast, secure, and less affected by interference, making it suitable for many embedded and industrial applications.

Information about UART, SPI, I2C
1.UART (Universal Asynchronous Receiver-Transmitter)

UART is a wired serial communication protocol used to exchange data between two devices. It uses TX (Transmit) and RX (Receive) pins to send and receive data. UART is simple, reliable, and commonly used for communication between microcontrollers, sensors, GPS modules, and computers.
2. SPI (Serial Peripheral Interface)

SPI is a high-speed wired communication protocol used to transfer data between a microcontroller and peripheral devices. It uses four lines: MOSI, MISO, SCK, and CS. SPI is commonly used to communicate with sensors, displays, SD cards, and memory modules.
3. I2C (Inter-Integrated Circuit)

I2C is a wired communication protocol used to connect multiple devices using only two wires: SDA (Data) and SCL (Clock). It is commonly used to communicate with sensors, displays, RTC modules, and other peripherals in embedded systems.
Wireless Communication
Wireless communication is a method of transferring data between two or more devices without using physical cables or wires. Instead of wires, it uses radio waves or other wireless signals to send and receive information. This makes communication more flexible and allows devices to connect even when they are far apart.
In embedded systems and IoT, wireless communication enables microcontrollers, sensors, smartphones, and other smart devices to exchange data in real time. Common wireless communication technologies include Wi-Fi, Bluetooth, Zigbee, LoRa, and RF (Radio Frequency). These technologies are widely used in smart homes, industrial automation, healthcare systems, remote monitoring, and wireless control applications.

Bluetooth Communication
Bluetooth communication is a wireless technology used to exchange data between two or more devices over a short distance. It operates in the 2.4 GHz frequency band and does not require cables or an internet connection. Bluetooth is commonly used to connect smartphones, microcontrollers, wireless headphones, keyboards, speakers, and IoT devices. It provides a simple, low-power, and reliable way to transfer data between nearby devices.

Wi-Fi Communication
Wi-Fi communication is a wireless technology that allows devices to exchange data over a network using radio waves. It enables devices to connect to the internet or communicate with each other without using physical cables. Wi-Fi provides high-speed data transfer and supports communication over longer distances than Bluetooth.
In embedded systems and IoT, Wi-Fi is commonly used with microcontrollers such as the ESP32 to send and receive data, monitor sensors remotely, and control smart devices through mobile applications or web servers.

Group Assignment
In this group assignment, we established communication between two ESP32 boards using both wired and wireless communication methods. We successfully exchanged data between the boards and observed how they communicated in real time. This activity helped me understand different communication techniques and improved my practical skills in embedded networking.
Wieless Communication between Two ESP32 Boards:
In this group assignment, I first established wireless communication between two ESP32 boards and successfully exchanged data between them. After completing the wireless communication, I implemented wired communication between the same boards. I tested both communication methods and observed how data was transmitted and received in real time.


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();
}
}
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);
}
what i edit in this code to communication between two microcontrollers
Receiver code
const char* ssid = "Your_Hotspot_Name";
const char* password = "Your_Hotspot_Password";
Sender code
const char* ssid = "Your_Hotspot_Name";
const char* password = "Your_Hotspot_Password";
const char* serverIP = "Receiver_IP_Address";
Wired Communication Between Two XIAO ESP32-C3 Boards:
After completing the wireless communication task, I established wired communication between two XIAO ESP32-C3 boards. I connected the boards using communication wires and successfully exchanged data between them. I tested the connection by sending and receiving messages in real time. This activity helped me understand how wired communication works and improved my practical knowledge of data transmission between embedded devices.



Board 1 Code
#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 Code
#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
Working on wired communication between two XIAO ESP32-C3 boards was a valuable learning experience. I learned how to connect the boards correctly, exchange data, and test communication in real time. During the activity, I also practiced troubleshooting connection issues and verifying data transmission. This hands-on assignment improved my understanding of embedded communication and increased my confidence in working with ESP32-based projects.
Indiviual Assignment
Bluetooth LED Control Using HC-06 Module
As an individual assignment, I built a Bluetooth LED control project using the HC-06 Bluetooth module and an Arduino. I connected the HC-06 module to the Arduino and paired it with my mobile phone using a Bluetooth terminal application. By sending commands from the mobile app, I successfully turned the LED ON and OFF wirelessly. This assignment helped me gain practical experience in Bluetooth communication, serial communication, and wireless control of embedded devices.


Pin Connection Diagram
| HC-06 Pin | Arduino Uno Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| TXD | D10 |
| RXD | D11 |
| LED Pin | Arduino Uno Pin |
|---|---|
| Anode (+) | D13 |
| Cathode (-) | GND |
Commands from mobile app:
- Send
1→ LED ON - Send
0→ LED OFF
CODE
#include <SoftwareSerial.h>
SoftwareSerial Bluetooth(10, 11); // RX, TX
#define LED_PIN 13
void setup() {
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
Serial.begin(9600);
Bluetooth.begin(9600);
Serial.println("Bluetooth LED Control Ready");
}
void loop() {
if (Bluetooth.available()) {
char command = Bluetooth.read();
if (command == '1') {
digitalWrite(LED_PIN, HIGH);
Serial.println("LED ON");
}
else if (command == '0') {
digitalWrite(LED_PIN, LOW);
Serial.println("LED OFF");
}
}
}
Experience
This individual assignment gave me practical experience in Bluetooth communication using the HC-06 module. I learned how to connect the module with an Arduino Uno, pair it with a mobile phone, and control an LED wirelessly using the Serial Bluetooth Terminal app. I also improved my understanding of serial communication, circuit connections, and troubleshooting. This project increased my confidence in building simple wireless embedded and IoT applications.
Individual Assignment
LED Control Using MIT App Inventor
After completing the Bluetooth Terminal project, I created a mobile application using MIT App Inventor to control an LED. I designed a simple user interface with ON and OFF buttons and connected the app to the HC-06 Bluetooth module. By pressing the buttons in the app, I was able to turn the LED ON and OFF wirelessly through Bluetooth. This assignment helped me understand mobile app development, Bluetooth communication, and the integration of Android applications with embedded systems.
What is MIT App Inventor?
MIT App Inventor is a free, web-based platform used to create Android applications without writing complex code. It uses a simple drag-and-drop interface and block-based programming, making it easy for beginners to build mobile apps. MIT App Inventor is widely used for learning app development and creating applications that interact with embedded systems and IoT devices such as Arduino and ESP32 through Bluetooth or Wi-Fi.
Steps a follow to create app on MIT app inventor
first searched for MIT App Inventor on Google Chrome and opened the official website

After opening the website, I clicked on the Create Apps button to start developing my application.

clicked on New Project

entered a project name to create a new application

designed the application interface by adding the required buttons, labels, and other components according to the project requirements

After designing the interface, I opened the Blocks section and created the block-based programming

After completing the block programming, I went to the Build menu and clicked on Android App (.apk) to generate the APK file for the application.


After the APK generation process was completed, the application was ready to download and install on my Android device.

scanned the QR code using my mobile phone and downloaded the application
CODE
#include <WiFi.h>
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
WiFiServer server(80);
const int ledPin = 2; // Built-in LED
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
WiFi.begin(ssid, password);
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("ESP32 IP Address: ");
Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (!client) return;
String request = client.readStringUntil('\r');
client.flush();
if (request.indexOf("/ON") != -1) {
digitalWrite(ledPin, HIGH);
}
if (request.indexOf("/OFF") != -1) {
digitalWrite(ledPin, LOW);
}
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
client.println("OK");
client.stop();
}
ESP32 Configuration
To connect the ESP32 with the MIT App Inventor application, the Wi-Fi network name and password were entered in the ESP32 program. The ESP32 was then connected to the same Wi-Fi network as the mobile phone. After successful connection, the ESP32 automatically displayed its IP address in the Serial Monitor. This IP address was used in the MIT App Inventor application to communicate with the ESP32 and control the LED. No IP address was required to be added manually to the ESP32 code.
| Component | ESP32 Pin |
|---|---|
| LED Anode (+) | GPIO 2 |
| LED Cathode (-) | GND |


Experience
This project helped me understand the basic programming and GPIO functionality of the ESP32. I learned how to connect an external LED, upload code using the Arduino IDE, and control the LED by generating HIGH and LOW signals. It also improved my understanding of circuit connections, program execution, and debugging. This hands-on activity increased my confidence in working with ESP32-based embedded projects.
Monitoring DHT22 Data on ThingSpeak
I worked on an individual assignment to monitor temperature and humidity using the DHT22 sensor and ThingSpeak. I connected the DHT22 sensor to the ESP32 and uploaded the sensor data to the ThingSpeak cloud platform using Wi-Fi. The temperature and humidity values were updated in real time and displayed as graphs on the ThingSpeak dashboard. This assignment helped me understand IoT cloud platforms, sensor data collection, Wi-Fi communication, and real-time data monitoring.
What is ThingSpeak?
ThingSpeak is an IoT cloud platform that allows users to collect, store, monitor, and analyze data from sensors and embedded devices over the internet. It receives data from devices such as the ESP32, Arduino, and other IoT boards using Wi-Fi or other communication methods. The collected data is displayed as graphs and charts, making it easy to monitor sensor values in real time. ThingSpeak is widely used for IoT projects, remote monitoring, and data visualization.
Steps i follow to create channel on thinkspeak to monitor data
search thinkspeak on google

open web and login into thinkspeak with get started for free

click on new channel and create a channel

you need API kay for allow your ESP32 to send data to your specific ThingSpeak channel.

you also need channel id to identifies your channel

CODE
#include <WiFi.h>
#include <HTTPClient.h>
#include <DHT.h>
// ------------ DHT22 ------------
#define DHTPIN 2 // DATA pin (गरजेनुसार बदल)
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
// ------------ WiFi -------------
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
// -------- ThingSpeak ----------
String apiKey = "YOUR_WRITE_API_KEY";
void setup() {
Serial.begin(115200);
delay(1000);
dht.begin();
Serial.println("================================");
Serial.println("Connecting to WiFi...");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("\nWiFi Connected!");
Serial.print("IP Address : ");
Serial.println(WiFi.localIP());
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Failed to read DHT22 Sensor!");
delay(2000);
return;
}
Serial.println("--------------------------------");
Serial.print("Temperature : ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity : ");
Serial.print(humidity);
Serial.println(" %");
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
String url = "http://api.thingspeak.com/update?api_key=" + apiKey +
"&field1=" + String(temperature, 2) +
"&field2=" + String(humidity, 2);
Serial.println("Sending Data to ThingSpeak...");
Serial.println(url);
http.begin(url);
int httpResponseCode = http.GET();
if (httpResponseCode > 0) {
Serial.print("HTTP Response Code : ");
Serial.println(httpResponseCode);
if (httpResponseCode == 200) {
Serial.println("Data Sent Successfully to ThingSpeak!");
}
} else {
Serial.print("Error Code : ");
Serial.println(httpResponseCode);
Serial.println("Failed to Send Data!");
}
http.end();
} else {
Serial.println("WiFi Disconnected!");
}
Serial.println("--------------------------------");
// ThingSpeak ला किमान 15 सेकंदांचा Delay आवश्यक आहे
delay(20000);
}



Experience
This assignment gave me practical experience in IoT cloud technology and real-time data monitoring. I learned how to connect the DHT22 sensor to the ESP32, send temperature and humidity data to the ThingSpeak cloud, and monitor the data through live graphs. I also improved my understanding of Wi-Fi communication, cloud integration, sensor interfacing, and troubleshooting. This project increased my confidence in developing real-time IoT monitoring applications.
Week 5 – Overall Experience
During Week 5, I gained valuable hands-on experience in networking, communication, and IoT technologies. I learned the concepts of wired and wireless communication and successfully established communication between two ESP32 boards. I also completed individual assignments, including controlling an LED using the HC-06 Bluetooth module, developing a mobile application with MIT App Inventor, blinking an LED using the ESP32, and monitoring temperature and humidity data from a DHT22 sensor on the ThingSpeak cloud platform.
These activities improved my understanding of Bluetooth, Wi-Fi, serial communication, cloud connectivity, and mobile application development. I also enhanced my practical skills in circuit connections, programming, debugging, and integrating hardware with software. Overall, this week increased my confidence in developing embedded systems and IoT-based applications.