Actuators & Control · Study deck

Visual and Audio Actuators: LED Feedback

A cold-room alarm should not go silent when one output path fails.

Motor Max is your guide for this deck.

visualaudio
Motor Max, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: A camera samples the 5 kHz PWM in time, so falias=∣fPWM−round⁡(fPWM/fs)fs∣f_{alias}=|f_{PWM}-\operatorname{round}(f_{PWM}/f_s)f_s|falias​=∣fPWM​−round(fPWM​/fs​)fs​∣ can fold invisible switching into a visible 8-20 Hz beat.
  • Explain: The dark screen carries green status icons, a date, and the word “Ready.” These are distinct pieces of information a user can read at a glance, unlike a single LED state.
  • Explain: It sits between the MCU and the matrix: DIN receives serial data, CLK clocks bits in, LOAD or CS latches a command, and DOUT can pass data to another driver.
Real photograph of buzzer (piezo)
Real photograph of buzzer (piezo)
iotclass.org

Major section

Start With the Story

A loose display lead must not turn a real high-temperature alarm into silence.

  • The first design question is what a nearby person can still see or hear when one output path fails.
  • GPIO means a general-purpose input/output pin used for a direct control line.
  • I2C is a shared two-wire link for nearby parts, while SPI is a clocked link with separate data paths.

Key terms

Modulation
Modulation means changing a signal over time to carry a control value.
iotclass.org

Major section

Start With the Story (continued)

Modulation means changing a signal over time to carry a control value.

  • PWM means pulse-width modulation: the output switches on and off, and the on-time share sets the apparent brightness or drive level.
  • Disconnect one lead, dim the supply, repeat the alarm, and restart the board while the unsafe input remains present.
  • This runway does not prove that every person will notice an alert or that an output is safe for every load.
A green printed-circuit board holds a 16-column by 2-row character LCD. The screen displays sample text across both rows, and a row of exposed interface solder contacts runs along its upper edge in this angled product photograph.
A green printed-circuit board holds a 16-column by 2-row character LCD. The screen displays sample text across both rows, and a row of exposed interface solder contacts runs along its upper edge in this angled product photograph.
iotclass.org

Major section

Phoebe's Field Notes: Two Physical Limits Hiding Behind "256 Levels" And "5 kHz"

The mathematical gist: An 8-bit LED command has a 1/255=0.392%1/255=0.392\%1/255=0.392% duty step and an ideal 49.9 dB quantiser SNR.

  • A camera samples the 5 kHz PWM in time, so falias=∣fPWM−round⁡(fPWM/fs)fs∣f_{alias}=|f_{PWM}-\operatorname{round}(f_{PWM}/f_s)f_s|falias​=∣fPWM​−round(fPWM​/fs​)fs​∣ can fold invisible switching into a visible 8-20 Hz beat.

Let Max connect 8-bit brightness steps and the chapter's 5 kHz PWM to camera beat frequency.

iotclass.org

Major section

LED Matrices and Driver ICs

An 8x8 matrix has 64 emitters, but the package usually exposes row and column pins rather than 64 separate LED pairs.

  • The controller lights a pattern by selecting one row or column at a time fast enough that the eye sees a stable image.
  • The MAX7219/MAX7221 family is a common example.
  • V+ and GND power the chip, and the ISET resistor sets the peak segment current.

Why it matters

If the first display appears scrambled, fix the row/column mapping or module orientation before adding animations; otherwise the software may hide a wiring error behind a pretty pattern.

An 8x8 LED dot matrix display module with a grid of small LEDs and header pins along one edge
An 8x8 LED dot matrix display module with a grid of small LEDs and header pins along one edge
iotclass.org

Major section

LED Matrices and Driver ICs (continued)

A first proof can write a diagonal or single-row sweep, then record whether the image is rotated, mirrored, or missing rows.

  • That multiplexing saves pins, but it creates two practical problems: the firmware must refresh the matrix continuously, and the current peaks through the active row or column must stay inside the matrix and driver ratings.
  • It sits between the MCU and the matrix: DIN receives serial data, CLK clocks bits in, LOAD or CS latches a command, and DOUT can pass data to another driver.
  • The chip interface is small, but it is still a protocol.
A flexible strip of small square RGB LED modules connected in a row
A flexible strip of small square RGB LED modules connected in a row
iotclass.org

Major section

LED Matrices and Driver ICs (continued)

On the display side, the DIG0 through DIG7 pins select rows or digits, while SEG A through SEG G and SEG DP drive the eight column or segment lines.

  • Each update is a 16-bit instruction: one address byte selects the target register and one data byte supplies the value.
  • CLK advances each bit, DIN carries the bit value, and LOAD or CS latches the complete command.
  • If the display is blank, check shutdown mode first, then confirm that the data, clock, and load pins match the library constructor.
Real photograph of 16x2 character lcd display
Real photograph of 16x2 character lcd display
iotclass.org

Major section

LCD Displays

The Timeport photograph shows how a small display can present more than a coloured status light.

  • The dark screen carries green status icons, a date, and the word “Ready.” These are distinct pieces of information a user can read at a glance, unlike a single LED state.
  • The photograph also shows the display set inside a pager case, so it illustrates the user-facing result of a display choice.

Why it matters

The visible output is useful here because it shows when text and symbols make the device state easier to explain.

Real photograph of oled display (ssd1306)
Real photograph of oled display (ssd1306)
iotclass.org

Deck summary

Key takeaways

A loose display lead must not turn a real high-temperature alarm into silence.

  • Modulation means changing a signal over time to carry a control value.
  • The mathematical gist: An 8-bit LED command has a 1/255=0.392%1/255=0.392\%1/255=0.392% duty step and an ideal 49.9 dB quantiser SNR.
  • An 8x8 matrix has 64 emitters, but the package usually exposes row and column pins rather than 64 separate LED pairs.
  • A first proof can write a diagonal or single-row sweep, then record whether the image is rotated, mirrored, or missing rows.
iotclass.org

Retrieval practice

Recall check 1 of 2

Motor Max says: answer from memory, then check your reasoning.

Q1A battery-powered leak detector sits under a sink and must alert someone who may not be looking at it. Which feedback design is most appropriate?

ACombine a flashing LED with a buzzer alert
BUse only an OLED screen showing the leak status
CUse a relay because it can switch high-current loads
DUse only a very dim status LED to save power
Show answer

Answer: A Visual and audio actuators should be selected around how users will notice and interpret the alert in the device's real environment.

iotclass.org

Retrieval practice

Recall check 2 of 2

Motor Max says: answer from memory, then check your reasoning.

Q2Why does an LED matrix kit use a display driver rather than direct GPIO for every lamp?

ABecause the driver removes any need to check matrix wiring or orientation.
BBecause the driver refreshes rows and limits current while the controller sends patterns.
CBecause the driver stores every sensor reading in the cloud before display.
DBecause the driver makes every matrix lamp consume no electrical power.
Show answer

Answer: B Refresh and current control are the driver’s job.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Visual and audio actuators should be selected around how users will notice and interpret the alert in the device's real environment.
  2. B · Refresh and current control are the driver’s job.
iotclass.org