Output Devices
Group Assignment
As part of the group assignment, we analyzed different types of output devices and their applications in embedded systems. We measured the power consumption of different actuators and identified the best configurations for efficient performance.
For more details on our group work, visit: Group Assignment
Invidual Assignment
In this assignment, I explored the use of output devices in embedded systems, specifically using the Xiao ESP32S3, an OLED 128x32 display, and a servo motor. The goal was to control the servo motor using buttons and display its movement status on the OLED screen.
What Are Output Devices?
Output devices are hardware components that receive data from a microcontroller or computer and convert it into a perceivable form such as motion, light, or sound. These devices play a crucial role in interactive systems. Examples include:
- Displays (OLED, LCD, LED Matrix)
- Motors (Servo, Stepper, DC Motors)
- Speakers and Buzzers
- LEDs






For this assignment, I worked with three servo motors to explore synchronized motion control. I used the custom PCB I fabricated during Week 8 of the Fab Academy,You can find more details about its development here.
- integrating a 5V voltage regulator to ensure stable power delivery to the motors. This experiment directly supports my final project: the development of an exoskeleton for rehabilitation in individuals with paralysis.
- Custom PCB (fabricated in Week 8)
- 5V Voltage Regulator
- Xiao ESP32S3
- 3 SG90 Servo Motors
- External 5V Power Supply
- Jumper Wires and Breadboard
My custom PCB is designed to move motors from the beginning, as my final project requires motor control. The design was done in KiCad, and below is the schematic for the connections:

Materials Used
Circuit Connections

Servo Motor Connections
Servo Motor | Xiao ESP32S3 |
---|---|
Servo 1 Signal | GPIO 2 |
Servo 2 Signal | GPIO 3 |
Servo 3 Signal | GPIO 4 |
VCC | 5V (Regulated) |
GND | GND |
Code Implementation
I programmed the Xiao ESP32S3 using Arduino IDE, a popular development environment for embedded systems. Arduino can be downloaded from: Download Arduino.
The code utilizes the ESP32Servo.h library to control the servo motors.
See the Pen Untitled by Paula Rivero (@Paula-Rivero) on CodePen.
Code Explanation – Detailed
Below is a step-by-step explanation of the code used to control three servo motors with the Xiao ESP32S3:
#include <ESP32Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
void setup() {
servo1.attach(2); // Connects servo1 to GPIO 2
servo2.attach(3); // Connects servo2 to GPIO 3
servo3.attach(4); // Connects servo3 to GPIO 4
}
void loop() {
// Move all servos from 0° to 180° smoothly
for (int pos = 0; pos <= 180; pos++) {
servo1.write(pos);
servo2.write(pos);
servo3.write(pos);
delay(15); // Smooth transition
}
// Move them back from 180° to 0°
for (int pos = 180; pos >= 0; pos--) {
servo1.write(pos);
servo2.write(pos);
servo3.write(pos);
delay(15);
}
}
Line-by-line explanation:
#include <ESP32Servo.h>
: Includes the library to control servos with ESP32.Servo servoX;
: Creates servo objects for each motor.attach(pin);
: Links each servo to a specific GPIO pin.write(pos);
: Sets the angle for each servo motor.delay(15);
: Adds a small delay to make the movement smooth.
This approach synchronizes the three motors to simulate the grasping and releasing motion required in my exoskeleton design.
Hero Shot – System in Action
This video shows my working prototype where three SG90 servo motors are controlled by the Xiao ESP32S3 through my custom PCB. This test demonstrates successful control of the motors – a key feature for my final project (a rehabilitation exoskeleton).
Learning Outcomes
During Week 10 of the Fab Academy, I enhanced my understanding of output devices and their integration into embedded systems. I learned how to measure power consumption for different actuators, optimize energy efficiency, and implement real-time motor control. Additionally, this assignment strengthened my skills in circuit design, voltage regulation, and firmware programming, which are crucial for my final project.