Skip to content

Week 13: Networking and Communications

This week we focus on networks and communications.

The assignment was:

  • individual assignment: Design, build and connect wired or wireless node(s) with network or bus addresses and a local interface

  • Group assignment: send a message between two projects

Serial communication protocol (UART)

is a communication standard used to transmit data serially, that is, bit by bit, over two communication lines: one for transmitting (TX) and one for receiving (RX). It is very common in microcontrollers to exchange data between two devices.

To carry out serial communication we have to have 2 boards, one of them we go to the quentorres board connection_ESP32 C3

On this board we use the XIAO ESP32 3C

On this board we use the XIAO RP2040

In order to make this serial connection we have to make the connection between RP2040 and ESP32-C3: TX of RP2040 → RX of ESP32-C3 RX of RP2040 → TX of ESP32-C3 GND → GND

Potentiometer: Flame card → 3.3V (Xiao RP2040) Flame card → Analog pin GP26 (Xiao RP2040) Flame card → GND (Xiao RP2040)

We open the Arduino, connect the XIAO RP2040 and write the code where it will continuously read the value of the potentiometer and send it through the UART serial port to the ESP32-C3

Then we open another arduino and look for the XIAO ESP32 C3 and enter the code that will read the values ​​sent from the RP2040 and display them on the serial monitor of the ESP32-C3

We observe that when the potentiometer is connected to the XIAO RP2040 board and we move it, we see that on the serial monitor screen of the

Individual assignment with potentiometer

For individual assignment we use Arduino and our XIAO RP2040 microcontroller, we connect it and then we add the microcontroller in tools

Now we write the code for that we are going to use a potentiometer, our board that we have worked on, microcontroller and cables, the program makes the servomotor move continuously from 0 to 180 degrees and then back to 0 degrees, while printing the positions on the serial monitor during return movement

The cable connection is as follows: - Signal cable (usually yellow or white): Connect to a GPIO pin that supports PWM on the XIAO RP2040. For example, you could use D10. - Power cable (normally red): Connect it to the 3.3V pin of the XIAO RP2040. However, keep in mind that many servo motors require 5V, so you may need an external 5V power supply. - Ground wire (usually black or brown): Connect it to one of the GND pins of the XIAO RP2040.

We load the code and verify that it is compiling in arrow A we press to load the program to the XIAO RP2040 microcontroller. In arrow B we verify that it loads without any error and in arrow C it shows us complete loading

We go to tools and serial plotter to observe when we move the potentiometer

We verify when we move the potentiometer it increases and decreases the intensity

Files 1

Files 2

Files 3


Last update: January 21, 2025