How to control volume of speakers with arduino (now WITH digital potentiometer?

Hello!

I have this project where I need to be able to control volume of four speakers individually by using arduino.. The idea is to start with one speaker and get it working an then move to four. I have already found great solutions for this using digital potentiometer, but the problem is I can't get it as fast as I need to.. So 'm looking for other solutions now.. So if anyone has any Idea how to do this I would be really happy to hear it! :)))

Thanks! -Marianne

So 'm looking for other solutions now.

Like something to do while you wait for the necessary hardware?

PaulS: Like something to do while you wait for the necessary hardware?

I misunderstood, and thought she meant the digital pot was slow, was about to ask why and if we could see the code. Slow arriving. Now I get it. Duh. Impatience is not a virtue.

Hi!

I need to control volume of a speaker by using arduino in my school project.. The problem is I can't get a potentionmeter as soon as I need it .. So I'm trying to find out is there any other way to controll volume of the speaker ? Speaker is a small 8 Ohm speaker and the idea is to control four of them at the same time with one arduino.

Thanks

Motorised baffles or louvres

You shouldn't double-post your problem. It just confuses things (and is very much frowned upon). Original here:- How to control volume of speakers with arduino (without digital potentiometer)? The same people will read both posts anyway.

you can use PWM & LDR for volume control

|500x231

BillHo: you can use PWM & LDR for volume control

But not at the post-amplifier stage.

aarg: But not at the post-amplifier stage.

Digital potentiometer also not able at the post-amplifier stage too.

Try a PGA2310PA. Stereo amp with serial control. DIP package, available from Digikey.

marinnnej: Hello!

I have this project where I need to be able to control volume of four speakers individually by using arduino.. The idea is to start with one speaker and get it working an then move to four. I have already found great solutions for this using digital potentiometer, but the problem is I can't get it as fast as I need to.. So 'm looking for other solutions now.. So if anyone has any Idea how to do this I would be really happy to hear it! :)))

Thanks! -Marianne

Until your digital potentiometer arrives ... a) Use a REGULAR potentiometer and turn it by hand ? b) Build a Resistor Ladder, use mosfet or relays to select the Resistance? c) A variable Duty Cycle High Frequency PWM into a MOSFET ? d) Operate a MOSFET in the Linear Region?

Learn how a Digital Potentiometer works and then emulate it using discrete components.

What components do you have available, that can do this?

mrsummitville: Learn how a Digital Potentiometer works and then emulate it using discrete components. What components do you have available, that can do this?

Even for a low resolution 7-bit equivalent, that would require 128 resistors.

Marianne, if it is truly urgent, and not simply impatience on your part, you would be better spending your time finding a close supplier that can deliver one to you quickly. That would be faster than trying to design, test and build something.

I don't know where you are, but RS Components might be worth checking out. They have warehouses world-wide and very fast delivery.

MikeLittle:
Try a PGA2310PA. Stereo amp with serial control.
DIP package, available from Digikey.

So, why order a PGA2310PA from Digi-Key?
Then why doesn’t OP just order the Digital Potentiometer from Digi-Key, Mouser or SparkFun, etc?
Something does not make sense here …

OldSteve:
Even for a low resolution 7-bit equivalent, that would require 128 resistors.

Marianne, if it is truly urgent, and not simply impatience on your part, you would be better spending your time finding a close supplier that can deliver one to you quickly. That would be faster than trying to design, test and build something.

I don’t know where you are, but RS Components might be worth checking out. They have warehouses world-wide and very fast delivery.

I could roughly emulate an 8 Bit Digital Pot with 8 resistors, 8 small relays & 8 digital I/O
using (roughly) R, 2R, 4R, 8R, 16R, 32R, 64R & 128R in series.
If R=100 then 255 steps from 0 ohms to 25K ohm linear taper digital pot.
Each relay would “short out” one resistor in series.
Things the OP may have access to, today.

mrsummitville: I could roughly emulate an 8 Bit Digital Pot with 8 resistors, 8 small relays & 8 digital I/O using (roughly) R, 2R, 4R, 8R, 16R, 32R, 64R & 128R in series. If R=100 then 255 steps from 0 ohms to 25K ohm linear taper digital pot. Each relay would "short out" one resistor in series. Things the OP may have access to, today.

It would be a little rough, with uneven steps, unless Marianne happens to have 100, 200, 400, 800, 1600, 3200, 6400 and 12800 ohm programming resistors. (Only the 100 ohm is a standard value.) Also unwieldy with 8 relays, if she happens to have 8 small relays just sitting there waiting for this, which I very much doubt, and pin-hungry with 8 I/O pins.

It's more likely that she might have 100, 220, 390, 820, 1K8, 3K3, 6K8 and 12K resistors, for a crude approximation of the resistors, but the relays are less likely.

Who knows, maybe she does have it all just sitting there to make up a temporary circuit that can be 'tacked' in then removed when the digital pot arrives, but I strongly suspect that she doesn't.

Best bet is still to find a fast supplier, in my opinion. Marianne, is it truly that urgent?

You cannot control analog output signals (like speakers) directly with Arduino.

You will need more components (resistors / transistors / or a special chip).

If it is hard for you to get a potentiometer you will have a snowballs chance in hell to finish your project using Arduino.

Sorry, however, this way it will not work.


PS: A digital potentiometer could control 4 channels independantly.

I wish you good luck (without irony - because I can see you are in trouble)

arduinoaleman: You cannot control analog output signals (like speakers) directly with Arduino.

You will need more components (resistors / transistors / or a special chip).

If it is hard for you to get a potentiometer you will have a snowballs chance in hell to finish your project using Arduino.

Sorry, however, this way it will not work.

PS: A digital potentiometer could control 4 channels independantly. I wish you good luck (without irony - because I can see you are in trouble)

She doesn't want to control the speakers directly with the Arduino. She is looking for an alternative to a digital pot to use between the Arduino and the circuit.

And Marianne, even when the digital pot does arrive, it needs to be connected before the amplifier, not directly to the speaker. (I'm sure you already know this, since it was pointed out in your original thread.)

Anyway, perhaps it's best to keep the discussion in the original thread, rather than spread out over two. ;)

You could use one of these chips, they would be much better than a digital pot. I2C three band tone control and 4 input channel stereo mixer - TDA7439

OR PGA2311 Stereo audio volume control

It sounds like you aren't able to get any of the components you need on the time-scale you need... Which is a problem, as brick and mortar stores that sell electronics parts are not widespread now that most radioshack locations have closed (assuming you're in US - I don't think it's much better overseas though)

Where are you located? If you're in the continental US, and you order from digikey today, and choose USPS first class (ya, the cheap one), you'll probably have it on friday (and USPS delivers on saturdays too). Digikey runs a tight ship. For europe, to go-to vender is either farnell or mouser, I forget which.

There is of course another approach - find an existing piece of consumer electronics with a pot in it (maybe even a volume control knob - though some of the new AV equipment has a rotary encoder instead of a pot for that, and then does the volume control with a digipot), and take it out and use it... Potentiometers are one of the few components worth the time it takes to remove them from discarded electronics. Hell, one time I was on vacation and used a 1k pot from a boat navigation device I scored at the dump to kludge up a charger for my electric razor.

DrAzzy: It sounds like you aren't able to get any of the components you need on the time-scale you need... Which is a problem, as brick and mortar stores that sell electronics parts are not widespread now that most radioshack locations have closed (assuming you're in US - I don't think it's much better overseas though)

Where are you located? If you're in the continental US, and you order from digikey today, and choose USPS first class (ya, the cheap one), you'll probably have it on friday (and USPS delivers on saturdays too). Digikey runs a tight ship. For europe, to go-to vender is either farnell or mouser, I forget which.

There is of course another approach - find an existing piece of consumer electronics with a pot in it (maybe even a volume control knob - though some of the new AV equipment has a rotary encoder instead of a pot for that, and then does the volume control with a digipot), and take it out and use it... Potentiometers are one of the few components worth the time it takes to remove them from discarded electronics. Hell, one time I was on vacation and used a 1k pot from a boat navigation device I scored at the dump to kludge up a charger for my electric razor.

DrAzzy, she wants digital control of the volume, not manual. (She's waiting on a digital pot.)

Don't you also have RS Components in the US? They're the other "go to" for Europe, England, Australia. Courier delivery here in Oz within 2-3 days typically, and delivery is free for all online orders. (Great incentive to buy from them.)