Output devices
- Group assignment:
- Measure the energy consumption of an output device.
- Document your work on the group work page and reflect on what you learned on your individual page.
- Individual assignment:
- Add an output device to a microcontroller board you've designed and program it to do something.
GROUP ASSIGNMENT
Link to group assignment
https://fabacademy.org/2026/labs/lima/Weeks/Week10/Week10.html
Aim
Characterize the energy consumption of an output device by measuring voltage and current, interpreting its influence on system performance and its integration within a microcontroller-based architecture.
Measuring energy consumption
To determine the energy consumption of the system, two fundamental variables were measured: voltage (V) and current (I), using a digital multimeter.
The electrical power was calculated using the following relationship:
P = V × I
Procedure
- The multimeter was connected in series to measure the current of the operating system
- The voltage was measured in parallel at the power supply terminals
- Measurements were taken with the system active to obtain real consumption values
Results
- Voltage: 5V
- Current: ~11.2 mA
- Power:56.16 mW
Analysis
The results show reduced energy consumption, characteristic of optimized embedded systems. This power level allows the system to be powered by low-capacity sources, such as batteries or portable modules.
Furthermore, it is observed that consumption depends directly on the state of the output device and the active components in the circuit, which highlights the importance of properly selecting each element based on energy efficiency.
Measuring energy consumption made it possible to understand that the design of electronic systems depends not only on functionality, but also on efficiency.
Proper consumption control is key to ensuring system stability, autonomy, and scalability, especially in real-world applications such as IoT devices or automated systems.
Learning Achieved
Through the group assignment, I learned how to measure and analyze the energy consumption of an output device by calculating voltage, current, and power. I understood the importance of energy efficiency in embedded systems and how power consumption affects system stability, autonomy, and performance. This activity also strengthened my understanding of integrating output devices into microcontroller-based applications while considering real-world energy requirements.
INDIVIDUAL ALLOCATION
Aim
Design and implement the control of an output device on a board based on XIAO ESP32-C3, with the purpose of representing processed information from the system in real time, validating the integration between input, processing and output in a functional embedded system.
📂 Materials Used
- I2C OLED Display
- LED
- Speaker / Buzzer
- Resistors
- Jumper cables
- Protoboard
- PCB board
- Solder tin
- USB Type-C cable
- Header Connectors
💻 Equipment Used
- XIAO ESP32-C3 Microcontroller
- Computer / Laptop
- Power supply
- Digital multimeter
- Soldering station
- Protoboard
🛠️ Tools Used
- Soldering iron
- Precision tweezers
- Wire stripper
- Cable cutter
- Screwdrivers
- Cutting base
⚙️ Software Used
- Arduino IDE
- SSD1306 OLED Library
- Adafruit GFX Library
- Serial Monitor
- Datasheet of electronic components

My process
Output device used
AOLED display with I2C communicationas an output device, allowing real-time visualization of the data processed by the microcontroller.
Technical specifications:
- Power supply: 3.3V (compatible with XIAO ESP32-C3 logic)
- Communication interface: I2C (SDA / SCL)
Low energy consumption compared to other screens
- High resolution and contrast for clear viewing
Selection justification:
An OLED screen was chosen due to its energy efficiency, ease of integration via I2C, and ability to represent information more fully than simple output devices (such as LEDs).
Function within the system:
The screen acts as a user interface, displaying the soil moisture status (DRY / WET), allowing immediate interpretation of the information processed by the microcontroller.

Integration with the board (XIAO ESP32-C3)
The OLED screen was integrated directly onto the circuit board designed based onXIAO ESP32-C3, without the use of a protoboard, fulfilling the requirement of electronic manufacturing and connection in real hardware.
Connection implemented:
- VCC → 3.3V (regulated output of the XIAO)
- GND → GND (common reference)
- SDA → XIAO SDA pin (I2C data line)
- SCL → XIAO SCL pin (I2C clock line)
Technical considerations:
- We worked with the logic of3.3Vensuring electrical compatibility between the display and the microcontroller
- The protocol was usedI2Callowing a reduction in the number of pins and simplifying the circuit design
- A guarantee was providedcommon ground reference (GND)to avoid communication errors
- The correct I2C address of the device was verified for its initialization in the code
Integration criteria:
The direct connection to the board allows for greater system stability, reducing interference and common errors associated with temporary connections. Furthermore, this integration validates the previous electronic design and its functionality in a real-world environment.
Programming and control
A program was developed in the Arduino environment compatible with theXIAO ESP32-C3, using specific libraries for managing the OLED screen via I2C protocol.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
const int sensorPin = 2;
void setup() {
pinMode(sensorPin, INPUT);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
while(true);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
}
void loop() {
int state = digitalRead(sensorPin);
display.clearDisplay();
display.setCursor(0,10);
if(state == HIGH){
display.println("WET");
} else {
display.println("DRY");
}
display.display();
delay(500);
}Operating logic:
- The microcontrollerXIAO ESP32-C3It performs the digital reading of the sensor through the pin configured as input.
The received signal (HIGH/LOW) is interpreted as soil moisture condition
- Depending on the state, the system executes a conditional structure that defines the information to be displayed.
- The bookstoreAdafruit_SSD1306It manages I2C communication and screen writing.
- An internal graphics memory buffer is used, which is updated using display.display()
Relevant technical aspects:
- Use of the protocolI2Cthrough the Wire library for efficient communication
Device address:0x3C, previously verified
- Graphics buffer management to prevent flickering or rendering errors
Update frequency controlled by delay(500) for visual stability
Programming criteria:
The code is structured to maintain a continuous sensor reading and a periodic interface update, ensuring a real-time response without overloading the system.
System validation
The system was validated through functional tests and verification of the coherence between the input signal and the response of the output device.
Tests performed:
- Sensor activation under conditions ofwet and dry ground
- Continuous reading of the digital signal (HIGH / LOW)
- Observing the response on the OLED screen
Results obtained:
- The OLED screen responded correctly to the sensor's state changes.
- The information was updated in real time without significant delays.
- Consistency was maintained between the input signal and the display (WET / DRY)
- No I2C communication errors were detected during operation
Validation criteria:
- Stability:The system maintains continuous operation without failures
- Precision:The output corresponds correctly to the measured physical state.
Answer:The update time is adequate for the application
- Integrity:There are no signal losses or display errors.
Technical conclusion:
The validation confirms that the integration between sensor, microcontroller (XIAO ESP32-C3The output device is functional, stable, and suitable for real-time monitoring applications.
Final result – HERO SHOT
The developed system consists of a functional humidity monitoring solution, effectively integratinginput, processing and outputin a microcontroller-based architecture.
System capabilities:
- Soil moisture detection using HL-69 sensor
- Digital signal processing with the microcontrollerXIAO ESP32-C3
- Real-time information display via OLED screen
- Execution of conditional logic for data interpretation
- Complete integration of hardware and software on a functional board

Value of the result:
The project demonstrates the ability to design and implement a complete embedded system, where environmental data is captured, processed, and communicated to the user in a clear and efficient manner.
Problems and solutions
Problem 1: The LED did not light up
Solution:
The polarity of the LED and the pin connections in the circuit were checked.
Problem 2: The buzzer did not emit sound
Solution:
The output pin programming and the correct connection of the buzzer were verified.
Problem 3: The OLED screen was not displaying information
Solution:
The I2C connections and the screen address in the code were checked.
This project made it possible to understand that output devices not only execute actions, but also play a key role in theinterpretation and communication of data within an embedded system.
The integration ofXIAO ESP32-C3With an OLED screen, it became clear that the system's value lies not only in data capture, but also in its ability to transform them into information that is understandable to the user in real time.
Furthermore, it was confirmed that the functionality of a system depends directly on the correct interaction betweenhardware and softwarewhere aspects such as I2C communication, signal stability, and programming logic influence the final result.
Finally, this development reinforces that a well-designed embedded system must guarantee consistency betweeninput, processing and outputensuring not only that it works, but that it isreliable, efficient and useful in a real-world application context.
Learning achieved
During this week, we were able to understand the importance of output devices within an embedded system, understanding that their function is not limited to simply executing actions, but also to communicating information clearly and efficiently to the user.
We learned how to integrate and program an OLED screen using I2C communication with the XIAO ESP32-C3 microcontroller, correctly configuring the SDA and SCL connections, as well as the device address and the libraries necessary for its operation.
Furthermore, knowledge of Arduino IDE programming, handling conditional structures, and real-time information updates through graphical interfaces was strengthened. The relationship between input, processing, and output within a functional electronic system was also understood.
At a practical level, the system's operation was validated through soil moisture tests, observing how the microcontroller processes the sensor signal and represents the state on the OLED screen in a stable and accurate manner.
Furthermore, measuring energy consumption made it possible to understand the importance of designing efficient systems, especially in IoT applications and portable devices.
where controlling electricity consumption is fundamental to ensuring autonomy and stability.
📋 Check-off List
1. Linked to the group assignment page?
Yes. The link to the group page where the energy consumption measurement of the output device and the system analysis were performed was included.
2. Did you document how you and your group determined the energy consumption of an output device?
Yes. The measurement procedure was explained using a multimeter to obtain voltage and current, applying the power formula:
P=V×IP = V \times IP=V×I
In addition, the results obtained were documented: 5V, 11.2 mA and an approximate power of 56.16 mW.
3. Did you document what you learned by interfacing the output devices with the microcontroller and controlling them?
Yes. The integration of an I2C OLED display with the XIAO ESP32-C3 was documented, as well as how the microcontroller processes the sensor signal to display real-time information.
4. Is it linked to the board made previously, or did you document your design and manufacturing process?
Yes. We worked on the previously designed PCB with the XIAO ESP32-C3, directly integrating the OLED screen and other output devices.
5. Did he explain how his code works?
Yes. The program's operation in the Arduino IDE was explained, including sensor reading, conditional logic, and I2C communication with the OLED screen using the libraries.Wire,Adafruit_GFXandAdafruit_SSD1306.
6. Did you explain any problems encountered and how you resolved them?
Yes. Issues such as LED, buzzer, and OLED display failures were documented and resolved by checking polarity, connections, and I2C address.
7. Does it include original source code and new design files?
Yes. The source code used to control the OLED screen and the corresponding files for the electronic design integrated into the PCB were included.
8. Does it include a 'hero shot' on your board?
Yes. The hero shot was added showing the complete system in operation, with the moisture sensor, the XIAO ESP32-C3, and the OLED screen displaying the soil condition in real time.
❓ Frequently Asked Questions
1. Is it sufficient to use a simple LED as an output device for this task?
Answer:
No. In my case, I understood that a basic LED didn't meet the required level of complexity, since the task aimed to demonstrate a more complete system output. Therefore, I used devices like an I2C OLED display and also tested outputs such as a buzzer and LED within my Xiaomi ESP32-C3-based board, which allowed me to visualize real-time information and not just a simple status.
2. Can I use a breadboard to connect my output devices?
Answer:
No. During my development, I avoided using a breadboard and connected the output devices directly to the PCB I designed. This was important because the goal was to validate a real embedded system, not a temporary simulation. The OLED display and other components were soldered and connected directly to the board.
Week Files
Download all resources and files of this week in a compressed .ZIP archive