Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[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?
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,124
Helped
4,060
Reputation
8,120
Reaction score
3,982
Trophy points
113
Activity points
119,562
Hi,

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

Klaus
 

Mandar Joshi

Member level 2
Joined
Mar 4, 2015
Messages
50
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
445
KlausST, will you please explain in detail?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,494
Helped
14,051
Reputation
28,357
Reaction score
12,709
Trophy points
1,393
Location
Bochum, Germany
Activity points
276,187
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.
 

Mandar Joshi

Member level 2
Joined
Mar 4, 2015
Messages
50
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
445
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?
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top