Headphones to loudspeaker - Volume?

Denzel

Senior Member
I am in the middle of adding an alert to my current project, that is, a simple loud three tone beep when a trigger occurs.
I have a small 8ohm speaker set up connected to stereo headhone jack pins so that if there are no headphones connected, the sound signal will goto the speakers, if there are headphones connected, the headphones will work and not the speaker. I managed this by using a stereo jack that has swtches built in that disconnect when a stereo plug is plugged in...

The problem I have is..

Using the code 'sound 5 (100, 20, 150, 20, 110, 30)
I get a relatively small volume through the 8 ohm speaker, and when I connect the headphones, they are extremely loud! I added a 4k7 resistor between the picaxe sound signal and the headphone jack (and speaker) and this brought the volume of the headphones down to a comfortable volume however nothing can be heard by the speaker when headphones aren't connected.

Is there any way I can level out the volume without using two pins for the two different sound outputs?

Lower/ higher impedance speakers? a 5k log pot perhaps? so user adjusts headphone / speaker volume?
 

boriz

Senior Member
You’ll need an amplifier to drive the 8ohm speaker. Think of it like this. The Picaxe can supply about 20mA max on one of its outputs. At 5v, that’s about 100mW into 250ohms maximum.

To drive an 8ohm load at 5v would require 625mA, over 3 watts!

Look at using an LM386N. It’s basically an op-amp that can output about 1 watt into 8 ohms. The datasheet should give you the minimum circuit.
 
Last edited:

Denzel

Senior Member
Cheers,

Im not really too worried about the level of volume its putting out without any resistors, its satsfactory for its use however if I used a 4k7 resistor to make the headphone volume lower than run that through an OP-Amp it would be perfect.
as in the diagram: (where +switch sends sound signal straight to ground when headphones are plugged in)

Picaxe sound signal -> Headphone jack (+switch) -> Op amp -> speaker -> ground
 

moxhamj

New Member
Re "Lower/ higher impedance speakers?"

You are kind of stuck there. Headphone speakers tend to be 32 ohms and real speakers are 8 ohms. There was such a thing as a "crystal earpiece" that was designed for crystal sets and because these had no amplifier, the earpiece had to have a very high resistance. Not sure if you can still get them.

Then you could look at piezo transducers.

Personally, I'd use Boriz's suggestion. Speaker amps like the 386 are "bread and butter" electronics and once you use these chips once you will find you will use them over and over.
 

Dippy

Moderator
The ic amp (as suggested by Boriz) will give the better quality signal.

But, if you are a 'back to basics' person you could look at transistors (one or more..) between jack socket and speaker.
This the basic connections of many audio devices for the last X years.

If you wish the discrete approach then look at this to start with... (but note; the internet will be loaded with zillions of options).
http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/experiment/lab/expt5/page1.html

Chips will give better out 'of the box' results - but if you wish to learn then consider breadboarding some transistor designs.
 

BeanieBots

Moderator
Denzel, it should be possible to wire the socket contacts such that the speaker makes a direct connection but the headphones are via a resistor.

It would depend on your actual socket but I've seen it done with 1/4" stereo sockets so I know it's possible.
 

manuka

Senior Member
If it's just an alert that's needed (rather than an orchestral interlude), surely a small piezo will do fine?! These directly drive from a PICAXE pin & produce ear splitting tones, although at higher freq overtones of the true SOUND tones. Even look at a suitable acoustic resonator - small film can etc.

Given the coin shop cheapness of 32 Ohm headphones consider just butchering one for it's earpiece. A small series electro. cap (~10µF) blocks DC nicely - details in PICAXE manuals. Even with my weary ears I have no trouble hearing PICAXE sounds from any normal source!
 

Denzel

Senior Member
cheers

I will go with the amplifier approach, at least then my speaker will definately be heard and I have more control over volume. I have used the LM386 a few times so it shouldn't be a problem..
Thanks
 
Top