ART >Week 11 - Heaven Whitby - Networking and Communications - Fab Academy documentation

Week 11: Networking and Communications

Overview

This week's assignment focused on implementing addressed communication between electronic devices. For my final project, I am developing a handheld journaling console that requires a keyboard for user input and a display for visual feedback.

I selected the M5Stack CardKB2 keyboard and integrated it with my previously designed and fabricated RP2040-based PCB. The keyboard communicates through the Inter-Integrated Circuit (I2C) protocol and operates as an independently addressed peripheral with its own microcontroller.

This assignment builds upon the embedded programming, electronics production, input devices, and output devices assignments. My objective was to establish communication between the keyboard and my custom PCB while maintaining the functionality of the existing sensors, display, and haptic feedback system.

I used my existing test bench to develop and troubleshoot the communication system before incorporating it into the final console PCB. This allowed me to evaluate both the hardware connections and programming requirements before committing to the final design.

Assignment Requirements

Learning Outcomes

Assessment requirements are available on the Fab Academy Networking and Communications assessment page.

Group Assignment

The group assignment required transmitting a message between two projects. As a remote Fab Academy student, my approach was to explore communication between devices within my own development environment.

The communication system developed this week consists of my custom RP2040-based PCB and the M5Stack CardKB2 keyboard. Each device contains its own microcontroller, with communication established through the I2C bus.

According to the Fab Academy assessment guidelines, communication between custom and commercial boards is permitted, provided that programming is implemented to send or receive a message.

Message Exchange Between Devices

The communication system uses the CardKB2 keyboard as the source of character data and my custom RP2040 PCB as the receiving device. The RP2040 acts as the I2C controller and requests data from the keyboard using its assigned bus address of 0x5F.

Communication Element Description
Sending Device M5Stack CardKB2 Keyboard
Receiving Device Custom RP2040 PCB
Protocol I2C
Peripheral Address 0x5F
Message Character data generated by keyboard input
Verification Method Serial Monitor and TFT display

The program requests one byte from the keyboard at a time. When a character is available, the program reads the returned byte and processes it as keyboard input. The received character can then be reported through the Serial Monitor and rendered on the TFT display.

Group Assignment Reflection

This assignment helped me understand the distinction between directly reading an electrical signal from an input device and receiving information from another microcontroller through a communication protocol.

Unlike the analog sensors used in previous assignments, the keyboard processes its own input and makes character data available through an assigned bus address. My RP2040 must initiate communication with that address to retrieve the information.

This approach demonstrates how independently controlled devices can be integrated into a larger electronic system without requiring a dedicated GPIO connection for every individual input. This is particularly valuable for my final project because of the limited number of available pins and the physical space constraints of my PCB.

Individual Assignment

Understanding the I2C Communication Protocol

Inter-Integrated Circuit (I2C) is a synchronous serial communication protocol that allows multiple addressed devices to communicate using a shared two-wire bus. In my configuration, the RP2040 operates as the controller and the CardKB2 keyboard operates as a peripheral.

The two communication signals are:

The devices also require a common ground reference. Pull-up resistors maintain the communication lines at a logic-high state when the bus is idle.

My RP2040 requests one byte of data from the keyboard at its assigned address. When a standard character is available, the returned byte represents its ASCII value. The program ignores a returned value of zero, which indicates that no new keyboard input is available.

Why inter integrated circuits for this week?

I selected I2C because it supports addressed communication while requiring only two communication pins. This was particularly important because my existing PCB already had limited available GPIO pins and physical space.

The CardKB2 supports I2C communication, allowing me to integrate the keyboard without developing custom keyboard firmware.

Protocol Characteristics Suitability for My Project
I2C Two shared communication lines with device addressing Selected because of limited GPIO availability and keyboard compatibility
UART Typically point-to-point serial communication Supported by the keyboard but lacks native bus addressing
SPI High-speed synchronous communication with device selection Already used by my TFT display but typically requires additional connections
Wireless Communication without physical signal wires Introduces additional configuration and complexity

I2C provided a practical balance between hardware simplicity, addressed communication, and future expandability.

A note about addressing: If a non-zero byte comes backm a key was pressed. This is how the controller selects which node to communicate with. I hope this piece satisfys this week's addressing requirement.

Network Components and Device Roles

Network Node Role Microcontroller I2C Address Local Inputs and Outputs
Node 1: Custom PCB I2C Controller Seeed Studio XIAO RP2040 Initiates addressed transactions TFT display, UV sensor, Velostat button, vibration motor
Node 2: M5Stack CardKB2 I2C Peripheral ESP32-C61HF4 0x5F (7-bit address) Keyboard input and RGB status LED

Both nodes contain independent microcontrollers. The keyboard processes local keypresses while the RP2040 requests and processes the resulting character data.

Manufacturer reference: M5Stack CardKB2 Technical Documentation.

Network Addressing

The CardKB2 keyboard uses the 7-bit hexadecimal I2C address 0x5F, which is equivalent to 95 in decimal notation.

The address identifies the peripheral that the controller intends to communicate with. My program defines this address as KB_ADDR and uses it when initiating communication.

#define KB_ADDR 0x5F

Wire.requestFrom(KB_ADDR, 1);

This instruction requests one byte from the peripheral at address 0x5F. Other peripherals with different addresses would not respond to this transaction.

A returned nonzero byte indicates that keyboard data is available. However, the address used in the request, rather than the returned character value, is what establishes addressed communication.

The program also performs an acknowledgment check during initialization to determine whether a peripheral responds at the expected address.

Network Architecture

       NODE 1: CUSTOM PCB
       Seeed XIAO RP2040
         I2C Controller
               |
       +-------+-------+
       |               |
     D4/SDA          D5/SCL
       |               |
       +-------+-------+
               |
        Shared I2C Bus
               |
       NODE 2: CardKB2
         ESP32-C61HF4
         Address: 0x5F
               |
        Keyboard Input

The controller initiates a read request using the keyboard's assigned address. The keyboard returns character data through the SDA line, synchronized by the SCL signal. Both devices share a common ground.

Integration with Previous Assignments

Instead of fabricating another PCB specifically for this assignment, I expanded the functionality of my existing custom RP2040 test bench.

This communication network builds upon the following previous assignments:

For Week 11, I expanded the existing system by connecting an independently addressed keyboard. This allowed me to develop the communication functionality needed for my final handheld journaling console while preserving the previous input and output functions.

Wiring

Bill of Materials

This week's hardware modifications focused on integrating the keyboard into my existing custom PCB. The input and output devices from previous assignments remained part of the system.

Component Specification Purpose
M5Stack CardKB2 42-key keyboard with ESP32-C61HF4 Addressed keyboard input
Custom PCB Seeed Studio XIAO RP2040 I2C controller and system integration
Grove Connector 4-pin HY2.0 connector Keyboard power and communication connections
Connecting Wires Four conductors Power, ground, SDA, and SCL connections

I reused the PCB fabricated during Week 08, along with the input and output devices integrated during Weeks 09 and 10.

Power Supply and Logic Voltage Considerations

The M5Stack CardKB2 manufacturer specifies a 5V DC power supply. However, the XIAO RP2040 operates with 3.3V GPIO logic. The peripheral supply voltage and communication signal voltage must therefore be considered separately.

During this iteration of my test bench, I connected the keyboard's power conductor to the 3.3V supply on my existing PCB. This differs from the manufacturer's specified supply voltage and requires further verification before integration into the final console.

The SDA and SCL communication lines must remain compatible with the RP2040's 3.3V GPIO logic. Applying 5V directly to these GPIO pins could damage the microcontroller.

For the final PCB iteration, the keyboard power supply and I2C signal voltage compatibility will need to be verified independently.

Technical references:

Connections

Wiring Connections and GPIO Assignments

The keyboard requires four connections to establish power and I2C communication. I used the D4 and D5 pins that I had reserved during the previous stages of PCB development.

CardKB2 Connection Signal XIAO RP2040 Pin Function
GND Ground GND Common electrical reference
5V Power Supply 3V3 (test configuration) Keyboard power; differs from rated supply
G26 SDA D4 / GPIO6 Serial data communication
G25 SCL D5 / GPIO7 Serial clock synchronization

Using D4 and D5 allowed me to add the I2C communication interface without reassigning the GPIO pins already occupied by the sensors, TFT display, and vibration motor.

I2C Pull-Up Resistor Considerations

I2C uses open-drain communication lines. Pull-up resistors are required to establish the logic-high state of the SDA and SCL signals when neither device is actively pulling the line low.

The pull-up resistance affects the rise time of the communication signals and therefore the reliability of data transmission.

No additional external pull-up resistors were documented during this iteration of my test bench. The effective pull-up configuration and idle bus voltage require verification before the final PCB is fabricated.

For the final design, I will also need to ensure that the communication lines do not exceed the GPIO voltage limits of the XIAO RP2040.

Hardware Assembly and Bring-Up Method

Because my existing PCB was already populated with components, I needed to integrate the additional keyboard connections carefully to avoid damaging nearby solder joints and traces.

I reused the temporary wire positioning method developed during previous assignments. Tape helped secure the wires during positioning and preparation before permanent soldering.

  1. Identified the available power, ground, SDA, and SCL connections.
  2. Positioned and temporarily secured the four keyboard wires.
  3. Used a multimeter in continuity mode to verify each connection against its intended PCB pad.
  4. Checked adjacent connections for unintended electrical bridges.
  5. Inspected the exposed keyboard conductors to ensure that they were isolated from one another.
  6. Soldered the wires to the corresponding PCB connections.
  7. Connected the keyboard and began functional testing of the integrated system.

The continuity checks helped verify the intended electrical paths before power was applied. However, the limited space between existing components made soldering challenging. Additional connection problems discovered during initial power-up are documented in the troubleshooting section below.

Hardware Assembly & Bring Up Method

I relied on my tape method again mentioned in previous weeks to make sure I can reuse my main components witout accidently damaging them. Once all four wires were positioned I ran a continuity check with my multimeter: each wire rang through to its intended pad, and I confirmed no adjacent wires were bridged to each other. Only after that check passed did I solder. I also verified that the keyboard's wires were fully isolated on the keyboard side before connecting

Because my existing PCB was already populated with components, I needed to integrate the additional keyboard connections carefully to avoid damaging nearby solder joints and traces.

I reused the temporary wire positioning method developed during previous assignments. Tape helped secure the wires during positioning and preparation before permanent soldering.

  1. Identified the available power, ground, SDA, and SCL connections.
  2. Positioned and temporarily secured the four keyboard wires.
  3. Used a multimeter in continuity mode to verify each connection against its intended PCB pad.
  4. Checked adjacent connections for unintended electrical bridges.
  5. Inspected the exposed keyboard conductors to ensure that they were isolated from one another.
  6. Soldered the wires to the corresponding PCB connections.
  7. Connected the keyboard and began functional testing of the integrated system.

The continuity checks helped verify the intended electrical paths before power was applied. However, the limited space between existing components made soldering challenging. Additional connection problems discovered during initial power-up are documented in the troubleshooting section below.

Wires wrapped and tested before plugging in
Keyboard conductors temporarily secured and prepared for continuity testing.
Everything connected, Screen showing correctly
Integrated RP2040 test bench with the CardKB2 keyboard connected and TFT display operating.

Programming Environment & Toolchain

I continued using the Arduino IDE and the Earle Philhower RP2040 board package established during previous assignments. This allowed me to expand my existing program without changing development environments.

Setting Configuration
Development Environment Arduino IDE
Board Package Earle Philhower Arduino-Pico Core
Selected Board Seeed Studio XIAO RP2040
Communication Port COM6
Serial Baud Rate 115200
Programming Language Arduino C/C++

Libraries Used

The Wire library is included with the RP2040 board package, so no additional third-party library installation was required for the keyboard integration.

Programming the Communication Network

I expanded my Week 10 program by adding I2C initialization, peripheral address verification, keyboard polling, and character processing. The existing input and output device functions were retained.

I2C Address and Pin Definitions

#define KB_ADDR 0x5F
#define SDA_PIN D4
#define SCL_PIN D5

These definitions establish the keyboard's peripheral address and the physical GPIO pins used for communication.

Initializing the I2C Bus

Wire.setSDA(SDA_PIN);
Wire.setSCL(SCL_PIN);
Wire.begin();

Within the setup() function, I assign D4 (GPIO6) as the serial data pin and D5 (GPIO7) as the serial clock pin before initializing the I2C controller.

The RP2040 Arduino core allows these pins to be configured before calling Wire.begin(). Once initialized, the controller can initiate communication with addressed peripherals connected to the bus.

Verifying the Peripheral Address

Before attempting to receive keyboard input, I programmed the RP2040 to check whether a peripheral responds at the expected I2C address.

Wire.beginTransmission(KB_ADDR);
byte err = Wire.endTransmission();

if (err == 0) {
    Serial.println("CardKB2 found at 0x5F");
} else {
    Serial.print("CardKB2 not found at 0x5F - error: ");
    Serial.println(err);
}

The beginTransmission() function selects the peripheral address, while endTransmission() performs the transaction and returns its status.

A return value of zero indicates that the transaction completed successfully. A nonzero value indicates a communication error that requires investigation.

This diagnostic check allows me to distinguish between a peripheral communication problem and a problem with keyboard input processing later in the program.

The acknowledgment check demonstrates that the controller specifically addresses the expected peripheral rather than simply reading an unaddressed GPIO signal.

Requesting and Receiving Keyboard Data

Unlike the initialization process, which occurs once during setup(), keyboard polling occurs repeatedly within the main loop() function.

Wire.requestFrom(KB_ADDR, 1);

if (Wire.available()) {
    char key = Wire.read();

    if (key != 0) {
        // Process received keyboard input
    }
}

The requestFrom() function initiates a read transaction with the peripheral at address 0x5F and requests one byte of data.

The available() function checks whether data has been received. If a byte is available, the read() function retrieves it for processing.

A returned value of zero indicates that no new keyboard input is available. Nonzero values are evaluated by the program as character or control-key input.

By polling the keyboard repeatedly, the controller can retrieve user input while continuing to perform the other functions required by the console.

Character Processing and Response Handling

To store keyboard input temporarily, I added a String variable called userInput. I also defined a maximum response length to limit the amount of text accumulated during each journaling prompt.

String userInput = "";
const int MAX_CHARS = 120;

The program evaluates incoming keyboard data to determine whether it represents a printable character or a control command.

Received Input Program Behavior
0x00 Ignored because no new keyboard input is available.
Printable Character Added to the current response when space remains available.
0x08 (Backspace) Removes the last character from the current response when applicable.
Maximum Response Length Limits the response to 120 characters.

The accumulated response is rendered in the response area of the TFT display below the current journaling prompt. This creates a connection between the addressed keyboard input and the local visual output device.

At this stage, the response is stored temporarily in memory. Permanent storage and retrieval of journal entries will require additional functionality.

Integration with Existing Input and Output Devices

One of my objectives was to add keyboard communication without removing the functionality developed during previous assignments.

Device Interface Program Function
CardKB2 Keyboard I2C Receives addressed keyboard data.
Velostat Textile Button Analog GPIO Advances the journaling prompt and clears the current response.
GUVA-S12SD UV Sensor Analog GPIO Provides environmental UV readings.
ILI9341 TFT Display SPI Displays prompts, typed responses, and sensor information.
Vibration Motor Digital GPIO through MOSFET Provides timed haptic reminders.

The main program loop repeatedly checks for keyboard input while also handling sensor readings, prompt advancement, display updates, and reminder timing.

This assignment demonstrates the integration of multiple communication interfaces within a single embedded system. I2C is used for the keyboard, SPI is used for the display, and GPIO connections support the remaining input and output devices.

Complete Arduino Program

The following program combines the input and output functionality developed during previous assignments with the addressed I2C communication implemented during Week 11.

The primary additions for this assignment include:

     
      // ─────────────────────────────────────────────────────────────
// Fab Academy Week 11 — Networking & Communications
// Heaven Whitby — handheld journaling console (test bench)
// Board: Seeed Studio XIAO RP2040 (custom milled PCB, Week 8)
//
// NETWORK: I2C bus
//   Node 1 (peripheral): M5Stack CardKB2 at address 0x5F
//   Node 2 (controller): This RP2040 — polls 0x5F each loop for keystrokes
//
// OUTPUT devices (preserved from Week 10):
//   - 2.8" ILI9341 SPI TFT (240x320) — displays prompt + typed response
//   - DC vibration motor via MOSFET on D2 (reminder buzz)
// Inputs preserved from Week 9:
//   - Velostat fabric button on A0/D0  (press = clear response + next prompt)
//   - GUVA-S12SD analog UV sensor on A3 (shown in footer)
//
// NEW this week:
//   - Wire.h I2C init on D4 (SDA) / D5 (SCL)
//   - CardKB2 polled at 0x5F each loop — keystrokes appended to userInput string
//   - Backspace (0x08) removes last character
//   - userInput rendered live in the response area below the prompt
//
// Libraries: Adafruit GFX, Adafruit ILI9341, Wire (built into RP2040 core)
// Toolchain: Arduino IDE + Earle Philhower RP2040 core, board = XIAO RP2040
// ─────────────────────────────────────────────────────────────

#include 
#include 
#include 
#include 

// ── Display pins (hardware SPI on D8 SCK / D10 MOSI / D9 MISO) ──
#define TFT_CS   D1   // GP27
#define TFT_DC   D6   // GP0
#define TFT_RST  D7   // GP1

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

// ── I2C keyboard ──
#define KB_ADDR  0x5F
#define SDA_PIN  D4
#define SCL_PIN  D5

// ── Other I/O ──
const int velostatPin = A0;
const int uvPin       = A3;
const int motorPin    = D2;

// ── Velostat threshold ──
int velostatBaseline = 0;
const float PRESS_FRACTION = 0.5;
int pressThreshold = 200;

// ── Prompts ──
const char* prompts[] = {
  "What pulled your attention today?",
  "Where did you feel most like yourself?",
  "Name one thing you're carrying that isn't yours.",
  "What would this morning's you want to hear right now?"
};
const int promptCount = sizeof(prompts) / sizeof(prompts[0]);
int currentPrompt = 0;

// ── Timing ──
const unsigned long PROMPT_WINDOW_MS = 20000;
unsigned long promptStart = 0;
bool reminded  = false;
bool wasPressed = false;

// ── Typed response ──
String userInput = "";
const int MAX_CHARS = 120;

// ── Screen layout ──
const int RESPONSE_Y = 160;
const int RESPONSE_H = 120;
const int REMINDER_Y = 268;
const int STATUS_Y   = 300;

// ─────────────────────────────────────────────────────────────
void setup() {
  Serial.begin(115200);
  analogReadResolution(12);
  pinMode(motorPin, OUTPUT);
  digitalWrite(motorPin, LOW);

  Wire.setSDA(SDA_PIN);
  Wire.setSCL(SCL_PIN);
  Wire.begin();
  Serial.println("I2C initialised on D4/D5");

  Wire.beginTransmission(KB_ADDR);
  byte err = Wire.endTransmission();
  if (err == 0) {
    Serial.println("CardKB2 found at 0x5F");
  } else {
    Serial.print("CardKB2 not found at 0x5F — error: ");
    Serial.println(err);
  }

  long sum = 0;
  for (int i = 0; i < 32; i++) { sum += analogRead(velostatPin); delay(5); }
  velostatBaseline = sum / 32;
  pressThreshold = (int)(velostatBaseline * PRESS_FRACTION);
  Serial.print("Velostat baseline="); Serial.print(velostatBaseline);
  Serial.print("  press threshold="); Serial.println(pressThreshold);

  tft.begin();
  tft.setRotation(0);
  showPrompt();
  Serial.println("Week 11 ready — I2C keyboard + LCD + velostat + UV + motor");
}

// ─────────────────────────────────────────────────────────────
void loop() {

  // 1. Poll CardKB2
  Wire.requestFrom(KB_ADDR, 1);
  if (Wire.available()) {
    char key = Wire.read();
    if (key != 0) {
      Serial.print("key: ");
      Serial.print((int)key);
      Serial.print(" (");
      Serial.print(key);

    

Network Verification and Testing

Peripheral Address Verification

The first communication test was designed to determine whether the RP2040 could establish communication with the CardKB2 at its assigned I2C address of 0x5F.

During initialization, the program attempts communication with the specified address and reports the transaction status through the Arduino Serial Monitor.

A successful acknowledgment produces the following diagnostic message:

CardKB2 found at 0x5F

This message indicates that a peripheral responded at the specified address. If the transaction fails, the program reports an error code instead.

Successful acknowledgment

Keyboard Data Transmission

After address verification, the next test evaluates whether character data can be transferred from the keyboard to the RP2040.

The program reports both the numerical value of each received byte and its corresponding character through the Serial Monitor. This provides a method of examining communication independently of the TFT display.

Examples of expected character values are shown below.

Keyboard Input Decimal Value Hexadecimal Value
A 65 0x41
B 66 0x42
Space 32 0x20
Backspace 8 0x08

Comparing the received byte with the expected character value provides a method of verifying that the information transmitted by the keyboard is being interpreted correctly by the controller.

Keyboard to Display Integration

The next stage of testing evaluates the complete communication pathway from the keyboard to the TFT display.

  1. A character is entered using the CardKB2 keyboard.
  2. The RP2040 requests data from I2C address 0x5F.
  3. The received byte is interpreted as character data.
  4. The character is appended to the current response string.
  5. The response area of the TFT display is updated through SPI communication.

This sequence connects two communication protocols within the same embedded system. I2C transfers information from the keyboard to the controller, while SPI transfers the processed information from the controller to the display.

The intended result is a handheld journaling interface that allows the user to enter and edit a response to the currently displayed prompt.

Functional Testing Results

Test Expected Result Observed Result
I2C Address Verification Peripheral responds at address 0x5F Pending verification evidence
Keyboard Character Reception Received character appears in Serial Monitor Pending verification evidence
Display Integration Typed response appears on TFT display Pending verification evidence
Backspace Last character is removed from response Pending verification
Display Initialization TFT initializes successfully Successful after ground and reset connections were repaired
UV Sensor Sensor readings remain available Readings reported through Serial Monitor during troubleshooting
Velostat Sensor Pressure readings remain available Readings reported through Serial Monitor during troubleshooting

Testing the existing input and output devices alongside the keyboard helps identify whether the addition of the communication interface has introduced problems elsewhere in the system.

Communication Network Demonstration

The communication demonstration focuses on the transfer of keyboard input from the addressed I2C peripheral to the custom RP2040 PCB and the resulting visual output on the TFT display.

Final Communication Network

The integrated test bench combines my previously fabricated custom RP2040 PCB, the addressed CardKB2 keyboard, TFT display, Velostat textile button, UV sensor, and vibration motor.

This configuration represents the communication and interaction architecture developed for my final handheld journaling console.

Custom PCB acknowledgment CardKB2 Keyboard Working TFT Display

Problems

Problem 1: Blank Display and Continuous Motor Activation

During the initial power-up after integrating the CardKB2 keyboard, the TFT display backlight illuminated, but no graphics or text appeared. The vibration motor also remained continuously activated rather than operating according to the programmed reminder interval.

I disconnected the power supply and visually inspected the PCB. After an initial inspection revealed no obvious problems, I briefly powered the system again and observed the same symptoms.

Because these components had operated during previous assignments, I suspected that the additional soldering required for the keyboard integration had introduced unintended electrical connections or disturbed existing solder joints.

Using a magnifying glass, I performed a more detailed inspection of the densely populated PCB.

Lesson Learned

Adding components to an existing PCB can affect previously functional circuits. Future PCB designs should incorporate sufficient component spacing, accessible solder pads, and dedicated expansion connections.

Problem 2: Solder Bridge Between Display and Motor Circuits

During the magnified inspection, I identified an unintended solder bridge between the TFT chip-select (CS) connection and the resistor associated with the vibration motor control circuit.

This unintended connection could interfere with the independent operation of the display and motor control signals, potentially explaining the continuous motor activation and display malfunction.

Removing the bridge was difficult because of the limited spacing between the traces and the accumulation of flux around the solder joints.

I attempted to remove the excess solder by reheating the affected area. Because I did not have solder wick available, I used a manual solder removal technique and carefully attempted to separate the affected connections.

After addressing the solder bridge, I continued troubleshooting because the display remained blank.

Lesson Learned

Solder bridges create unintended conductive paths between electrical connections. Flux residue is a separate issue and can make visual inspection more difficult.

For future repairs, I would use desoldering braid, appropriate flux, and a PCB-safe cleaning solution rather than relying on improvised mechanical removal techniques that could damage the copper traces.

Problem 3: Disconnected Display Ground

After addressing the solder bridge, the TFT display remained blank. During another magnified inspection, I discovered that the display's ground wire had become disconnected.

Without a reliable common ground between the RP2040 and the display, the SPI communication signals did not have a consistent electrical reference.

I carefully repositioned and resoldered the ground wire to restore the electrical connection.

Although this corrected an identified hardware fault, the display still did not initialize correctly, indicating that another problem remained.

Lesson Learned

A reliable common ground is essential for communication between electronic devices. When troubleshooting communication failures, power and ground connections should be checked before modifying the program or replacing components.

Problem 4: Disconnected Display Reset Pin

After repairing the ground connection, I used the Arduino Serial Monitor to determine whether the microcontroller was still executing the program.

The pressure sensor and UV sensor readings continued to appear in the Serial Monitor. This confirmed that the microcontroller was running the program despite the display malfunction.

Further inspection revealed that the TFT reset (RST) wire had become disconnected, likely while I was repairing the nearby ground connection.

The reset connection is used to establish a known operating state during display initialization. An unreliable reset signal can prevent the display from initializing correctly.

I resoldered the reset wire to D7 (GPIO1). The display immediately resumed operation.

Lesson Learned

The Serial Monitor provided an independent diagnostic method for distinguishing a microcontroller programming problem from a display hardware problem.

This experience reinforced the importance of checking power, ground, reset, and communication connections individually when troubleshooting an embedded system.

Assignment Reflection

This assignment allowed me to expand my existing embedded system into an addressed communication network by integrating the CardKB2 keyboard with my custom RP2040 PCB.

I developed a better understanding of I2C communication, peripheral addressing, acknowledgment testing, and the transfer of character data between independently controlled electronic devices.

I also explored how multiple communication interfaces can operate within the same embedded system. The keyboard uses I2C, the TFT display uses SPI, and the remaining input and output devices communicate through GPIO connections.

The most challenging aspect of this assignment was not developing the communication code but physically integrating another device into an already densely populated PCB.

The solder bridge and disconnected display connections demonstrated the importance of designing for expansion, maintenance, and troubleshooting.

Improvements for My Final Project

This week's communication system establishes the foundation for keyboard-based interaction within my final handheld journaling console.

Original Design and Programming Files

This assignment utilizes the custom PCB designed and fabricated during previous Fab Academy assignments. Rather than fabricating a new board, I expanded the functionality of my existing PCB by implementing addressed I2C communication.

Resource Description Documentation
Electronics Design Original PCB design and schematic development Week 06
Electronics Production PCB fabrication, assembly, and testing Week 08
Input Devices UV sensor and Velostat textile button integration Week 09
Output Devices TFT display and vibration motor integration Week 10

Original Week 11 Source Code

The Week 11 Arduino program is an extension of my previous embedded system program. The primary modifications include I2C initialization, peripheral address verification, keyboard polling, character processing, and rendering typed responses on the TFT display.

The program utilizes the Arduino Wire and SPI libraries, along with the Adafruit GFX and ILI9341 libraries for display functionality.

File Description Download
Week11_Networking.ino Complete Arduino program for the integrated communication network Download Source Code