Week 11: Embedded Networking and Communications
🔗 Link to Group Assignment
Introduction to Communications
Communication is the foundation for interaction between devices in embedded systems. It allows multiple boards to send and receive data, synchronize actions, and share information. In this context, networking protocols define how this data is transferred and how devices understand one another. Understanding and implementing communication protocols is essential in the field of digital fabrication and robotics.
There are two major types of communications in electronics:
- Parallel Communication: Multiple data bits are sent simultaneously over multiple wires. It is fast but requires more I/O pins and wiring complexity.
- Serial Communication: Data is sent one bit at a time over a single wire. It is slower than parallel communication but more efficient for long distances and limited pin availability.

Within serial communication, there are several protocols:
- UART (Universal Asynchronous Receiver-Transmitter): Uses TX and RX lines for bidirectional communication. It’s simple, requires no clock line, and is common in microcontrollers.
- I2C (Inter-Integrated Circuit): Uses two wires (SDA for data and SCL for clock). Allows multiple devices with unique addresses to communicate on the same bus.
- SPI (Serial Peripheral Interface): A faster protocol using four wires (MISO, MOSI, SCK, and SS). It is commonly used for sensors and displays.
- CAN (Controller Area Network): Used in automotive and industrial environments, allows robust communication between many nodes with fault tolerance.
- Wireless Protocols: Such as Wi-Fi, Bluetooth, LoRa, and Zigbee, used for remote communication without physical connections.
What is UART?
UART (Universal Asynchronous Receiver-Transmitter) is a hardware communication protocol used for asynchronous serial communication. It works by transmitting data serially, bit by bit, using just two wires: TX (transmit) and RX (receive). UART does not require a clock signal; instead, both devices must agree on a baud rate (bits per second) to synchronize data exchange.
It is widely used because of its simplicity, and is especially useful when two devices need to communicate directly, like in this week’s assignment.

Objective of the Week
The objective was to establish communication between two boards using the UART protocol. One board (Xiao RP2040) sends a command via UART when buttons are pressed, and the other board (Xiao ESP32S3) receives the command and controls servomotors accordingly. All programming was done using the Arduino IDE.

Programming Process
Transmitter (Xiao RP2040):
Three buttons were connected to pins D10 (Right), D9 (Left), and D8 (Stop). When pressed, a character is sent via UART: "R" for Right, "L" for Left, and "S" for Stop.
See the Pen Untitled by Paula Rivero (@Paula-Rivero) on CodePen.
Receiver (Xiao ESP32S3):
The ESP32S3 receives the character and moves three servomotors (connected to pins D2, D3, D4) based on the command.
See the Pen Untitled by Paula Rivero (@Paula-Rivero) on CodePen.
Pinout Reference of Boards
To correctly wire the boards, here are the pinout diagrams used:
- Xiao RP2040 Pinout: Used to connect the push buttons to pins D10, D9, and D8.
- Xiao ESP32S3 Pinout: Used to connect RX to GPIO16 and servos to D2, D3, and D4.
- Xiao ESP32S3 Pinout: Used to connect RX to GPIO16 and servos to D2, D3, and D4.
These diagrams were essential for ensuring proper communication and motor control connections.
Addressing and Wiring
TX from the RP2040 is connected to GPIO16 (RX) of the ESP32S3. GND is shared between both boards to ensure a common reference voltage.
Problems and Fixes
- Initially, the servos didn't move: this was due to incorrect wiring and baud mismatch.
- The RX pin on the ESP32S3 was not correctly set: fixed by specifying GPIO16.
- Buttons gave wrong readings: resolved using INPUT_PULLUP and checking for LOW when pressed.