Driving a speaker with a Picaxe using 7.4V

westaust55

Moderator
Yes that will work.
I have done the same myself in the past with a 9V supply.

If the transistor Q2 is a NPN BJT type (as the symbol implies e.g. BC547) and not a FET type then there is no need for the 10 kOhm pulldown resistor R1 on the base of the transistor.
 

AllyCat

Senior Member
Hi,

I'm not sure it will work very well with a capacitor directly in series with the supply to the speaker/transistor. The capacitor will charge up to the supply rail and there is no path for it to discharge. Normally a second transistor would be used in a "push-pull" configuration, but a resistor between the supply and either terminal of the speaker might be good enough. The value will be a compromise between volume and power consumption (dissipation) but 100 ohms might be a starting point. Or just don't use (short out) the capacitor.

Cheers, Alan.
 

inglewoodpete

Senior Member
Perhaps you could clarify what you are aiming to do. Is the speaker a low impedance moving coil type (eg 8 to 35 ohms) or a piezo sounder? Is the output intended to make beep sounds? If so, what frequency range do you have in mind? Is the idea to use 7.4v to increase the volume? Is size or weight important (Ie minimise component count or choice of 'speaker')?

I apologise for all the questions but AllyCat has a valid point. Once C3 has charged up after just a few pulse cycles, you will get very little sound from the speaker until the capacitor self-discharges (several hours) or the power source is disconnected and C3 discharges through the voltage regulator.
 
Last edited:

premelec

Senior Member
I agree with the comments above and note the transistor won't even conduct till its Vbe is reached so there will be a lot of distortion - usual solution is to bias the transistor slightly on with a resistor to V+ and then feed that bias circuit through a capacitor. If you are just trying to make a loud noise not too critical... and if very low current is required the bias current may not suit you...
 

afb

Member
I'm with AllyCat - I drive speakers directly to the rail with a power MOSFET - *but* a warning if you are using the 'sound' command - I use it with arguments in the 128-255 range for an engine sound simulator and following execution some arguments leave the PICAXE output HIGH so a large standing current in the speaker could result - thus I always set the output LOW following use of a 'sound' command. I haven't explored what happens with arguments 0-127.
 

westaust55

Moderator
The concept of a capacitor in series with the speaker comes from PICAXE manual 3 page 11
http://www.picaxe.com/docs/picaxe_manual3.pdf

As well as blocking DC it is in effect becomes a high pass filter attenuating lower frequencies.
If one wishes to determine the cut off frequency then one needs to know the speaker parameters and then determine the capacitor value to suit.
 

inglewoodpete

Senior Member
The concept of a capacitor in series with the speaker comes from PICAXE manual 3 page 11
http://www.picaxe.com/docs/picaxe_manual3.pdf

As well as blocking DC it is in effect becomes a high pass filter attenuating lower frequencies.
If one wishes to determine the cut off frequency then one needs to know the speaker parameters and then determine the capacitor value to suit.
The speaker circuit in Manual 3 connects to the (differential) complementary pair (push/pull) output of a PICAXE (PIC). You are correct in describing it as a high pass filter in that circumstance.

The circuit described above does not provide a discharge path for the capacitor, without disconnecting the power source.
 
Last edited:

Circuit

Senior Member
The speaker circuit in Manual 3 connects to the differential pair (push/pull) output of a PICAXE (PIC). You are correct in describing it as a high pass filter in that circumstance.

The circuit described above does not provide a discharge path for the capacitor, without disconnecting the power source.
I fail to understand; the diagram on page 11 of Manual 3 shows a loudspeaker wired between Pin1 and 0v. How is this a differential pair? More importantly, how could two pins be used in a speaker circuit to create a differential pair? I guess that it can be done, but would one not have to use pwm outputs in a matched pair?
 

rq3

Senior Member
I am trying to drive a speaker with the output of a Picaxe. I would prefer to use 7.4V and would appreciate commens and/or suggestions regarding the attached schematic.

View attachment 22267
More information on the application would help. A Picaxe pin will safely drive a 20 ohm speaker directly when coupled through a capacitor. The 20 ohm speaker could come from a cheap headset, like the ones they give you on an airline flight.

It will be quite audible under room conditions, and painfully loud if held to your ear.

Information as to the audio bandwidth and loudness you require would help.

No matter what you do with supply voltages and transistors, you're not going to get terrific fidelity.
 

inglewoodpete

Senior Member
I fail to understand; the diagram on page 11 of Manual 3 shows a loudspeaker wired between Pin1 and 0v. How is this a differential pair? More importantly, how could two pins be used in a speaker circuit to create a differential pair? I guess that it can be done, but would one not have to use pwm outputs in a matched pair?
Sorry, I used the wrong term - I should have said complementary pair (I blame myself for posting late at night:)). The output of the PIC is a complementary pair of MOSFETs. One (P-channel) would charge the capacitor by taking the output pin high and the other (N-channel) would discharge the capacitor when the output pin is low.
 
Top