EEVblog® Electronics Community Forum

Electronics => Beginners => Topic started by: AlexRG on August 10, 2026, 05:02:29 pm

Title: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 10, 2026, 05:02:29 pm
Hello everyone. Creating a triangular signal generator using an operational amplifier, or a comparator, or a flip‑flop is quite simple. But is it possible to make it using only transistors? For example, BC556 or BC546?

If possible, please draw the circuit; preferably, it should be possible to simulate it in Multisim.

Here are the parameters needed (see the picture):
1. Signal frequency: 80–90 kHz, accuracy is not important.
2. The triangle amplitude is 1V (a deviation of up to 5–10% is allowed).
3. The triangle signal must have a constant offset of +2.5V.
4. The circuit must be powered by +5V.
5. As I already said — no chips, only transistors.
6. If possible, the edges of the triangle should be as linear (straight) as possible.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: themadhippy on August 10, 2026, 05:18:50 pm
course ya can,after all whats inside an op amp a comparator, or a flip‑flop
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 10, 2026, 07:29:46 pm
It absolutely is possible, yes.

Here's an example, from when I was on another forum years ago. We went back and forth with several iterations trying to get a decent-looking triangle wave; this one was pretty good:

[attachimg=1]

[attach=2]

LTspice file attached so you can run the simulation.

I'm still thinking of implementing something like this for a homebrew class D amplifier, which needs a very accurate triangle wave for low distortion.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: ledtester on August 10, 2026, 07:34:23 pm
based on the comments by "crb3" in this reddit thread:

https://www.reddit.com/r/AskElectronics/comments/1qqcczg/generate_a_triangle_wave_of_a_controllable/ (https://www.reddit.com/r/AskElectronics/comments/1qqcczg/generate_a_triangle_wave_of_a_controllable/)

I found the schematic for the Moog 901. See the attachment below.

It uses a unijunction transistor to create a sawtooth wave and from that a triangular wave but there are other ways of creating a sawtooth with BJTs.


Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 10, 2026, 08:24:20 pm
Here's another iteration from that same session.
Single supply instead of split; has its own multivibrator for square-wave generation.
Triangle generator is the six transistors on the right.
It uses two current mirrors to create the up- and down-ramps.

[attachimg=1]

[attach=2]
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PGPG on August 10, 2026, 09:37:10 pm
But is it possible to make it using only transistors? For example, BC556 or BC546?

The first problems to solve are how to get resistors and capacitors using only transistors.
Do Miller effect can be used to get enough big capacitance?
May be such capacitance can be connected between collector and base of second transistor to multiply it.
To get something replacing resistances germanium transistors could be better thanks to their higher Ic0 currents, I think.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 10, 2026, 10:25:51 pm
Here's another iteration from that same session.
Single supply instead of split; has its own multivibrator for square-wave generation.
Triangle generator is the six transistors on the right.
It uses two current mirrors to create the up- and down-ramps.


Thank you for the circuit. Now let’s try to optimize it for my task. I assembled the circuit in Multisim, it worked, and here are the parameters:

1. The signal frequency is 237 Hz, but I need 80–90 kHz, preferably 80 kHz.
2. The amplitude of the triangle is 422 mV, but I need 1000 mV (1 V).
3. The offset is +4.06V, but I need +2.5V.

And regarding linearity. Perhaps this is a problem with the Multisim modeling, but the non‑linearity of the saw’s slopes is visible to the eye. I have superimposed perfectly straight green lines on the graphs.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 10, 2026, 10:33:50 pm
I can only be of limited help here; no electronics expert am I.

Regarding the frequency, that's set by the RC time constant of R2/C1 and R3/C2 in your sim.
Lower values of both R and C will increase the frequency.
You can play around with them, probably get somewhere in the ballpark.

Others will have to address the linearity issue, which is important. Likewise the low voltage output.

Good luck!
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 10, 2026, 10:53:26 pm
Try this out in your simulator:

[attachimg=1]

(this is just the square-to-triangle converter)

Much higher output.
Frequency is low here (500Hz) but can be adjusted later.
Output looks pretty linear, but I didn't check it carefully.
Very simple circuit.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 10, 2026, 11:32:12 pm
Try this out in your simulator:


No, this is definitely not what I need)). I think it’s better to stick with the previous scheme with current mirrors. Just pick all the elements that suit my needs.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 10, 2026, 11:48:13 pm
Hmm; not saying this is the problem for sure, but when I changed the voltage in my sim (LTSpice) to 5 volts I also got a horrible waveform. As built with 9V supply it give a very nice-looking triangle wave.

Try increasing the supply voltage to 9 and see what happens. (Yes, I know you want to run at 5 volts, but let's see if this circuit works or not.)
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 01:21:47 am

Try increasing the supply voltage to 9 and see what happens. (Yes, I know you want to run at 5 volts, but let's see if this circuit works or not.)

I raised both the supply voltage and the amplitude of the input square wave up to 12V. Now the signal already looks like a triangle. However, the linearity is very poor at the top.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 11, 2026, 01:24:05 am
OK. I'll be watching this thread going forward as this is something I'm interested in as well.

Again, good luck with your project, whatever it may be.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 11, 2026, 04:31:14 am
I raised both the supply voltage and the amplitude of the input square wave up to 12V. Now the signal already looks like a triangle. However, the linearity is very poor at the top.

Yes, if you inject two almost identical charges into a cap it will drift toward one of the rails. There is no defined DC point.


The must use transistors restriction imposes more design effort than simply using a good opamp, as was already given in another thread.

There are two broad approaches to  arbitrary must use transistors restriction :

a) You can make a schmitt with thresholds at 2V and 3V and feed that back to two current sources.
This uses a single Cap and self centres on the schmitt thresholds, but such a schmitt is not trivial to get right.

b) You can create a square wave (as above) and use that to switch currents into a cap.
That is simple to define frequency (with the caveat some cross coupled monostables can fail to start), but it has no defined DC average.
Thus you need to add an additional DC centre circuit.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 11, 2026, 05:46:13 am
Here is a Single Gate CMOS Schmitt gate, with an idealized 2V and 3V switching points.
Zoomed on the triangle current slope, to show the linearity.
You get better linearity with cascade current mirrors, and there is just enough headroom to manage this on 5V rail.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 11, 2026, 07:32:35 am
I once found such a schematic. On the left side, there is an adjustable current source that needs to be replaced with a constant one.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 11, 2026, 07:36:49 am
Here is a Single Gate CMOS Schmitt gate, with an idealized 2V and 3V switching points.
Zoomed on the triangle current slope, to show the linearity.
You get better linearity with cascade current mirrors, and there is just enough headroom to manage this on 5V rail.

That's fine, very interesting actually, except that it violates the "no chips" requirement.
I suppose you could build those Schmitt triggers with discretes; how difficult would it be to get the hysteresis points right?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 11, 2026, 08:54:59 am
That's fine, very interesting actually, except that it violates the "no chips" requirement.
Perhaps, but that 'rule' is an entirely arbitrary arm-wave anyway.
A real design is likely to use matched transistors, and those are now 'integrated circuits' (oops) with two transistors, and come in the same package size as a single gate part.

I suppose you could build those Schmitt triggers with discretes; how difficult would it be to get the hysteresis points right?
It's just more parts.
You can use differential pairs to get more stable set/reset points, but any Schmitt tends to have soft lead-ins to currents prior to the snap-over, and it is not easy to keep those artifacts out of the current envelope.
A CMOS Schmitt has a very well behaved drive, with no skirt effects.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Doctorandus_P on August 11, 2026, 10:12:26 am
I'm struggling a bit with the word "only".

Are capacitors and resistors allowed? a PCB (breadboard). Wires, Solder?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 01:55:12 pm

Are capacitors and resistors allowed? a PCB (breadboard). Wires, Solder?

No, only transistors. Without a printed circuit board, without solder and flux, transistors are prohibited from being connected to each other in any way.

It was a joke. Of course, resistors, capacitors, and diodes are allowed. “Only transistors” — and this was mentioned at the very beginning of the topic, meaning without the use of chips.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 01:59:49 pm
I once found such a schematic. On the left side, there is an adjustable current source that needs to be replaced with a constant one.

From which element in this circuit should the triangular signal be taken? From Ct?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 02:36:12 pm
I once found such a schematic. On the left side, there is an adjustable current source that needs to be replaced with a constant one.

To begin with, I assembled the circuit exactly as you did. If the signal is taken from Ct, then the circuit didn’t work in Multisim.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 11, 2026, 02:43:16 pm
From which element in this circuit should the triangular signal be taken? From Ct?
From Ct or after the source follower.

It works for me. This circuit was designed to work as a VCO with a wide tuning range. I found it on the seventransistorlabs website.



Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 03:08:38 pm
It works for me. This circuit was designed to work as a VCO with a wide tuning range. I found it on the seventransistorlabs website.

Could you please select the circuit elements so that the Ct results in:
- 80 kHz (80..82)
- amplitude 1 V
- offset +2.5 V
And also post the circuit in better quality. Thank you in advance!
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 03:44:25 pm

It works for me.

Please note that you swapped the connections of the collectors of transistors Q9 and Q10 (if you look at my diagram). In the very first diagram, their collectors were connected incorrectly. Then you posted a new diagram with graphs. There, the collectors were connected correctly.

I assembled this new circuit. I “played around” with the component values and got an almost perfect triangle. 80 kHz, 1 V peak‑to‑peak, 2.5 V offset, linearity — perfect.

Are there any pitfalls?

p.s. And the current consumption is 34 mA.. Isn’t that too much?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: CaptDon on August 11, 2026, 04:03:05 pm
Can't your simulator program help you pick the correct components instead of EEVBLOG doing the work for your project? Take the 237Hz example and play with it.
 
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 11, 2026, 07:19:02 pm
I assembled this new circuit. I “played around” with the component values and got an almost perfect triangle. 80 kHz, 1 V peak‑to‑peak, 2.5 V offset, linearity — perfect.

Are there any pitfalls?

You'll find out after you build (breadboard, probably) the circuit IRL.

Quote
p.s. And the current consumption is 34 mA.. Isn’t that too much?

Seems about right, given how many transistors are running there.

5V @ 34 mA = 0.17 watt. Sounds good to me.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MathWizard on August 11, 2026, 07:32:37 pm
I've made pretty uniform looking triangle waves from just a single or 2 BJT circuit, just a relaxation oscillator, although just looking at the 1 saved circuit I found in my LTSpice folder, it's not a triangle wave. But I'm sure I had some simple 1-2 BJT oscillator circuit that had some node, making a nice triangle wave, that then would just need some buffering to make it a more usable signal. I'll try and find it, or play with the 1 I found and see if it's just my current RC values that make it no good as a triangle wave.

Of course a single 555 timer circuit can do a good job too, or some op-amp oscillator, or some other ones people have uploaded here. I'd like to try some, but I better stay focused on my own studies, I'm on too many side-tracks, from repairing an old Electrometer.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 11, 2026, 07:39:00 pm
Are there any pitfalls?
p.s. And the current consumption is 34 mA.. Isn’t that too much?
You mean besides temperature and tolerance?  8)
I see a jfet snuck in here, and your Schmitt likely needs two jfets to avoid offsets on your triangle.
TI have recently released a dual jfet, but that is a monolithic integrated circuit so your ‘rule’ excludes that.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 11, 2026, 08:07:49 pm
Quote
p.s. And the current consumption is 34 mA.. Isn’t that too much?
According to the author's description, the circuit operated up to 6MHz, so the comparator had to be fast, which requires significant currents.

Of course, this can be changed at the cost of switching speed.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 10:13:17 pm
Quote
p.s. And the current consumption is 34 mA.. Isn’t that too much?

Of course, this can be changed at the cost of switching speed.

I selected the components for my circuit. It’s great that we managed to get rid of 1 transistor. The current consumption is less than 5 mA.

The linearity has suffered a bit, of course, but I think it’s not critical.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 11, 2026, 10:16:34 pm
Mind my asking what your application is here? Class D amp?

(Of course you're not obliged to answer that. I'm just curious.)
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 10:39:51 pm
Class D amp?


Absolutely right. A Class D amplifier controller for creating a PWM modulator to an AM transmitter. I'm no longer interested in doing it on ready-made PWM controllers, I want to do it the old-fashioned way, only on transistors  ;)
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 11, 2026, 11:10:38 pm
Of course, this can be changed at the cost of switching speed.

This slight nonlinearity is also visible on your graph. The litle “hook” in the lower corner of the triangle. I found the cause. 680 pF is too small a capacitance for the reference capacitor. This resulted in a low charge and discharge current. I increased the capacitance to 2 nF and adjusted all the other components. The linearity turned out to be almost perfect. :-+
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: free_electron on August 11, 2026, 11:12:08 pm
pull up the manual for the hp 3300A.

https://www.youtube.com/watch?v=qpqONAFvxPI (https://www.youtube.com/watch?v=qpqONAFvxPI)

no ic in sight. only simple transistors
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 12, 2026, 01:14:31 am
pull up the manual for the hp 3300A.

I tried to find it online but no joy.
Do you happen to have a copy, or a link?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: free_electron on August 12, 2026, 01:21:00 am
https://archive.org/details/hp_3300A/page/n33/mode/2up

https://archive.org/details/hp-3300-a-op-and-service-manual-sn-519-1965

https://archive.org/details/hp_3300a_service_6

Three versions depending on serial numbers

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 12, 2026, 03:03:57 am
If you do nothing to a single VBE junction in 5V feed, you get about 3% increase in current over 0~60°C, or ~6% for two VBE junctions.

It is possible to correct for the VBE TC with an opposing variation, here is a solution for 2 BAT54 Schottky diodes to TC correct a 1mA mirror, with 240mV RE drop.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 03:05:03 am
Hi AlexRG,

You may want to consider replacing the JFET buffer stage with a BJT buffer. The JFET stage will have an offset between the input and out that depends on the JFET gate threshold voltage. By using a PNP emitter follower, then a NPN emitter follower the VBE offsets are cancelled:

(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2873224;image)

Q2 bas current, in my model is around 0.5uA, it is small compared to the capacitor charging and discharging currents.

This replaces Q6 in your model.

You will have to adjust the values of R13, R14 and R10 to get the amplitude and offset correct.

Regards,

Jay_Diddy_B
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 03:51:15 am
Here is my version:

(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2873340;image)

I have replaced the JFET buffer with a BJT buffer.


I have attached the LTspice model to this post

Regards,
Jay_Diddy_B

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 04:04:56 am
Hi group,

Here is a simplified and slightly improved version:

(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2873356;image)

Regards,
Jay_Diddy_B
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Analog Kid on August 12, 2026, 04:41:55 am
Could you attach the .asc file for that improved version so I don't have to create it?

Thanks!

(I created AlexRG's latest circuit in LTSpice but couldn't get it to work)
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 08:40:17 am
Here is a simplified and slightly improved version:

Thank you. Yes, the circuit turned out to be simpler, since there’s no need to look for a separate JFET transistor. The signal linearity also turned out to be excellent.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 09:15:36 am
Could you attach the .asc file for that improved version so I don't have to create it?

Thanks!

(I created AlexRG's latest circuit in LTSpice but couldn't get it to work)

Hi Analog Kid, AlexRG and the group,

Here is the LTspice model with some notes to indicate how the circuit works:

(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2874038;image)

Note: that I am taking the output from the buffer output, Q7 emitter.

The spice directive .ic V(Vcap) = 0 sets the initial conditions on the integrating capacitor. Without this directive the circuit does not oscillate.


I have attached the modified LTspice model.

Regards,

Jay_Diddy_B
[attachurl=2]
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 09:20:11 am
Thank you. Yes, the circuit turned out to be simpler, since there’s no need to look for a separate JFET transistor. The signal linearity also turned out to be excellent.

Well. The circuit turned out to be good and stable; I like it.  :-+ I suggest we stick with it.

If no one objects, I would like to suggest discussing a slightly different issue. So as not to start a new, separate topic. 

As I mentioned earlier, I’m developing a discrete transistor‑based controller for a class D amplifier. We already have a triangle generator. Now we need a comparator — in the same way, but using transistors.

Take a look at the diagram; I’ve sketched out a simple comparator circuit. The voltage source V3 will in reality be a sound source with an amplitude of up to 1V and a bias of +2.5V.

When there is no sound, the output of the comparator is a square wave with a duty cycle of 50%. When sound appears, the duty cycle of the square wave will decrease or increase in time with the sound. That is, a simple class‑D amplifier principle.

I have a question. When I increase the voltage at source V3 to 2.9V, the duty cycle of the square wave at the output is 10%. Everything is fine. But when I increase the voltage at source V3 to 2.95V, Multisim refuses to create a 5% duty cycle at the comparator’s output. Is this a fault in my comparator’s circuit? Is it too slow? Or is it a simulation error in the program? Can you check in other programs?

In reality, I would like the duty cycle to be modulated stably, at least from 2% to 98%, ideally from 1% to 99%.

p.s. R17 390Ω will actually limit the current through the optocoupler LED. Its value must not be changed. The square wave oscillograms are shown at the output of the comparator (collector Q18).
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 09:42:17 am
Hi,

If you use the buffered output, the comparator can be simplified:

(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2874106;image)


(https://www.eevblog.com/forum/beginners/a-triangular-signal-generator-using-only-transistors-is-it-possible/?action=dlattach;attach=2874118;image)

I have attached the LTspice model.

Regards,
Jay_Diddy_B

[attachurl=2]
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 12, 2026, 10:44:53 am
Quote
I have a question. When I increase the voltage at source V3 to 2.9V, the duty cycle of the square wave at the output is 10%. Everything is fine. But when I increase the voltage at source V3 to 2.95V, Multisim refuses to create a 5% duty cycle at the comparator’s output. Is this a fault in my comparator’s circuit? Is it too slow? Or is it a simulation error in the program? Can you check in other programs?
The circuit is too slow; there is a voltage at which the pulse width will be 5%, but it will not match the theoretical calculation. The actual circuit will behave worse than the simulation because simulations poorly represent transistor saturation. Many low-power transistors need 1us to exit saturation, and you expect accuracy in generating 0.2us pulses.

You can use RF transistors. You can improve the circuit by preventing the transistors from saturating using a Schottky diode.
https://en.wikipedia.org/wiki/Schottky_transistor

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 10:46:37 am

If you use the buffered output, the comparator can be simplified:


Yes, this makes the circuit even simpler, and the program can now model duty cycles as low as 3%. But in any case, I think this is just a problem with Multisim, since in your program the duty cycle can practically range from 0 to 100%.

And I’d like to clarify one more point. Look at the figures.
1. If we take the signal from the capacitor, the bottom corner of the triangle is straight.
2. If we take the signal from the buffer, there are artifacts in the bottom corner of the triangle — some kind of ringing.

How critical will this be in reality? The amplitude of this artifact — ringing — is about 5–10 mV. If the full amplitude of the triangle is 1000 mV, then this artifact — the ringing — will introduce distortions in the nonlinearity on the order of 0.5–1 %. Right?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 11:14:30 am
You can use RF transistors. You can improve the circuit by preventing the transistors from saturating using a Schottky diode.
https://en.wikipedia.org/wiki/Schottky_transistor

Do you mean to install Schottky diodes between the base and collector of absolutely all the transistors in the comparator? Well, I tried doing that.

The results are as follows:
1. The stable duty cycle decreased from 3% duty cycle to 2%, which is good.
2. The high‑frequency ring in the square wave disappeared, which is also good.
3. The minimum threshold of the square wave increased from 0V to approximately +0.4V, which is bad. It may be necessary to create a buffer using a BS170 MOSFET at the output of the comparator.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 11:30:13 am
I replaced the BAT46 diodes with BAS70 ones, and the picture got better.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 12, 2026, 12:46:43 pm
Hi AlexRG,

Try with only D6 and D7. These are the only places where anti-saturation diodes are needed.


As MariuszD said, you can use RF transistors in locations Q15 and Q16. Suitable transistors are BSX20 or 2N2369. These are also in surface mount for example MMBT2369. make sure that you can them from a reliable source. Aliexpress may be fakes.

The performance at very low and very high dutycycles depends on how the PWM signal is being used. In a class-D audio amplifier the zero output is achieved when the dutycycle is 50%. The extreme ends are equivalent to clipping in a conventional amplifier.


Jay_Diddy_B

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 12, 2026, 04:36:14 pm
These are also in surface mount for example MMBT2369. make sure that you can them from a reliable source. Aliexpress may be fakes.

Thanks for the information. Yes, I haven’t bought any serious and reliable radio components on eBay, AliExpress, or other private markets for quite a long time. Only from official distributors http://eu.mouser.com/en/ProductDetail/onsemi/MMBT2369ALT1G?qs=HVbQlW5zcXXCfupRhvxoVw%3D%3D (http://eu.mouser.com/en/ProductDetail/onsemi/MMBT2369ALT1G?qs=HVbQlW5zcXXCfupRhvxoVw%3D%3D)

If I use a switchable transistor MMBT2369ALT1G, do I need Schottky diodes between the collector and the base? Will its switching speed be sufficient?

And one more question. In other parts of the design, I will be using BS170 MOSFETs (analogous to 2N7000G). Is it possible to redesign the comparator using them? Then all the problems caused by the accumulation of base charge in bipolar transistors would disappear.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: Jay_Diddy_B on August 13, 2026, 12:49:04 am

Snip ...

If I use a switchable transistor MMBT2369ALT1G, do I need Schottky diodes between the collector and the base? Will its switching speed be sufficient?

Snip ...


The fast switching transistor like the MMBT2369A will probably be fast enough without the Schottky diodes. I would include the Schottky diodes in your PCB layout so that you can add them if necessary.



Snip ...

And one more question. In other parts of the design, I will be using BS170 MOSFETs (analogous to 2N7000G). Is it possible to redesign the comparator using them? Then all the problems caused by the accumulation of base charge in bipolar transistors would disappear.

Snip ...


I assume that you are thinking of replacing Q15 and Q16 with MOSFETs.
Looking at the Gate charge graph on the BS170 datasheet, the total gate charge for Vgs = 5V is around 1nC. With a gate current of 1mA it will take 1us to charge and discharge the gate. The BJTs will be faster than this.

Regards,

Jay_Diddy_B

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 14, 2026, 01:20:22 am
The triangle generator is a responsible node, so I will only make it on a factory printed circuit board. But I assembled the comparator on a breadboard.

I used BC546B and BC556B transistors from DIOTEC. Before installation, I selected Q13-Q14 and Q11-Q12 for the same base opening voltage and the same current transfer coefficient. The resistors were used by no-name, Chinese, including a 10K tuning resistor.

The comparator circuit worked immediately, almost perfectly. A triangular 80kHz signal, 1V peak-to-peak, offset +2.5V was applied to the Q13 base from the UNI-T generator. I used a tuning resistor to change the voltage on the Q14 base and used an oscilloscope to look at the shape of the meander on the Q16 collector.

After that, I soldered the BAT46 Schottky diodes between the collector and the base Q15 and Q16.

Results:
1. Without diodes, the meander range is from 0 to 5V. With diodes from about +0.3V to +5V.
2. The rise and fall time of the meander edges practically does not change from the installation of the diodes. Maybe these diodes are just too slow.
3. The range of stable duty cycle with or without diodes is 1%...99%, which is excellent for my task.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 14, 2026, 06:19:31 am
The triangle generator is a responsible node, so I will only make it on a factory printed circuit board.
Every circuit can be made in a prototype form. It doesn't have to be perfect, it allows checking if there are any issues that will require modifications to the board.

Quote
Results:
1. Without diodes, the meander range is from 0 to 5V. With diodes from about +0.3V to +5V.
2. The rise and fall time of the meander edges practically does not change from the installation of the diodes. Maybe these diodes are just too slow.
3. The range of stable duty cycle with or without diodes is 1%...99%, which is excellent for my task.
Diodes preventing saturation must have a small capacitance because a large capacitance slows down switching. The capacitance Ccb, to which the diode capacitance is added, is multiplied by the Miller effect, so a really small capacitance is needed here. Diodes for small currents <50mA have a small capacitance.

You can check the storage times by applying a square wave at the input. 1us delay would not be a problem if it were a constant time, but it is not; changes in this time for small and large duty cycles will cause nonlinearity in the PWM modulator.


In the simulation, it's easy to show. For a small duty cycle of 12%, one of the times was shortened. So the comparator caused a nonlinear change in the duty cycle. The pulse instead of 1us is 690ns, which is 30% shorter.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 14, 2026, 06:59:06 am
With the diodes, it looks too good to be true. But that's how it is with simulation.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 14, 2026, 02:42:19 pm
With the diodes, it looks too good to be true. But that's how it is with simulation.

I just ran a very difficult and tedious test)).

I connected a multi‑turn resistor with 500 Ω in series with a 10 kΩ trimmer resistor. This was done so that I could set the output duty cycle of the square wave as accurately as possible. Then I took two measurements to see what the linearity of the comparator would be with and without diodes.

I’ll say right away that the maximum stable duty cycle with diodes (BAT46) is above 99 %. Without diodes, the maximum stable duty cycle is 98%, while meander jitter is observed in the range above 94%.

That is, it’s definitely better with diodes. So, here are the test results. I set the duty cycle to 1% on the oscilloscope, then measured the voltage at the base of Q14.

Test 1, with diodes (two diodes between the base and the collector of Q15, Q16)

1% 2.972V
2% 2.964V
3% 2.954V
4% 2.945V
5% 2.934V
6% 2.925V
7% 2.915V
8% 2.905V
9% 2.894V
10% 2.885V

20% 2.785V
30% 2.685V
40% 2.586V
50% 2.488V
60% 2.388V
70% 2.289V
80% 2.189V
90% 2.093V

91% 2.085V
92% 2.077V
93% 2.068V
94% 2.061V
95% 2.054V
96% 2.047V
97% 2.042V
98% 2.035V
99% 2.030V

Final nonlinearity:

1–10%   0.016 %   
10–90%   0.008 %   
90–99%   0.022 %   
1–99%    0.026 %

Test 2. The diodes are disabled.

98% 2.071V
97% 2.073V
96% 2.074V
95% 2.077V
94% 2.081V
93% 2.086V
92% 2.092V
91% 2.099V
90% 2.108V

80% 2.201V
70% 2.3V
60% 2.4V
50% 2.498V
40% 2.596V
30% 2.695V
20% 2.794V
10% 2.890V

9% 2.898V
8% 2.907V
7% 2.916V
6% 2.924V
5% 2.932V
4% 2.94V
3% 2.946V
2% 2.952V
1% 2.957V

Final nonlinearity:

1–10 %   0.019 %   
10–90 %   0.013 %   
90–98 %   0.028 %   
1–98 %    0.022 %

Despite the fact that the overall nonlinearity without diodes turned out to be slightly higher, in reality it’s better with them, because:
a) with diodes, the mender is stable and there’s no jitter after 94% d-c;
b) the linearity at the edges of the range is higher;
c) the overall duty cycle range is practically 0–100%.

Now the next question. Are there any Schottky diodes in a DO‑41(35) package that are better and faster than the BAT46?
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MrAl on August 14, 2026, 03:28:35 pm
Hello everyone. Creating a triangular signal generator using an operational amplifier, or a comparator, or a flip‑flop is quite simple. But is it possible to make it using only transistors? For example, BC556 or BC546?

If possible, please draw the circuit; preferably, it should be possible to simulate it in Multisim.

Here are the parameters needed (see the picture):
1. Signal frequency: 80–90 kHz, accuracy is not important.
2. The triangle amplitude is 1V (a deviation of up to 5–10% is allowed).
3. The triangle signal must have a constant offset of +2.5V.
4. The circuit must be powered by +5V.
5. As I already said — no chips, only transistors.
6. If possible, the edges of the triangle should be as linear (straight) as possible.

Hi,

This is a long thread so this might have been said before, but the main idea is to create a constant current generator with a transistor and use that to charge a capacitor.  The result is a linear ramp.  This is the way CRT televisions did the vertical and horizontal scan for years except before transistors they used vacuum tubes for the constant current generators.
The capacitor can be reset with another transistor that turns on at the end of the ramp.
That's actually the main idea for a sawtooth waveform, and a real triangle would have to use a second constant current generator to discharge the capacitor as well.  One charges it and the other discharges it, and the speed depends on the cap value and the current setting for both constant current generators.
Voltage levels are set by the biasing.

You could also make your own op amp out of transistors but that would be a lot more complicated.

If you need too, look up how to create a constant current generator with a single transistor.  The switching could come from a multivibrator made from two more transistors and some other small parts.

That's probably the simplest way to do the triangle (or sawtooth) using only transistors (and some small parts like resistors and capacitors and diodes).  Throw in a voltage regulator for good stability, which you can also make from transistors if you care to.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 14, 2026, 03:52:11 pm
Quote
Are there any Schottky diodes in a DO‑41(35) package that are better and faster than the BAT46?
SD101 BAT81-BAT83 1N5711

Quote
I just ran a very difficult and tedious test)).
Interesting, but I wonder why you didn't check this on an oscilloscope with a square wave to see how much the circuit delays the edges.

Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 14, 2026, 04:40:41 pm
Interesting, but I wonder why you didn't check this on an oscilloscope with a square wave to see how much the circuit delays the edges.

I applied a square wave (base Q13) to the input, 80 kHz, 5 V, duty cycle 50%. The blue beam is the input signal, the yellow beam is the output signal.

1. Without diodes. Delay is about 750 ns
2. With diodes D4, D5, delay is about 500 ns
3. With D3, D4, D5, delay is about 100 ns

What does this information mean in practice?

====

And regarding the BAT46 diodes themselves. The thing is that the opto‑driver LED will be connected to the comparator’s output. Accordingly, to ensure there are no false triggers, the voltage at the comparator’s output must not rise above 0.6..0.7V at a logical 0. Currently, it is 0.3V. So, I think BAT46 is the optimal diode for this design.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 14, 2026, 07:38:57 pm
Quote
What does this information mean in practice?
Delays will change. When the delay of one edge changes and the other does not, nonlinearity arises. By reducing the delay, we also reduce the range of delay changes and asymmetry.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: PCB.Wiz on August 14, 2026, 07:45:33 pm
The bc547 series is not very fast, it has a larger die and more Cbe than parts like 3904/3906.
Or you can chase less common, but even lower Cbe parts.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 14, 2026, 08:32:17 pm
The bc547 series is not very fast, it has a larger die and more Cbe than parts like 3904/3906.
Or you can chase less common, but even lower Cbe parts.
In the datasheet, I don't see a significant difference. The input capacitance depends on ft, and ft is similar. But the Spice model for 2N3904/6 is faster. I haven't compared actual transistors.

I started searching which RF transistors are available with similar parameters for NPN and PNP. There aren't many, I found MMBTH10/MMBTH81 1GHz and BFT92/93 and BFR92/93 5GHz

In the simulation, the curvature of the duty cycle characteristic as a function of voltage without diodes looks like this.
[attach=1]
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: mawyatt on August 15, 2026, 01:43:39 am
Maybe consider a non-saturating design like ECL/CML based?

Best
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on August 15, 2026, 01:25:23 pm
like ECL/CML based?

What is it? Draw a diagram and explain it simply and in detail.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: mawyatt on August 15, 2026, 02:07:42 pm
like ECL/CML based?

What is it? Draw a diagram and explain it simply and in detail.

Google ECL/CML logic gates detailed bipolar transistor designs, the transistors never saturate (no diodes involved). They go from cutoff to a fixed bias collector current but Vce never approaches saturation levels (no base to collector current). This is why they are so fast, even with modest transistors, as they stay in the pseudo-linear region. We had ECL/CML (SiGe) running ~100GHz two decades ago!

BTW Tektronix famously utilized ECL over half a century ago in their O-Scope trigger circuits (recall initially they utilized Motorola MC10000 and MC100000 ECL gates). This ECL based trigger circuit was the fundamental reason (besides of course bandwidth) Tek Scopes outperformed any others, including HP. Take a look this circuit might give some clues on how to implement a better comparator based upon ECL type non-saturating techniques, even with modest transistors.

Best
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: MariuszD on August 18, 2026, 10:50:36 am
I know the schematic of the basic ECL gate and its operating principle, but surprisingly, it's hard to find schematics or descriptions anything more advanced.  I didn't find any books or articles, only an application note.
Of course, I can buy the parts or come up with something myself, but I'm surprised that so little is written about it (or maybe I'm searching incorrectly). For now, I don't have any needs related to this, but I wanted to learn more about the topic.
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: mawyatt on August 18, 2026, 01:18:49 pm
Recall from long ago that Tek utilized the ECL gate as a limiting amp (we also did this often back then, they make fast limiting amps), differential comparator, as well as fast logic. The IC npn transistors Motorola used in their ECL/CML gates were faster than just about anything you could find with discrete transistors. Suspect a search for old Tek CRO trigger circuits should reveal something if interested.

Best
Title: Re: A triangular signal generator using only transistors. Is it possible?
Post by: AlexRG on September 04, 2026, 12:48:54 pm
Here is a simplified and slightly improved version:

The printed circuit boards and parts arrived, and everything was assembled. It worked from the 1st time, without any settings. :-+

The amplitude of the triangle is 1.07V, offset +2.5V, frequency 86.5kHz.

Then I changed R1 and used the oscilloscope to set the duty cycle of the output meander to 1%, 2%... 99%. The differential nonlinearity turned out to be of the order of: 
0.12% in the range of 1...98%
0.42% in the range of 98..99%

The results are very good, for a self-made OP amp and a self-made comparator with transistors only.  :)