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

0 Members and 2 Guests are viewing this topic.

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2604
  • Country: is
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #25 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.
 
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 4747
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #26 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.
 

Offline MathWizard

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

Online PCB.Wiz

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

Offline MariuszD

  • Frequent Contributor
  • **
  • Posts: 637
  • Country: pl
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #29 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.
 
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 #30 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.
« Last Edit: August 11, 2026, 10:14:53 pm by AlexRG »
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 4747
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #31 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.)
 

Offline AlexRGTopic starter

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

Offline AlexRGTopic starter

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

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 9046
  • Country: us
    • SiliconValleyGarage
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #34 on: August 11, 2026, 11:12:08 pm »
pull up the manual for the hp 3300A.



no ic in sight. only simple transistors
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 4747
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #35 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?
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 9046
  • Country: us
    • SiliconValleyGarage
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online PCB.Wiz

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

Offline Jay_Diddy_B

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



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
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2983
  • Country: ca
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #39 on: August 12, 2026, 03:51:15 am »
Here is my version:



I have replaced the JFET buffer with a BJT buffer.


I have attached the LTspice model to this post

Regards,
Jay_Diddy_B

« Last Edit: August 12, 2026, 03:55:40 am by Jay_Diddy_B »
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2983
  • Country: ca
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #40 on: August 12, 2026, 04:04:56 am »
Hi group,

Here is a simplified and slightly improved version:



Regards,
Jay_Diddy_B
 
The following users thanked this post: oPossum, AlexRG

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 4747
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #41 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)
 

Offline AlexRGTopic starter

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

Offline Jay_Diddy_B

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



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
* triangle generator BJT MODIFIED.asc (4.66 kB - downloaded 10 times.)
« Last Edit: August 12, 2026, 09:18:08 am by Jay_Diddy_B »
 
The following users thanked this post: Analog Kid, AlexRG

Offline AlexRGTopic starter

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

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2983
  • Country: ca
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #45 on: August 12, 2026, 09:42:17 am »
Hi,

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






I have attached the LTspice model.

Regards,
Jay_Diddy_B

* triangle generator BJT WITH COMPARATOR.asc (6.49 kB - downloaded 6 times.)
« Last Edit: August 12, 2026, 09:45:26 am by Jay_Diddy_B »
 
The following users thanked this post: AlexRG

Offline MariuszD

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

« Last Edit: August 12, 2026, 10:47:21 am by MariuszD »
 
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 #47 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?
 

Offline AlexRGTopic starter

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

 

Offline AlexRGTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ru
Re: A triangular signal generator using only transistors. Is it possible?
« Reply #49 on: August 12, 2026, 11:30:13 am »
I replaced the BAT46 diodes with BAS70 ones, and the picture got better.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf