[AVR] Adjusting volume of speaker using switch and N-channel enhancement MOSFETs

Status
Not open for further replies.

Mandar Joshi

Member level 2
Joined
Mar 4, 2015
Messages
50
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
445
Adjusting volume of speaker using switch and N-channel enhancement MOSFET

I am using PWM on AVR for audio generation. In order to control volume of speaker I want to use N-channel enhancement MOSFET and with the help of single switch I want to control volume as lowest --> lowish -->medium --> highish --> highest --> highish --> medium --> lowish --> lowest ... etc. And for different volume levels I want to use individual MOSFET. Is it possible to do so?

In case where no volume control is required it can be done by connecting Gate of MOSFET to PWM o/p pin through resistor, Source to speaker and Drain to Vcc. But when it comes to volume control I don't get how to do it with more than one MOSFET? What will be the connections then?
 

Hi,

How about a string of resistors for all your different volume settings and a MUX to select betwen them?

Klaus
 

PWM Duty will proportionaly to volume. PWM Frequency will be you sound tone.
 

KlausST, will you please explain in detail?
 

In case where no volume control is required it can be done by connecting Gate of MOSFET to PWM o/p pin through resistor, Source to speaker and Drain to Vcc.
Really? Looks like a very limited audio DAC and amplifier design. Does your speaker tolerate DC current? Which pwm frequency? How many bits resolution?

You can of course control the volume by multiplying the audio signal with a constant, without additional hardware, unfortunately further reducing the resolution. No idea if it matters at all for this design.
 

FvM, I am using 8-bit PWM. PWM frequency will not be more than 31250Hz. More specific 3906.25Hz/7812.5Hz/11718.75Hz/31250Hz any of these four.
You can of course control the volume by multiplying the audio signal with a constant, without additional hardware, unfortunately further reducing the resolution. No idea if it matters at all for this design.
Will it be done by multiplying or dividing samples?
 

Hi,

How about a string of resistors for all your different volume settings and a MUX to select betwen them?

Klaus

KlausST will you please explain how to do that??
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…