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 |
Network Configuration and Communication Setup¶
In this setup, the network consists of two nodes: - Node 1: Microcontroller board (Arduino Uno or custom PCB) - Node 2: Laptop (via Serial Monitor)
The devices are connected using a USB cable, which provides both power and UART serial communication. The TX and RX lines are used internally through the USB interface.
The communication protocol used is UART (Universal Asynchronous Receiver-Transmitter). Both devices were configured with the same baud rate (9600) to ensure reliable data transmission.
The microcontroller sends periodic messages to the laptop, and the laptop sends user-input messages back to the board. This confirms two-way communication between the devices.
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.
Networking Using My Custom Board¶
In addition to using the Arduino Uno, I tested serial communication using my own custom-built PCB from a previous assignment.
Board Used¶
The board used for this networking test was fabricated during the Embedded Programming / Electronics Design assignment.
Link to my board documentation:
Link to Previous Assignment – Custom Board

Programming Process¶
My custom PCB was programmed using the Arduino IDE by selecting the appropriate microcontroller and board configuration. I used a USB-to-Serial connection to upload the code.
The same serial communication logic used with the Arduino Uno was applied here, with minor adjustments to pin configuration based on my board design. After uploading the program, I verified communication using the Serial Monitor.
Heres a few videos of it working!
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.
Challenges and Solutions¶
One of the main challenges I faced was ensuring that the baud rate in the code matched the baud rate in the Serial Monitor. Initially, mismatched settings caused unreadable output.
Another challenge was identifying the correct COM port when switching between different boards. This was solved by reconnecting the board and checking the port list in the IDE.
While testing with my custom board, I also had to verify pin connections and board selection settings before successful communication was achieved.
References¶
-
Arduino Serial Communication Documentation
https://docs.arduino.cc/learn/communication/serial -
Fab Academy Networking and Communications
https://fabacademy.org -
UART Communication Overview
https://learn.sparkfun.com/tutorials/serial-communication