Week 10: Output Devices

This week focused on power management for outputs, emphasizing current consumption and load requirements.

Before starting

Output devices are components that allow a system to interact with the physical world by transforming electrical signals into visible, mechanical, thermal, or audible actions. In embedded systems and digital fabrication environments, these devices receive instructions from a microcontroller (such as an ESP32 or XIAO) and execute actions like turning on a light, moving a motor, activating a relay, or generating sound. Unlike input devices (sensors), which collect data, output devices act upon that data, closing the loop between measurement and action.

These devices operate by receiving control signals either digital (ON/OFF) or analog (variable levels) from a controller. Depending on the signal type, the output device interprets the instruction and produces a corresponding physical response.
Communication Type How It Works
GPIO (Digital Output) Uses HIGH/LOW signals (ON/OFF) directly from microcontroller pins.
PWM (Pulse Width Modulation) Modulates signal duty cycle to simulate analog output.
Analog Output (DAC) Generates variable voltage levels instead of discrete signals.
I²C (Inter-Integrated Circuit) Two-wire communication (SDA, SCL) with multiple addressable devices.
SPI (Serial Peripheral Interface) High-speed communication using multiple lines (MOSI, MISO, SCK, CS).
UART (Serial Communication) Asynchronous communication using TX/RX lines.

GPIO

Turning LEDs on/off, activating relays, simple control of devices.
Fab termi

PWM

Controlling LED brightness, motor speed, servo positioning.
Fab termi

Analog Output

Audio output, signal generation, precise control systems.
Fab termi

I²C

OLED/LCD displays, DAC modules, smart drivers, sensors/actuators.
Fab termi

SPI

Displays, memory modules, high-speed DACs, LED drivers.
Fab termi

UART

Bluetooth modules, serial displays, communication with other devices.
Fab termi

Regarding electrical characteristics, output devices typically require higher current and sometimes higher voltages than what a microcontroller can safely provide. For instance, a GPIO pin usually supplies around 3.3V or 5V with a limited current (often 10–20 mA max), which is sufficient for small LEDs but not for motors or high-power loads. Therefore, external components such as transistors, MOSFETs, relays, or motor drivers are used to handle larger currents and protect the control circuitry.
Power consumption is a key factor when working with output devices. The basic electrical relationships used to analyze and design these systems include:
P = V × I

This equation calculates power consumption, where P is power (watts), V is voltage (volts), and I is current (amperes). It is essential for determining how much energy an output device will consume.

I = V / R

Derived from Ohm’s Law, this formula is used to calculate the current flowing through a device such as an LED, allowing proper resistor selection to avoid damage.

P = I² × R

This form is useful for calculating power dissipation in resistive elements, such as current limiting resistors, ensuring they can handle the thermal load safely.


For further information about this topic, please consult this week’s group page.

Examples

Continuing with the board from Week 8 , this design includes two output systems: two NeoPixels and a motor output with a flyback configuration. The motor output is specifically prepared to drive a DC motor, allowing the system to generate haptic feedback when a button (input) is pressed.
Regarding the NeoPixel configuration, both LEDs are powered from a common 5V supply rail, and their data signal is controlled from the XIAO microcontroller through pin D6. A 220 Ω resistor is placed in series between the microcontroller pin and the NeoPixel data input to protect the LEDs and improve signal integrity. Additionally, 100 nF capacitors are included for decoupling, helping to reduce noise and stabilize the power supply for proper LED operation.
Fab termi
In terms of power consumption, each NeoPixel can draw up to approximately 60 mA at full brightness (white light), meaning that two NeoPixels may require up to 120 mA. Therefore, the expected power consumption is:
Per NeoPixel:

Like 0.3 W (5V × 0.06 A)

Total (2 NeoPixels):

0.6 W

These values represent maximum consumption, and in most cases, the actual current will be lower depending on brightness and color.

It is important to note that both the NeoPixels and the flyback (motor driver circuit) are connected to a common 5V supply line. This power rail is designed to be flexible: it can be powered either by an external 5V power supply or directly from the XIAO’s 5V output pin. However, the latter is only recommended when the motor is not connected, since the motor can draw significantly higher current, potentially overloading the microcontroller, causing instability, or even permanent damage.
Fab termi

This design decision is based on basic power calculations. A small DC motor, even a low-power one, can typically draw between 200 mA and 500 mA, and even more during startup due to inrush current.
If we estimate a conservative scenario:
2 NeoPixels:

Like 120 mA

Small DC motor:

Like 300 mA

Total current:

Like 420 mA

And using the power formula:

P = V × I = 5V × 0.42 A ≈ 2.1 W

This exceeds what the XIAO’s onboard regulator or USB supply can safely provide for continuous operation. Microcontroller boards are not designed to directly supply motors due to their higher current demands and the instability caused by inductive loads.
Additionally, motors introduce electrical noise and voltage spikes, which is why a flyback diode is required. These effects further increase the risk of malfunction if everything is powered from the same regulated source.
For these reasons, when the motor is in use, an external 5V power supply is required, ensuring stable operation and protecting the integrity of the system.

HERROZINC

An example in industry is an automated machine such as a planetary mixer, which is commonly used for cement mixing and significantly reduces processing time.
Fab termi
This machine is relatively complex, as it includes multiple input devices (such as weighing scales and a flow meter) and output devices. In this case, the outputs include pneumatic pistons for loading and unloading materials, as well as electric motors for transporting and mixing.
Fab termi
Fab termi
Fab termi
Because of these requirements, this system operates at an industrial level, using 220V and 440V AC power supplies. These voltage levels correspond to different configurations of electrical phases:
  • 220V is typically used in single-phase or lower-power three-phase systems, often for smaller motors or auxiliary equipment.
  • 440V (or 380–480V range) is used in three-phase systems, which are standard in industry for driving larger motors efficiently.
Fab termi
Three-phase power allows motors to operate more smoothly and efficiently, delivering higher torque with lower current per phase. Industrial motors powered at 440V can easily consume several hundreds of watts to multiple kilowatts (kW) depending on their size and load. For example, a medium motor may draw 2–10 A per phase, resulting in power levels from 1 kW up to 5 kW or more.

A very basic output connection diagram is shown in the image provided. This diagram illustrates how three-phase motors are connected using:
  • Contactors (for switching the motors ON/OFF)
  • Thermal overload relays (for protection against overcurrent)
  • Circuit protection elements (guards/fuses)
Fab termi
Each motor (MIXER, BANDA, GUSAN) is connected to three phases (L1, L2, L3), and passes through protection and switching elements before reaching the motor terminals (U1, V1, W1). This ensures safe and controlled operation in an industrial environment.
On the right side of the diagram, the pneumatic system is shown. The pistons used for materials like sand (ARENA), water (AGUA), gravel (GRAVA), and cement (CEME) are controlled by electrovalves (solenoid valves).
These electrovalves are typically powered by the PLC outputs, which commonly operate at 12V or 24V DC (not 14V in most industrial standards). The PLC sends control signals to activate the valves, allowing compressed air to move the pistons accordingly.
Overall, this example illustrates the significant difference between industrial systems and prototyping systems:

  • Industrial components (motors, valves, actuators) operate at high voltages and power levels (hundreds to thousands of watts)
  • Prototyping systems (like microcontrollers such as the XIAO) operate at low voltage (3.3V–5V) and low power

In this case, the system is controlled by a PLC, which uses low-voltage control signals (typically 24V DC) to safely manage high-power industrial devices, acting as the central controller of the entire process.

Results

In XIAO and PLC

On the left, an example of the XIAO’s output is shown, controlling the NeoPixels and the DC motor. On the right, a test carried out with the PLC is presented, since due to confidentiality reasons, the rest of the system cannot be disclosed.

Download files

For download 3D and others files, just click on the dancing shrimp.