Wow. Thanks for the schematic. What is the type of the NPN transistor on the far left? Is that another 2N4401?
Umm, dang, it isn't labeled, is it? Yes, I think it was 4401.
Is is possible to substitute 2N2907 and 2N2222 for the 2N4403 and 2N4401 transistors you have here? That and some higher voltage transistors (and 2N3904s) are all I have at the moment.
Yes, certainly. Though I don't know
why you'd want to..
2907 and 2222 are ancient, and along with 3055 and a handful of others, should be left to the historical dustbin; not that 3904 or 4401 are all that much better, but their spec sheets have some important lines that were missing from their predecessors.
3904/6 would be more suitable for the circuit, really, but give or take some difference in top speed, practically anything will do. Only the current mirrors and diff pair need to be somewhat matched (same type). Between those, ah, 6 groups, you can use almost whatever you want for each...
I guess I should build this up and look at it on the scope to learn how it works.
As you can see, that was a natural environment for it
BTW, the purpose of the circuit is not actually a function generator, per se. Though I would take another homebrew function generator, and enjoy learning about it. I have one old function Generator (F34) I got off eBay, which has pretty decent features for my purposes.
The end goal is to drive 10 transistors that ramp from 0-5V up and down continuously, but each one ~36 deg out of phase with the previous. They will drive some display devices to generate a continuous wave like pattern. My plan was to make an oscillator at ten times the frequency and then use a 4017 counter as a way to get ten phase shifts. This would be at the square wave level. Then I would convert those squares to triangles or finally sine waves (as well as mix a few different frequencies for a water ripple type effect) That is why I was starting with a square wave. In my research I did not find any great solutions for phase shifting signals in the 1 HZ or slower range.
It would be really easy to just drive them from a uC directly with PWM, or with a shift register and DACs. For some reason I thought it would be fun to try to do this analog. I obviously need further study.
Thanks.
Hmm, interesting. See, consider this -- if nothing else, you must have one "state" for each output (LED, or group of them, if you've got sets arranged in wavefronts or something), which means many oscillators, or phase shifters, or something like that.
That's not completely fair, because you can cheat if you're okay with a single phase shifted sine. You can build a quadrature oscillator, and use the I (in phase) and Q (out of phase) components to build a linear combination: 100% I + 0% Q = 0 degrees, the first LED; 80.9% I + 58.7% Q = 36 degrees, the second LED; and so on (simply cos and sin of the desired angle).
Or instead of a dual output oscillator, build one oscillator, and phase shift it. Which is fine at constant frequency -- just as using an integrator to triangle-ize a square wave is fine at constant frequency, but tricky if it needs to be variable. There are "all-pass" phase shift networks you can design and build, but they're finicky, and hard to make for a wide range. You might be better off with a second oscillator, running in lockstep via phase locked loop, but its response time won't be great, if the frequency needs to change quickly (as might be the case for a function generator).
By the way, you'll probably want not just a simple sine wave, but a biased sine wave (so the LED is some varying degree of on; minding that, strictly speaking, a sine goes positive and negative, see), and furthermore, it should probably be weighted for visual effect, not just linear but some function like squared or exponential, to match the eye's visual response. (Or, from another context: gamma correction.)
So, yes, doing this thoroughly analog might be quite involved: if you want DC drive to each LED, you need to replicate all the drive and correction hardware, and that's just to get a single undulation from one phase shifted oscillator. You need more oscillators and more linear combinations (well, at least that's easy -- just linear mixing with an op-amp) to get more complex patterns.
You're not completely screwed. If you don't mind the LEDs being, on average, dimmer (perhaps you turn up the drive current a bit past ratings to compensate), you can time-share one driver among N LEDs using a multiplexer. The sources need to be multiplexed, so that still doesn't help much, but the interesting part comes when you consider the signal source: a binary series of mixing resistors might be used, instead of the fixed phase angle resistors you'd use above. The exact count might be pulled from an EPROM, which is driven from an address counter doing the LED count. So each LED in turn is lit by its corresponding phase angle(s) as needed. Ah, of course, this is starting to look more and more digital...
Or you might go the other route and absorb another pair of functions together. Instead of applying gamma correction to the LED current, drive them all at full current, and pulse width modulate it with an exponential time delay: created simply by feeding an RC circuit from a pulse and sensing the threshold with a comparator. The RC circuit charges along an exponent, so the on-time is exponential against the threshold. Boom, instant gamma correction! This is a perfect combination with multiplexing, too, though you still need the thresholds to be computed with the phase angles thing.
Taking it from another direction, perhaps instead of a smooth "moving eye" (or Night Rider style) display, you meant the "ripples" more literally: an impulse starts on one location and propagates outward. You could use a chain of bandpass filtered amplifiers for this: down the chain, the frequency components are attenuated and propagated differently, leading to a fast "bloop" at the input side, leading to softer and more gradual ripples down the line. Now, this needs quite a lot of "state" components -- namely, resistors and capacitors, which remember what part of the wave they're on, essentially. But it has the potential to be the most general, just stack a bunch together and poke at it with a master oscillator.
Which is also interesting if you simply speed it up: at audio frequency, such a circuit will have a bell-like timbre to it! You can add feedback taps to represent reflections and (limited) reverberations; minding that true reverberations take hundreds or thousands of cycles worth of delay, and you'll only get, at best, N cycles worth, for N stages, so it won't really sound like reverb unless you get really carried away with it. But as a single toned instrument, it could be an interesting addition to a synth panel.
Tim