Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 1.15 KB

EV3-Sound.md

File metadata and controls

13 lines (11 loc) · 1.15 KB

Essentials

  • Speaker
    • 16Ω
    • 0.25W
  • Amplifier power is switched using GPIO 6-5
  • Driven by pulse with modulation - [EHROWM0B](EV3 PWM)

Device Driver

The driver is implemented as an ALSA sound driver. There is an input device that is integrated into the ASLA driver to provide a system beep (e.g. ^G). There are also extra attributes for manually controlling tone mode since the input device required root privileges when used from a remote terminal (i.e. ssh).

Notes

  • We use the PWM in 2 different ways to produce sound. In Tone mode, the PWM is set to an audible frequency (< 20kHz). The sound you hear is the square wave produced by the PWM output. In PCM Playback mode, the PWM is set to a ultrasonic frequency (>20kHz). The output is passed through a low-pass filter, so the input to the amplifier is a voltage proportional to the duty cycle of the PWM.
  • There is a Google Summer of Code project where a student uses PWM to drive a speaker.