Networking and communications
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
This project is part of our networking and communication assignment. It demonstrates how multiple microcontrollers can share data using serial communication while also providing user feedback from the Serial
and visual output. The network is built on wired serial communication.
The connecting wire are Switched on the breadboard to allow multiple devices to connect on the network.
Each component was tested separately before integrating into the final sketch. The code performs the following tasks:
- Reads the commands from other micro-controller serial
- Displays message on I2C LCD if it is a display command
- Listens for RGB command from other micro-controller
- Updates NeoPixel color based on received command
Each board is given a unique ID (int id = 2;
). to ensure only the intended recipient processes a message.
Messages follow the format COMMAND:R,G,B@ID
(e.g., COLOR:255,0,0@2
).
If the incoming ID matches the board’s ID, it processes the message based on the command to perform (COLOR to sets the NeoPixel color accordingly, DISPLAY to show message on LCD).
- OLED compatibility issues – 1. OLED display not working – Switched to a 1602 I2C LCD after discovering OLED library compatibility issues with the XIAO RP2040.
- Serial1 miswiring – corrected TX/RX pins
- Sensor noise – added delays to stabilize readings and manually calibrated thresholds for rain detection.
- I2C not displaying – Ensured correct wiring (TX/RX), used Serial1.begin(115200); and tested with basic echo script (
Hello world
)
downloaded from Randomnerdtutorials - Test display script
/********* Test display script *********/ #include
// set the LCD number of columns and rows int lcdColumns = 16; int lcdRows = 2; // set LCD address, number of columns and rows // if you don't know your display address, run an I2C scanner sketch LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows); void setup(){ // initialize LCD lcd.init(); // turn on LCD backlight lcd.backlight(); } void loop(){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("Hello, World!"); delay(1000); // clears the display to print new message lcd.clear(); // set cursor to first column, second row lcd.setCursor(0,1); lcd.print("Hello, World!"); delay(1000); lcd.clear(); }
- LCD (16x2) display
Below are the results from the serial commands.
Before commands

LCD display message

LED display color based on the command.

Serial message

Code file to test
Networking code