Author Topic: A triangular signal generator using only transistors. Is it possible?  (Read 4169 times)

0 Members and 10 Guests are viewing this topic.

Online Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2983
  • Country: ca
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #50 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

 
The following users thanked this post: AlexRG

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #51 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

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.
 

Online Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2983
  • Country: ca
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #52 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

 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #53 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.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #54 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.

« Last Edit: August 14, 2026, 06:52:48 am by MariuszD »
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #55 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.
 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #56 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?
« Last Edit: August 14, 2026, 02:48:45 pm by AlexRG »
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 2247
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #57 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.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #58 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.

 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #59 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.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #60 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.
 
The following users thanked this post: AlexRG

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3302
  • Country: au
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #61 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.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #62 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.
2878522-0
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 6046
  • Country: us
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #63 on: August 15, 2026, 01:43:39 am »
Maybe consider a non-saturating design like ECL/CML based?

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #64 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.
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 6046
  • Country: us
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #65 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
« Last Edit: August 15, 2026, 03:51:16 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 634
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #66 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.
« Last Edit: August 18, 2026, 10:58:25 am by MariuszD »
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 6046
  • Country: us
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #67 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
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #68 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.  :)

 
The following users thanked this post: PCB.Wiz


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf