Maker Pro
Maker Pro

BJT NPN + PNP to switch channel.

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
it should able to work fine if it work with 1 pin 2 speakers. I just have to duplicate it to another audio pin
You currently use 2 pins:
1 pin for audio
1 pin for selecting 1 out of 2 speakers
That is 2 pins, 2 speakers.

You can' use the same method for 4 speakers. When you simply duplicate your circuit, you will have sound from 2 speakers at a time. With four speakers and external switching you will need:
1 pin for audio
4 pin for selecting one out of 4 speakers - or 2 pins from the µC plus an external 2-to-4 decoder whci I suppose you dont want to use because oif the increased complexity.
That is 5 pins for 4 speakers.

If you use instead a separate pin to output audio to one speaker per pin, you need only 4 pins and no external switching logic. The selection of the correct audio output can be done completely in software.

Of course you could use your original setup (the corrected version) and use 2 audio output pins from teh Arduino, where you activate only 1 audio output at a time and switch the active output between speakers. This will require
2 pins for audio
1 pin for switching.
That is 3 pins 4 speakers. But with 4 additional external transistors and resistors (1 for each speaker). In my opinion much more complex than simply using 4 separate audio pins.
 

codetale

Feb 26, 2023
9
Joined
Feb 26, 2023
Messages
9
You currently use 2 pins:
1 pin for audio
1 pin for selecting 1 out of 2 speakers
That is 2 pins, 2 speakers.
sry for late reply.

i mean will use 1 audio (left) + 1 pin switch => 2 speakers
then duplicate the setup to another audio (right) for another 2 speakers.
so total 4 speakers.
combined with mute left/right channel and the switch, should be no problem to control which speaker are "on"
That is 3 pins 4 speakers. But with 4 additional external transistors and resistors (1 for each speaker). In my opinion much more complex than simply using 4 separate audio pins.
i didn't found any sources mentioned able to do 4 channels audio, unless use audio shield.
can you please guide me?

thank you very much.
 
Top