Skip to content

11- Networking and Communications

Assignements

Group assignment:

  • Send a message between two projects
  • Document your work to the group work page and reflect on your individual page what you learned

Individual assignment:

  • Design, build and connect wired or wireless node(s) with network or bus addresses and a local input and/or output devices

Learning outcomes

  • Demonstrate workflows used in network design
  • Implement and interpret networking protocols and/or communication protocols

The road map i made for this week can be accesed here

Group Assignment

You can access our group assignment here

Reflection

Despite the delays, our team finally wrapped up the group assignment. We managed to get a message transmitted between my board and Tsheltrim Lhamo’s Xiao board, which gave us a much clearer idea of how two devices can exchange information. It also became obvious how crucial it is to assign the sender and receiver roles properly so the communication works as intended.

Individual Assignments

What is Networking?

Networking is the practice of connecting devices to allow them to communicate, share data, and resources.

It involves both hardware (routers, switches, cables) and software (protocols like TCP/IP).

This week’s assignment was to design, build, and connect wired or wireless nodes that can communicate using a network or bus protocol. The goal was to understand how microcontrollers send and receive data and how devices can share information through different communication methods.

Networking Basics

Networking in embedded systems refers to connecting two or more devices (nodes) so they can exchange data. Each node can be a microcontroller, sensor, or computer. Communication can be wired, through physical cables, or wireless, using radio waves.

Types of Communication

Type Description Examples
Serial (UART) One-to-one wired communication using TX/RX pins Arduino Serial, USB communication
I²C One master, multiple slaves on two shared lines (SDA, SCL) Sensors, displays
SPI Fast four-wire protocol (MISO, MOSI, SCK, SS) SD cards, displays
Wi-Fi / Bluetooth Wireless protocols for connecting boards or devices to the Internet ESP32 Wi-Fi, Bluetooth modules
ESP-NOW / LoRa Low-power, long-range wireless communication IoT sensor networks

Protocols

A protocol defines the rules for sending and receiving data. Examples:
- UART uses start and stop bits with a defined baud rate.
- I²C uses an addressing system to communicate with specific devices.
- Wi-Fi uses IP addressing to connect devices over a network.


Individual Project

Goal

Demonstrate a simple communication network using serial communication between an Arduino and a laptop.
- Arduino acts as both transmitter and receiver.
- Laptop acts as the second node, sending and receiving data through the Serial Monitor.


Materials Used

Item Purpose
Arduino Uno Microcontroller board
USB cable Power and serial communication
Laptop with Arduino IDE Writing code and monitoring communication

Detailed Steps

Step 1 — Connect the Hardware

  • Connect the Arduino to the laptop using a USB cable.
  • The USB connection provides both power and a serial communication link.

Step 2 — Set Up the Arduino IDE

  • Open Arduino IDE.
  • Select Arduino Uno as the board under Tools → Board.
  • Select the correct COM port under Tools → Port.

Step 3 — Write the Program

The following code allows the Arduino to send messages to the laptop and receive messages typed in the Serial Monitor:

void setup() {
  Serial.begin(9600);              
  Serial.println("Arduino is ready to communicate!");
  Serial.println("Type something below:");
}

void loop() {
  // Receive data from the computer
  if (Serial.available() > 0) {
    String input = Serial.readStringUntil('\n');
    Serial.print("Received: ");
    Serial.println(input);
  }

  // Send a message every 5 seconds
  static unsigned long lastTime = 0;
  if (millis() - lastTime > 5000) {
    lastTime = millis();
    Serial.println("Hello from Arduino");
  }
}

Step 4 — Upload the Code

  • Upload the code to your PCB using your IDE (Arduino IDE, PlatformIO, or equivalent).
  • Wait until the IDE indicates that the upload is complete, usually with a message like “Done uploading” or “Upload successful”.

Step 5 — Open the Serial Monitor

  • Open the Serial Monitor in your IDE.
  • Set the baud rate to 9600 (must match the value in your code).
  • Observe messages sent by your PCB. Example output:

My PCB is ready to communicate! Type something below: Hello from my PCB

  • Type a message into the input bar and press Enter.
  • The Serial Monitor should display something like:

This confirms that the PCB and the laptop are successfully communicating.


Images & Screenshots

Image 1 — Hardware Setup

PCB connected to laptop via USB:
![PCB Hardware Setup](images/pcb_setup.jpg)

Image 2 — Serial Monitor Output

Messages sent and received:
![Serial Monitor Output](images/serial_monitor.jpg)

Optional: GIF or Video

Short video or GIF demonstrating typing messages and PCB responding:
![Serial Communication Demo](images/pcb_demo.gif)

(Replace the file paths with your actual images or video files.)


Reflection

Through this project, I learned how microcontrollers communicate using the UART serial protocol. Even though this setup is simple, it clearly demonstrates how data moves between devices. The USB connection uses TX and RX lines to transmit data, allowing two-way communication.

I also learned the importance of matching baud rates between devices and how a simple protocol like serial communication can form the basis for more complex networks.

In the future, I would like to expand this project by connecting multiple PCBs to communicate with each other, or by experimenting with wireless communication protocols such as Wi-Fi or ESP-NOW. This exercise helped me understand the fundamentals of networking and device communication, which will be useful for more advanced embedded system projects.

Thank youu


Last update: November 22, 2025