Maker Pro
Maker Pro

Working on a 3-voice 40106 oscillator. Need help...

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
I’ve got each oscillator feeding one into the next with a diode and resistor in between each. (The schematics below recommend 1Ks.) But, there doesn’t seem to be agreement out there on which way to hook up the diodes.

The last schematic here shows the cathode going towards the second oscillator:

The third schematic here shows the cathode going towards the first oscillator:

I’ve constructed a little keyboard with multiple trimpots in the circuit of the third oscillator and am trying to figure out why my harmonically-strange higher pitched notes are so much lower in volume than lower pitched notes.

Are those diodes (and/or the 1K resistors) really necessary between the oscillators? I’m wondering if the slight voltage drop across each one is causing my voltage issue.

Thanks for any and all help!
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
Since the signals are all logic level there should be no difference in actual amplitude between them - other than your own ears ability to hear lower frequencies better than you do the higher frequencies.
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
THANKS to both of you. But, I’m still wondering about the absolute necessity of the diodes between oscillators and which way they should be wired, if they are needed.
 
Last edited:

bertus

Moderator
Nov 8, 2019
3,303
Joined
Nov 8, 2019
Messages
3,303
Hello,

The diode is probably there to avoid current going back into the left oscillator.
You might also be interested in the following page:

Bertus
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
I emailed bbob Drake at fluxmonkey.com and he kindly sent this reply:
———
oh gosh, i am so sorry... that page has been up there for years, and no one has noticed my error! you are correct, the cathode (banded end) of the diode should be connected to the second oscillator, or the output. I will get that fixed later today.

diodes are like one-way streets: they let current flow in one direction, but not the other. think of the schematic symbol as an arrow, indicating the direction of current flow... so in http://fluxmonkey.com/electronoize/40106Oscillator_files/image014.gif, my intention was to have the left-hand oscillator's output flow towards the right-hand oscillator, modulating it. that's what the hackaday version does. i think if you build it according to my schematic, it'll still make sound (which may be why nobody's caught it before), but probably at a different volume level or something.

the idea with the mixer circuit is, to try to keep the output of one oscillator from flowing backwards into the other oscillators and influencing them. with the diodes, 3 one-way streets all converge at one intersection and then go out; with resistors, the input of your amplifier probably has lower resistance than the mixing resistors, and the signals flow towards the path of least resistance. you can use either approach, they will sound different, diodes probably provide more isolation.

the oscillators put out a very strong signal, much more than the 1.2v that a line-level in is expecting, so you can afford some voltage drop with whatever mixer you use. not sure about different levels for different notes... maybe try them one at a time so see if the levels are uneven prior to mixing.

i think i did a better job of documenting all this on my later PCB board pages, http://fluxmonkey.com/pcbDocs/40106Oscillators.htm, and http://fluxmonkey.com/pcbDocs/40106_files/Flxmnky_40106HexOscillator.pdf, maybe take a browse there. at least, it looks like i didn't make the same mistake with that schematic!
——-
Perhaps that will help others working with 40106 circuits. A schematic error. It’s not the first time I’ve had problems sorting out, for instance, circuit board layouts or build documents and schematics that didn’t agree with each other. What a joy when you find reference material in easy-to-understand plain English, with well-drawn schematics, everything matching and nothing left to guess about. Or authors like Mr. Drake, above, who quickly reply to queries. Maybe I’ll ask the question here later that I never got answered at Hackaday.com, re: a chip featured in one of their Sweet Logic articles that I have NEVER figured out how to work with. Onward! —Explorer
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
Since the signals are all logic level there should be no difference in actual amplitude between them - other than your own ears ability to hear lower frequencies better than you do the higher frequencies.
I should’ve asked this earlier, and I’m sure it will be a very stupid question, but, kellys_eye, what do you mean by “logic level”?

And, I don’t think it’s a problem with my ears. Once again, my Schmitt Trigger Inverter oscillators are cascaded, one into the next, with a little keyboard across the last oscillator (several trim pots, instead of just one). As I go up the scale that I am trying to tune, the volume decreases. Higher pitch, lower volume. My highest note is a measly little squeak.

Is there any way I might solve the problem with such a circuit? I was just looking at the CMOS Cookbook, and it strikes me that my circuit is a little bit like a ring oscillator without the feedback loop, and with ROs, you are only supposed to use an odd number of oscillators. My circuit has 4 oscillators. Could that be the problem?

I know, I need to go back to the breadboard. But, I’m just looking for a place to start.

Thanks!
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
what do you mean by “logic level”?
Logic IC's will only have two states - logic 0 and logic 1. In standard TTL logic this will be 0V (near enough) and 5V (near enough) respectively. In CMOS circuits it will be 0V and whatever the supply rail voltage is. In other words there is no difference in level (amplitude) regardless of the frequency being produced - more so in a Schmitt trigger device like the 40106, these devices 'force' the high/low levels.

What you may be getting is an increased frequency but a NARROWER pulse - what you need to ensure is that the duty cycle of the signal remains constant i.e. the on-time and off-time are equal. If you listen to a squarewave and vary its duty cycle you will hear a loss of 'energy' as the ratio moves away from 50% on/off although the frequency remains the same.

Please Google the bold words to learn more about logic levels and duty cycles.
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
As I go up the scale that I am trying to tune, the volume decreases. Higher pitch, lower volume. My highest note is a measly little squeak.
What are you using to listen to the oscillator output?
Amp/preamp details?
What age group are you in? Youth, young adult, middle age, senior citizen?
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
I’m listening via a little munchkin homemade LM386 amp. I’m a senior, 65. Female. I’ve been able to read a circuit diagram since I was about 8. Have built many things over the years, sometimes successfully, sometimes not. But, I never really learned anything about electronics. Last winter, after watching a video based on lookmumnocomputer’s “simplest oscillator” project, I started experimenting with several circuits, trying to create something droney and high-pitched that sounds like bagpipes, and am finally learning little bits. But, I’m a visual artist with zero brain for math. So, it’s tough. When I try to read about how various components work, the explanation usually goes miles over my head.

Anyway, I was just playing with a strip of VHS tape as a variable resistor and got better, more even, sound than I’m getting from the little keyboard that I built. I have seven Allen & Bradley 100K multi-turn trim pots in that, with 2 smaller 50K trim pots at the high end of the keyboard. I’m thinking I should try removing those and replacing them with 2 more A&Bs, and see what happens. Maybe those 2 little 50K pots are crap!

Everybody likes the aesthetics of my build, however:

A8537539-50E6-49CC-BE58-93DAD00A6108.jpeg
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
I’m a senior, 65. Female.
In that age range, presbycusis (age-related hearing loss) is very common. People can be unaware that they are affected by it, but it may be part of the reason your higher frequencies seem quieter. Above ~1kHz, apparent loudness drops off surprisingly rapidly with frequency.
1670331425957.png
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
In that age range, presbycusis (age-related hearing loss) is very common. People can be unaware that they are affected by it, but it may be part of the reason your higher frequencies seem quieter. Above ~1kHz, apparent loudness drops off surprisingly rapidly with frequency.
View attachment 57222
No, I disconnected my keyboard last night and wired up a pot to the circuit last night. I’ve concluded that I’m expecting too much from this type of circuit (cascaded 40106 oscillators). There seem to be definite frequency limitations. At a resistance of about 14K, the circuit does a couple of dying squeaks and then just cuts out. Unless hours of time with the pots in the first 3 oscillators might eventually produce a different range across my keyboard... But, I doubt it, at this point.

I’ve devised a pretty decent crystal-controlled, mixed dual-frequency drones circuit. I’m going to try a couple more things with this circuit and then I might start over with Dino Segovis’s Sqonkbox-55 circuit for the chanter side.

It seems weird. This is the second time that I thought I had something that worked pretty well on breadboard and which has totally disappointed me when I got it all soldered up. I would think things would work better once all the connections are rock-solid. I spent a lot of time with lookmumnocomputer’s single transistor relaxation oscillator circuits ... and that experiment is currently waiting to be entirely desoldered. Once again, I got the drones half of the circuit sounding pretty good, but couldn’t get any nice high-pitched sounds on the chanter side. I ended up putting transistor sockets on that board and swapped out transistors and caps endlessly, and finally gave up. And I’m going for a bagpipe sound, something a little bit screechy, definitely not flute-like. Maybe it’s a sound that cannot be reproduced electronically!
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
There seem to be definite frequency limitations. At a resistance of about 14K, the circuit does a couple of dying squeaks and then just cuts out.
Perhaps there's a wiring error somewhere.
I've simulated the '40106 single oscillator with LTspice, which shows it should operate all the way up to ~1MHz.
I ran the sim with a 100nF cap and resistor values of 12k, 6k and 3k in turn, giving fequencies of 1.27kHz, 2.48kHz and 4.48kHz respectively. I saved the sim result as a .wav file so that you can hear the generated sound, consisting of 2-second bursts of each tone. These are all exactly the same amplitude (you can check on a 'scope or with Audacity), so if you hear otherwise then your problem with perceived amplitude reduction with frequency lies in your audio setup or hearing: not in the oscillator.
The .wav file is attached. Delete the .txt file extension to play the file.
 

Attachments

  • output.wav.txt
    516.8 KB · Views: 5

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
Hey, THANKS, Alec_t!

But, correct me if I'm wrong, you only simulated one oscillator? I'm trying to get a more complex sound. I'm trying to get a bagpipe-ish sound, kind of nasal and buzzy. Odd harmonics... My sister calls it the sound of a cat being tortured. Hence, the four oscillators, which might behave differently than your simulation of a single oscillator.

I spent A LOT of time on breadboard. (I'm going to attach what I finally soldered up below.) I have bags of 'Greenie' caps and spent a lot of time swapping caps in and out. I even had a chain of diodes on the board, in series with the input voltage, and played around with connecting up the rest of my circuit in various places in the diode chain, discovering that the sound changed every time that the input voltage changed. Although, I don't know that I actually got down into a 'voltage starve' place, which I probably didn't know anything about, at the time. And, while most circuits recommend a 1K resistor and a diode between oscillators, I assume that I put in two 10K resistors because it did something for the sound of the circuit that I preferred. But, one of the first things I was planning to try when I fire up the heat in my electronics playroom and plug in my desoldering iron was to switch those back to 1Ks.

I think I'll probably need to go back to the breadboard, however.

But, another question: If I want to go back to playing with 'voltage starve' with my circuit (below), or with another CMOS circuit, fluxmonkey and beavisaudio offer two different ways to do it with a low-resistance pot—wired as a variable resistor (Beavis) and wired as a voltage divider (fluxmonkey). Would anyone like to weigh in on which way they think would be better?

I was also thinking a box with a big rotary switch and diodes wired between all the switch lugs might be a useful thing...

And yes, although it's not shown below, I do have pin 7 wired to ground.


40106 Schematic.jpg
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
you only simulated one oscillator?
Yes. Just to demonstrate that the oscillator output amplitude is virtually constant with change in frequency.
Did you play the wav file? If so, did you hear any change in amplitude as the tone changed?
Hence, the four oscillators, which might behave differently than your simulation of a single oscillator.
There is bound to be a change in the overall pulse train, because the oscillators are being gated on and off.
I'll simulate your chanter circuit and post the resulting wav file.
wired as a variable resistor (Beavis) and wired as a voltage divider
The CD40106 output stage has an internal resistance of ~300Ω (IIRC), so any variable resistor connected to it will inherently form a potential divider anyway.
 
Last edited:

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Here's the Chanter (post #16 circuit) sim result .wav files (delete the .txt extensions). The Sample Key resistance was 100k for the first 2 seconds and 20k for the following 2 seconds.
Chanter.wav is for the square wave output from the final oscillator of the circuit: Chanter2.wav is for the output taken across the timing cap of that oscillator. Both give pretty harsh sounds because of all the gating going on. I think you need to eliminate the gating if you want a drone-like sound.
 

Attachments

  • chanter.wav.txt
    344.6 KB · Views: 1
  • chanter2.wav.txt
    316.8 KB · Views: 1

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
Alec_t, Just wanted to let you know I’ve been out all day today and will listen to your first file again tomorrow, as well as these 2 new files. I don’t think that I noticed a change of amplitude with the first file though. And FYI: I have no idea what “gating” means. Thanks for your time on this!!!
 

Explorer

Mar 28, 2014
102
Joined
Mar 28, 2014
Messages
102
Alec_t, I'm back!

(I'm also working with an old iPad, a very old iMac, and a sometimes unreliable rural wireless Wifi connection.)

Re: your first file: I do hear an amplitude shift on the middle tone. I.e, that one sounds lower in volume to me than the other two. But, the highest tone sounds quite loud and audible.
----
"The CD40106 output stage has an internal resistance of ~300Ω (IIRC), so any variable resistor connected to it will inherently form a potential divider anyway."

I assume that you're saying that it doesn't matter which way I wire up a pot to the voltage input to play with 'voltage starve.' Am I correct?
----
Re: your 2nd and 3rd files: I like the sound of the 3rd file. But, I'd need to see a redraw of that part of my schematic to understand how you produced it. I'm SO visual! I'm always telling people to draw me a diagram to help me understand stuff. I'm pretty good with schematics, if they're drawn well—at least in terms of what connects to what.

Also, did you plug in the resistance values that I have in my schematic above the first 3 oscillator pots? Because I've probably played with retuning the whole thing about 8 times. And that involves adjusting 12 pots. A nightmare of experimentation! (That's another reason why I should see if the Sqonkbox circuit would work better for me)

THANKS, if you've got some more time!
 
Top