CD4011 Oscillator Fed to Transistor Audio Amplifier; Volume Control Issue

Thread Starter

brockrwood

Joined Oct 23, 2016
47
I built an audio frequency square wave oscillator using 3 gates on a CD4011 quad NAND gate IC. I then fed the output of the oscillator (pin 11) to a very basic "push-pull" transistor amplifier on the same breadboard. The output of the amplifier was then fed to a 2" speaker. The 9 volts of power to the circuit is from a regulated, work bench power supply.

Here is the schematic:

the_cd4011_to_transistor_amp_schematic.jpg

The circuit actually works pretty well. I measured the square wave out and it is about 8 volts peak to peak.

The sound from the speaker can be made fairly loud.

The 100K potentiometer, VR1, configured as a variable resistor, is used to vary the frequency out. I find I get a range of about 100 Hz to about 2,000 Hz.

The other potentiometer, P1, a 10K pot, is used on the input of the audio amplifier as a volume control.

Here is my problem: With an input signal of 8 volts, peak to peak, being fed to the amplifier, the sound is annoyingly loud. Hence the addition of the 10K pot on the input to the amplifier. The problem is that, with a 10K pot on the amplifier's input, only the very end of the travel of the wiper of the pot actually changes the volume. For most of the travel of the pot, the volume remains very loud. If I use a smaller value pot, the pot, itself, changes the output frequency of the oscillator. I guess this is because the small value pot is a like a "load" on the output of the CD4011 (pin 11)?

Is there a way to wire a pot, or another sort of volume control, so that the entire rotation of the pot's shaft affects the volume?

I wish I could measure or calculate the input impedance of the audio amplifier. Is there a way to do that?
 

ScottWang

Joined Aug 23, 2012
6,892
You can try to use to the circuit below to replace the P1(10k), you still can use the 10K to try, unless the values is too high, try to use 10K, 5K, 1K, 500Ω, the Q1 that you can use as 2N3906 they are the small signal PNP transistors.

Pulse Amplifier Using PNP Bjt_ScottWang.png
 

Yaakov

Joined Jan 27, 2019
1,612
You might try an audio taper potentiometer. Unlike the linear versions, the resistor is deigned to deal with the fact that human ear response is not linear.

I am not sure the curve will solve your problem, but take a look at them.
 

AnalogKid

Joined Aug 1, 2013
8,439
First - a schematic diagram is *not* a wiring diagram. It is a statement of the design intent and of signal flow. It's is intended to show energy relationships, not physical geography. If you re-draw your schematic of the oscillator to show the signals progressing through the individual gates rather than the package, the circuit will be much easier for others to interpret and evaluate. Example (but do not dot crossing wires; stagger them so only 3 wires connect at any one point):



OK, I feel much better now.

Next, the problem - Q1 is a gain stage. Part of the volume control range problem is the taper of the pot, but a lot of it is that the amplifier is saturated until the input is reduced considerably. Two fixes; use one or both. a, put a resistor in series with the input to the pot. If you put 10K in series with a 10K pot, the pot's output can never exceed 50% of the oscillator output. Pick a resistor that gives you the range you want. b, put a resistor in parallel with the wiper of the pot to GND (left side of C5 to GND). This will change the attenuation curve of the pot to one that is pseudo-logarithmic. Poor-man's audio taper, volume will appear to increase linearly with rotation.

You are taking the oscillator circuit output from an active node within the oscillator itself, and as you have observed this can be a problem. Use the 4th NAND gate as an output buffer to isolate the capacitor charging current from the amplifier driving current.

ak
 

Thread Starter

brockrwood

Joined Oct 23, 2016
47
*** Update of March 24, 2019 ***

Thanks for the helpful answers!

Here is the new version of the circuit schematic that shows the improvements to the circuit:

CD4011_oscillator_n_amp_updated_02_fixed_for_upload_to_aac.jpg

The improvements are:

1) The schematic is now drawn with the CD4011 shown conceptually as 4 NAND gates rather than as a physical 14 pin DIP.

2) The the fourth gate of the CD4011 IC, (inputs on pins 8 and 9, and output on pin 10), is now used as a "buffer" to isolate the oscillator, itself (the other three gates on the IC), from the amplifier that the square wave output of the osillator (pin 10) is fed to.

3) R3 has been increased from 27K to 390K. This helps keep the amplifier from being overloaded by the oscillator's output.

4) The volume control pot, P1, has been reduced to 1K.

I will continue to play with the circuit, but it is a lot more functional now thanks to the helpful advice in this forum!

(NOTE: The original schematic contained two errors. First, VR1, the 100K pot, was in the wrong place. It should have been swapped with R1. Second, R1 had the wrong value. It should have been 180K, not 18K. I have replaced the original schematic with a corrected schematic.)
 
Last edited:

Thread Starter

brockrwood

Joined Oct 23, 2016
47
*** Update Number 2 of March 24, 2019 ***

OK, here is an even better version of the circuit. See the new schematic:

CD4011_oscillator_n_amp_updated_03_fixed_for_upload_to_aac.jpg

Per the suggestion of AnalogKid, I added R7 in series with the potentiometer (P1) volume control. In addition, I changed the value of R3 to 100K instead of 390K. Finally, I changed the pot back to a 10K pot instead of a 1K pot.

Adding the resistor in series with the pot lets me dramatically reduce the maximum voltage that the pot (used as a voltage divider) will send to the amplifier. This lets me use more of the rotation of the shaft of the pot so it seems more like a real "volume control".

I found that the maximum total volume possible was too low using the 390K resistor for R3. It was too loud using a 27K resistor for R3. Using a 100K resistor is about right.

So, in effect, I am using R3 to set the maximum volume level to something that is loud but not annoying. I am using the pot, P1, and the series resistor, R7, to force the pot to use most (about 75 percent) of its travel before reaching that maximum volume level.

Gracias to everyone! Any ideas on how to further improve the circuit are welcomed!

(NOTE: The original schematic contained two errors. First, VR1, the 100K pot, was in the wrong place. It should have been swapped with R1. Second, R1 had the wrong value. It should have been 180K, not 18K. I have replaced the original schematic with a new schematic with the errors corrected.)
 
Last edited:

AnalogKid

Joined Aug 1, 2013
8,439
I don't know where you got the oscillator design idea, but check out National Semiconductor's AN118 for the math behind it.

You probably can fiddle around with R4 and R5 to reduce power drain on the battery, but overall it looks ok. Speaking of looks, engaging lecture mode ...

Here is a re-draw of your oscillator section. Note some things.

Osc-Demo.gif

Signal flow is strongly left-to-right.

Reference designators for single chip parts that have multiple internal sections (gates in your case) have a common base for the device and sub-letters for the sections.

Personally, I think all resistive devices, including pots, should be referenced with an R. I still see VR in professional schematics, but its use is fading. P is most commonly used for "Plug" designation, and should not be used for "Pot".

R4 (your P1) is rotated to show that it is an attenuator to GND; again, signal flow... Same for R3 (your R7). This arrangement shows that the signal drives a series resistor attenuator string to GND, with a variable pick-off point. It looks like what the circuit is.

I added a connection to R2. It generally is bad practice to leave one end of a pot floating. If the wiper bounces off of the resistive element or there is some insulating contamination, the wiper node impedance shoots to infinity. Depending on what it is supposed to be doing, this can be bad. Tying the wiper to one end does not affect normal operation or circuit calculations in any way, and prevents a possible problem down the road.

No crossed, connected lines - this goes back to the days of faxing, poor quality Xeroxes, etc. A spec of dirt on the copier glass turns unconnected nets into a serious error. Belt and suspenders - no 4-way nets, and connection dots. Some schematic packages (like the one on StackEx) have gone back to the half-circle humps to show crossing, non-connected nets. Y.U.K. My opinion is to go ahead and cross them with straight lines, and let obvious connection dots in other places make clear that crossed lines are not connected.

Note - I have no idea what your background / training / experience base is, so if you already know about any of this, just ignore me. I'm used to it.

UPDATE: Corrected schematic.

ak
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,249
I simulated your original amplifier and found your 390k resistor caused severe clipping at the bottom. So I increased its value to 680k to make the clipping balanced at top and bottom.
The output power when clipping a little is only 0.1W.
It would work better if it has bootstrapping for my resistor R3 (the 2.2k).
The crossover distortion would be eliminated with a small value resistor in series with the diodes.
The 1k resistor limits the output power.
 

Attachments

Alec_t

Joined Sep 17, 2013
11,268
I'm puzzled by the post #7 circuit. Shouldn't R1 and R2 be interchanged if R2 is supposed to be a frequency control?
 

AnalogKid

Joined Aug 1, 2013
8,439
All I did was redraw his design. BUT, the referenced app note indicates that both resistors can be used to vary the frequency. Both R1 and R2 are in the long-form frequency equation.

For both this circuit and the two-inverter version, I've always made R1 the variable.

ak
 

Attachments

Audioguru

Joined Dec 20, 2007
11,249
I have always made a Cmos oscillator with only two inverters, two resistors and one capacitor.
I agree that the schematic in figure 7 is completely wrong.
I have never made the three inverters oscillator in the app note.
 

Attachments

Thread Starter

brockrwood

Joined Oct 23, 2016
47
I don't know where you got the oscillator design idea, but check out National Semiconductor's AN118 for the math behind it.

You probably can fiddle around with R4 and R5 to reduce power drain on the battery, but overall it looks ok. Speaking of looks, engaging lecture mode ...

Here is a re-draw of your oscillator section. Note some things.

View attachment 173234

Signal flow is strongly left-to-right.

Reference designators for single chip parts that have multiple internal sections (gates in your case) have a common base for the device and sub-letters for the sections.

Personally, I think all resistive devices, including pots, should be referenced with an R. I still see VR in professional schematics, but its use is fading. P is most commonly used for "Plug" designation, and should not be used for "Pot".

R4 (your P1) is rotated to show that it is an attenuator to GND; again, signal flow... Same for R3 (your R7). This arrangement shows that the signal drives a series resistor attenuator string to GND, with a variable pick-off point. It looks like what the circuit is.

I added a connection to R2. It generally is bad practice to leave one end of a pot floating. If the wiper bounces off of the resistive element or there is some insulating contamination, the wiper node impedance shoots to infinity. Depending on what it is supposed to be doing, this can be bad. Tying the wiper to one end does not affect normal operation or circuit calculations in any way, and prevents a possible problem down the road.

No crossed, connected lines - this goes back to the days of faxing, poor quality Xeroxes, etc. A spec of dirt on the copier glass turns unconnected nets into a serious error. Belt and suspenders - no 4-way nets, and connection dots. Some schematic packages (like the one on StackEx) have gone back to the half-circle humps to show crossing, non-connected nets. Y.U.K. My opinion is to go ahead and cross them with straight lines, and let obvious connection dots in other places make clear that crossed lines are not connected.

Note - I have no idea what your background / training / experience base is, so if you already know about any of this, just ignore me. I'm used to it.

ak
My background/training:
I earned a B.A. in Philosophy in college. I have no formal training in electronics or engineering. I am an avid electronics hobbyist and life-long learner. I master electronics concepts and sometimes the required mathematics on a project-by-project basis as I build circuits and have fun. I was inspired to start building electronic circuits by Forrest Mims' "Getting Started in Electronics" and "Engineers Mini Notebooks" that I bought at Radio Shack in the early to mid 1980's. I am writing a textbook for a weekend workshop on hobby electronics that I want to teach. I scour the internet, including forums such as this one, for tutorials and circuit ideas. I have amassed a collection of hobby electronics books that I use as reference tools.

Where I got the oscillator design idea:
I got the idea at this website: https://www.electronics-tutorials.ws/waveforms/generators.html

The simple class AB transistor amplifier I cobbled together from several sources, this one being the most important:
https://web.archive.org/web/20180815215057/http://www.ke3ij.com/amp.htm

Thank you for donating your time and expertise to help me! I really appreciate it and I have no desire at all to ignore you! I believe in learning about what I am passionate about and then passing that on to others who are also passionate about it.

What application or website did you use to draw the circuit in post number 7? I like the look. Clean. Clear. Not fussy. Thanks in advance!
 

AnalogKid

Joined Aug 1, 2013
8,439
This is the oscillator schematic copied from the site you linked.

OSC-3-Gate.gif

Note that only R1 is in the short-form equation for output frequency. Any particular reason you chose to make R2 the variable?

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
8,439
What application or website did you use to draw the circuit in post number 7?
It is an old, expensive pro package. Look into Eagle. It is free and gets good reviews on the forums. Note that becoming fluent in a CAD package (defined as faster than hand-drawing) takes time and patience. All schematic packages come with some form of standard library of parts, and none of them are exactly what you need. Library management is key to productivity.

Back in the day, you learned how to draw a good schematic by looking at lots of good schematics, the ones in service manuals from large companies (with rigid in-house drafting rules). Nowadays there is a *lot* of horrible junk on the innergoogles, and it is slowly corrupting the standards for what is an acceptable drawing. Resist! You already have three gold stars: signal flow from left to right, power flow from top to bottom, and all of your grounds point down. Sadly, that is worth pointing out and reinforcing.

ak
 

djsfantasi

Joined Apr 11, 2010
6,407
At the rightmost node(s), draw a box, circle or arrow and label it. Drop down on the page, insert the label(s) (in a box, circle or arrow) and continue the circuit as above. Or continue, with label(s), on a separate page.
 

AnalogKid

Joined Aug 1, 2013
8,439
What do I do when I get to right side of my graph paper and I still have more signal flow to show? Do I draw a wire all the way to the left side and begin again showing signal flow from left to right?
Depends on where and why. I like to fill a page (without overcrowding), but some companies have rules about when to jump to another page. If clarity, convenience are important, and if you want a total stranger to be able to figure out your design in the shortest possible time (like doing field maintenance on military equipment), then do not zig-zag around one large sheet. OTOH, if you are a Japanese VCR manufacturer in the 80's, cram everything onto one big sheet; an extra two or three hundred thousand sheets of paper (per *month*) costs money.

ak
 
Top