Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Adafruit Logo
0

Adding Basic Audio Ouput to Raspberry Pi Zero

Image for user adafruit2
published December 03, 2015, last edited March 08, 2024
Save Link Note Download
64
Beginner
Skill guide

Overview

raspberry_pi_2885-06.jpg

To keep the Raspberry Pi Zero as low cost and small as possible, the Pi foundation didn't include a 3.5mm audio jack. There's also no breakout pads for the audio output. This made us a little :( at first but then we thought "hey you know, we can probably figure out how to get audio out with a little hacking!

How Audio Works on Other Pi Computers

The Broadcom chipset used for the Pi does not have a true analog output. Instead, two pins are PWM (pulse-width-modulated) at very high speeds, and filtered. The PWM frequency has to be at least 10x as high as the highest frequency we want to replicate in audio. Then, by adjusting the duty cycle of the PWM, we can 'fake' an audio signal.

Audio is 20Hz to 20KHz, and the PWM output from the Pi is 50MHz so we can easily filter the high 50MHz out (and anyways it cant be heard).

Looking at the Pi B schematic, we can seePWM0_OUT andPWM1_OUT are the left and right channels.R21 andR20 are voltage dividers to get the 3.3V signal down to about 1.1V max (that's the max peak-to-peak voltage you want for audio line level.

C20/C26 works withR21/R27 to create an "RC low-pass filter". You can calculate the cut-off frequency with 1/(2*pi*RC) = 1/(2*pi*270*33*10-9) = 17865 Hz which is pretty close to 20KHz!

C48/C34 acts as a DC-filter capacitor, it only allows AC through - speakers and headphones don't like DC voltage!

Finally BAV99 are ESD protection diodes. That's to protect the Pi from static coming in and zapping the PWM pins..

raspberry_pi_audiofilter.png

Page last edited March 08, 2024

Text editor powered bytinymce.

Related Guides
Search

Search

Categories

[8]ページ先頭

©2009-2025 Movatter.jp