Assignment Requirements
Group assignment
- Compare as many tool options as possible.
- Document your work on the group work page and reflect on your individual page what you learned.
Individual assignment
- Write an application for the embedded board that you made. that interfaces a user with an input and/or output device(s)
Progress Status
This is for reporting progress (not for visitors to click).
Group page link + notes added.
Missing final photos and conclusions.
Upload .zip with source files.
Assignment Requirements
Learning outcomes
- Implement a User Interface (UI) using programming and explore protocols to communicate with a microcontroller board that you designed and made.
Have you answered these questions?
- Linked to the group assignment page.✅
- Documented your process.✅.
- Explained the UI that you made and how you did it.✅.
- Explained how your application communicates with your embedded microcontroller board.✅.
- Explained any problems you encountered and how you fixed them.✅.
- Included original source code (or a screenshot of the app code if that's not possible).✅.
- Included a ‘hero shot’ of your application running & communicating with your board.✅.
Weekly planning
During the week, we carried out various activities that presented significant challenges but were also very rewarding, especially due to the opportunity to share and learn as a team. We met virtually with our colleagues at the node and participated in lab meetings, which allowed us to organize ourselves and conduct open workshops in different spaces. In these sessions, we reviewed and worked with input devices, understanding their operation and their importance in capturing data from the environment for subsequent processing in electronic systems.
During this week of Interface and Application Programming, our group developed and validated various forms of interaction between hardware and software, focusing on real-time communication and device control.
We conducted serial interface tests using PuTTY, successfully displaying data from the HC-SR04 ultrasonic sensor on the terminal and verifying communication between the microcontroller and the computer.
We also implemented a graphical interface in Processing, enabling us to control the on/off and blinking of an LED using interactive buttons, demonstrating functional integration between visual software and hardware.
Finally, we explored wireless communication using Bluetooth, developing a mobile application in MIT App Inventor that allowed us to control an LED from a smartphone, demonstrating the versatility of interfaces and remote connectivity.
Together, these activities allowed us to understand and apply different interaction methods, strengthening our skills in interface development and the integration of physical and digital systems.
Processing es un entorno de programación flexible que permite desarrollar interfaces visuales interactivas para el control de hardware en tiempo real.
Accede a la página oficial de Processing y descarga la versión compatible con tu sistema operativo (Windows, macOS o Linux).
Extrae el archivo .zip en una carpeta accesible dentro de tu computadora, como el Escritorio o Documentos.
Abre la carpeta extraída y ejecuta el archivo principal (processing.exe en Windows) para iniciar el entorno.
Conecta la placa ESP32-C3 mediante un cable USB y verifica el puerto asignado en tu sistema.
Importa la librería Serial en Processing y selecciona el puerto correcto para establecer la comunicación.
Implementa los botones necesarios para controlar el LED (encendido, apagado y parpadeo).
Presiona el botón “Run” para ejecutar la interfaz gráfica y activar la comunicación en tiempo real.
Verifica que el LED responda correctamente a los comandos enviados desde la interfaz.
Antes de establecer la comunicación con el microcontrolador, se realizó una exploración inicial del entorno de Processing con el objetivo de comprender su estructura, lógica de ejecución y capacidades gráficas.
Se estudió su modelo de programación basado en dos funciones principales: setup() y draw(). La función setup() se ejecuta una sola vez al iniciar el programa y permite configurar el entorno, como el tamaño de la ventana, variables iniciales y parámetros generales. Por otro lado, la función draw() se ejecuta de manera continua en bucle, permitiendo la actualización en tiempo real de los elementos visuales y la creación de interfaces dinámicas.
Además, se exploraron las capacidades de renderizado gráfico de Processing, incluyendo la creación de formas, uso de colores, tipografías y posicionamiento en pantalla, lo cual es fundamental para el diseño de interfaces intuitivas.
También se analizaron los mecanismos de interacción, como la detección de eventos de entrada (mouse y teclado), lo que permitió comprender cómo el usuario puede interactuar con los elementos gráficos y cómo estas acciones pueden traducirse en comandos para el control de hardware.
Esta etapa fue clave para establecer una base sólida en el desarrollo de interfaces, facilitando la posterior integración con el microcontrolador y la implementación de sistemas interactivos en tiempo real.
This project focuses on the development of an interactive monitoring and control system using the XIAO ESP32-C3 microcontroller.
The system integrates multiple sensors and output devices, combined with a graphical interface developed in Processing,
allowing real-time visualization and user interaction.
The main objective was to establish a bidirectional communication system between hardware and software, enabling both
data acquisition and remote control through a custom interface.
The system incorporates several electronic components to perform sensing, visualization, and actuation tasks.
A DHT11 sensor was used to measure environmental temperature and humidity, while a light-dependent resistor (LDR)
was included to detect ambient light levels. Additionally, an OLED display based on the SSD1306 controller was used
to provide local feedback directly on the device.
An RGB LED was integrated as a visual actuator, allowing the system to represent different states through color changes.
All components were connected and controlled by the ESP32-C3, which handled both data processing and communication.
The ESP32-C3 continuously reads sensor data and processes it locally. The values obtained from the DHT11 sensor
are transmitted to Processing through serial communication. To ensure proper parsing and synchronization, the data
is sent in a structured format containing only numerical values separated by a comma.
This format allows Processing to efficiently interpret incoming data and update the graphical interface in real time.
The OLED display provides immediate feedback without requiring a computer interface. It shows temperature and humidity
values, updating continuously as new data is read from the sensors. In addition, the display is capable of presenting
system messages, such as sensor reading errors, ensuring basic diagnostic capability at the hardware level.
A custom graphical interface was developed using Processing to enhance user interaction and data visualization.
This interface displays temperature and humidity values dynamically and includes a visual representation of the
system state through a color indicator.
The interface also incorporates interactive buttons that allow the user to control the behavior of the RGB LED remotely,
demonstrating a real-time connection between the software interface and the physical system.
Three operational modes were implemented to control the RGB LED:
In automatic mode, the LED color changes according to the measured temperature ranges. Lower temperatures activate
a blue color, medium values produce green, and higher temperatures trigger red. This provides an intuitive visual
representation of environmental conditions.
In manual ON mode, the LED remains fully turned on regardless of sensor values, providing a constant visual output.
In OFF mode, the LED is completely turned off, overriding any automatic behavior.
The system demonstrates a complete integration of sensing, visualization, and control. The ESP32-C3 collects data
from the environment, displays it locally on the OLED, and transmits it to Processing. At the same time, Processing
allows the user to send commands back to the microcontroller, enabling real-time control of the RGB LED.
This bidirectional communication establishes a dynamic interaction loop between the user and the physical system,
making the interface both informative and interactive.
This project highlights the potential of combining embedded systems with graphical programming environments to create
responsive and interactive applications. The integration of sensors, displays, and user controls demonstrates how
real-time data can be effectively visualized and manipulated, resulting in a functional and adaptable system.
Working with Processing as part of this project was a highly valuable experience, as it allowed the transition
from a purely hardware-based system to a more interactive and user-centered approach. Initially, the project
focused on reading sensor data and displaying it locally on the OLED screen. However, integrating Processing
introduced a new dimension by enabling real-time visualization and control through a graphical interface.
One of the most interesting aspects was observing how data from the ESP32-C3 could be translated into dynamic
visual elements. The interface not only displayed temperature and humidity values but also represented system
states through color changes and interactive components such as buttons. This made the system more intuitive
and easier to understand, especially when monitoring environmental conditions.
The implementation of control modes, including automatic behavior based on temperature and manual ON/OFF states,
demonstrated the potential of bidirectional communication. Processing was not only receiving data but also sending
commands back to the microcontroller, creating a complete interaction loop between the user and the physical system.
Overall, this experience showed how powerful it is to combine embedded electronics with visual programming tools.
Processing transformed the project from a simple sensor-reading setup into a more engaging and functional system,
where information is not only displayed but also actively controlled. This integration highlights the importance
of interface design in making technological systems more accessible, interactive, and meaningful.
Group Work: Interface and Application Programming
Instalación de software – Processing
Paso 1: Descarga del software
Paso 2: Extracción del archivo
Paso 3: Ejecución de la aplicación
Paso 4: Preparación del hardware
Paso 5: Configuración de la comunicación
Paso 6: Desarrollo de la interfaz
Paso 7: Ejecución del programa
Paso 8: Validación del sistema
Exploración inicial de la interfaz (Processing)
Interactive System with ESP32-C3 and Processing
Components and Hardware Integration
Data Acquisition and Serial Communication
temperature,humidityLocal Visualization with OLED Display
Graphical Interface in Processing
Control Modes
System Integration
Conclusion
Processing Code
import processing.serial.*;
Serial myPort;
float temp = 0;
float hum = 0;
// color del LED
color ledColor;
void setup() {
size(600, 400);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 115200);
myPort.bufferUntil('\n');
}
void draw() {
background(20);
calcularColor();
dibujarUI();
}
// -------- LÓGICA --------
void calcularColor() {
char comando;
if (temp < 20) {
ledColor = color(0, 0, 255);
comando = 'B';
}
else if (temp <= 28) {
ledColor = color(0, 255, 0);
comando = 'G';
}
else {
ledColor = color(255, 0, 0);
comando = 'R';
}
myPort.write(comando);
}
// -------- INTERFAZ --------
void dibujarUI() {
fill(255);
textAlign(CENTER);
textSize(24);
text("CONTROL TEMPERATURA", width/2, 40);
fill(200);
textSize(18);
text("Temp: " + nf(temp,1,1) + " °C", width/2, 100);
text("Hum: " + nf(hum,1,1) + " %", width/2, 130);
fill(ledColor);
ellipse(width/2, 250, 120, 120);
}
// -------- SERIAL --------
void serialEvent(Serial myPort) {
String data = myPort.readStringUntil('\n');
if (data != null) {
data = trim(data);
String[] values = split(data, ',');
if (values.length == 2) {
temp = float(values[0]);
hum = float(values[1]);
}
}
}
Video (local)
Processing Code – Improved Version
import processing.serial.*;
Serial myPort;
float temp = 0;
float hum = 0;
color ledColor;
boolean ledON = true;
void setup() {
size(600, 400);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 115200);
myPort.bufferUntil('\n');
}
void draw() {
background(20);
calcularColor();
dibujarUI();
}
// -------- LÓGICA --------
void calcularColor() {
if (!ledON) {
ledColor = color(50);
myPort.write('0'); // apagar
return;
}
myPort.write('1'); // encender
if (temp < 20) {
ledColor = color(0,0,255);
myPort.write('B');
}
else if (temp <= 28) {
ledColor = color(0,255,0);
myPort.write('G');
}
else {
ledColor = color(255,0,0);
myPort.write('R');
}
}
// -------- INTERFAZ --------
void dibujarUI() {
fill(255);
textAlign(CENTER);
textSize(24);
text("CONTROL TEMPERATURA", width/2, 40);
textSize(18);
text("Temp: " + nf(temp,1,1) + " °C", width/2, 100);
text("Hum: " + nf(hum,1,1) + " %", width/2, 130);
// LED visual
fill(ledColor);
ellipse(width/2, 250, 120, 120);
// BOTÓN
if (ledON) fill(0,200,0);
else fill(200,0,0);
rect(width/2 - 50, 320, 100, 40, 10);
fill(255);
text(ledON ? "ON" : "OFF", width/2, 345);
}
// -------- CLICK --------
void mousePressed() {
if (mouseX > width/2 - 50 && mouseX < width/2 + 50 &&
mouseY > 320 && mouseY < 360) {
ledON = !ledON;
}
}
// -------- SERIAL --------
void serialEvent(Serial myPort) {
String data = myPort.readStringUntil('\n');
if (data != null) {
data = trim(data);
String[] values = split(data, ',');
if (values.length == 2) {
temp = float(values[0]);
hum = float(values[1]);
}
}
}
Video (local)
Reflection and Final Conclusion
Downloads