Author Topic: Connecting microcontroller DAC to speakers.  (Read 640 times)

0 Members and 1 Guest are viewing this topic.

Offline Hugondon

  • Newbie
  • Posts: 3
  • Country: mx
Connecting microcontroller DAC to speakers.
« on: November 30, 2020, 06:29:55 pm »
Hey!
I have a doubt regarding the DAC connection of a NUCLEO-F767ZI board


I'm currently connecting the system as follows: DAC channel -> Jack input of PAM8610 board -> Speakers (I had both DAC channels connected, but in the image I'm using only one).
[attachimg=1]

I've read that when you're working with speakers, you usually need to "isolate" its impedance using a capacitor.
Can anybody give me some advice on whether you have to include some isolating circuit for the DAC when you're using an amplifier like the one of the photograph?

This is the amplifier board
https://www.amazon.com/-/es/HiLetgo-PAM8610-amplificador-amplificadora-DC8V-12V/dp/B01DK29KYG/ref=sr_1_1?__mk_es_US=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=pam8610&qid=1606760757&s=electronics&sr=1-1
 

Offline Lomax

  • Frequent Contributor
  • **
  • Posts: 506
  • Country: eu
  • Minimalist
Re: Connecting microcontroller DAC to speakers.
« Reply #1 on: November 30, 2020, 07:49:35 pm »
You will likely need some form of reconstruction filter (i.e. anti-aliasing filter) on the DAC output to produce high-quality audio. This looks like a reasonable example. At the minimum add an R/C low-pass filter with a 20kHz roll off point to dampen the quantisation noise. Ti offer this paper on the subject. As far as the impedance matching is concerned, the amplifier should already take care of this, so if you can put up with the sound quality you don't really need to do anything; nothing should break with your set-up, it just might not sound all that great...

Edit: I see that you're using a Class D amplifier - have you considered using one that has a digital (i2s) input instead? Would save you the extra DAC/ADC conversion steps... I assume your MCU has i2s output capability?
« Last Edit: November 30, 2020, 08:26:49 pm by Lomax »
 
The following users thanked this post: Hugondon

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 2889
  • Country: gb
Re: Connecting microcontroller DAC to speakers.
« Reply #2 on: November 30, 2020, 08:49:52 pm »
An amplifier output needs a capacitor in series when it has as a DC offset, e.g. a single push-pull output stage with single power rail.  Blocking this DC voltage is important as it can burn out speakers, and even if it doesn't it will degrade sound output.

The PAM8610 is a filterless class D audio amplifier, since both speaker outputs are driven in antiphase there is no DC offset on the output and no series capacitor is required.
 
The following users thanked this post: Lomax, Hugondon

Offline james_s

  • Super Contributor
  • ***
  • Posts: 17462
  • Country: us
Re: Connecting microcontroller DAC to speakers.
« Reply #3 on: November 30, 2020, 08:54:41 pm »
Isn't he talking about a capacitor between the DAC and the *input* side of the amplifier?

Generally speaking the output of a DAC will be from 0 to whatever positive value, many output a current, some output a voltage, converting from one to another is easy. Anyway audio is AC and goes above and below 0 so you need a capacitor to remove the DC offset you get inherently from a DAC output that can only go positive.
 
The following users thanked this post: Lomax, Hugondon

Offline Hugondon

  • Newbie
  • Posts: 3
  • Country: mx
Re: Connecting microcontroller DAC to speakers.
« Reply #4 on: November 30, 2020, 09:17:32 pm »
You will likely need some form of reconstruction filter (i.e. anti-aliasing filter) on the DAC output to produce high-quality audio. This looks like a reasonable example. At the minimum add an R/C low-pass filter with a 20kHz roll off point to dampen the quantisation noise. Ti offer this paper on the subject. As far as the impedance matching is concerned, the amplifier should already take care of this, so if you can put up with the sound quality you don't really need to do anything; nothing should break with your set-up, it just might not sound all that great...

Edit: I see that you're using a Class D amplifier - have you considered using one that has a digital (i2s) input instead? Would save you the extra DAC/ADC conversion steps... I assume your MCU has i2s output capability?

a) I'll try the filter at the output, thanks! I'm not worried about a nice super high-quality sound, since the system will only generate some different waveforms with different envelopes (the idea is doing some source of emulation of a synthesizer).

b) That was exactly the initial idea! It does have a I2S output! The only problem is that it is part of an academic project and its due next week... so I don't have a lot of time to implement extra things :(. Probably I'll take a look at that when the semester is over, tho!
 
The following users thanked this post: Lomax

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 16812
  • Country: gb
  • 0999
Re: Connecting microcontroller DAC to speakers.
« Reply #5 on: November 30, 2020, 10:01:11 pm »
Hey!
I have a doubt regarding the DAC connection of a NUCLEO-F767ZI board


I'm currently connecting the system as follows: DAC channel -> Jack input of PAM8610 board -> Speakers (I had both DAC channels connected, but in the image I'm using only one).
[attachimg=1]

I've read that when you're working with speakers, you usually need to "isolate" its impedance using a capacitor.
Can anybody give me some advice on whether you have to include some isolating circuit for the DAC when you're using an amplifier like the one of the photograph?

This is the amplifier board
https://www.amazon.com/-/es/HiLetgo-PAM8610-amplificador-amplificadora-DC8V-12V/dp/B01DK29KYG/ref=sr_1_1?__mk_es_US=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=pam8610&qid=1606760757&s=electronics&sr=1-1

Yes, the amplifier should be AC coupled to the DAC, via a capacitor, but assuming your module is built, as per the PAM8610 data sheet, it will already have the capacitors built-in. All you need to do is connect it to the DAC output. No other components are required.
https://cdn.datasheetspdf.com/pdf-down/P/A/M/PAM8610-Diodes.pdf
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf