Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to design a triangular wave generator for a frequency of about 20Khz?

Status
Not open for further replies.

spikeeeee

New Member
Hello everyone am trying to design a pulse width modulation circuit . To generate the PWM pulses i'll feed the triangular wave at one input and a control voltage at the other input of an comparator to get the pulses at the required duty cycle. I need to have a triangular wave which varies from 0 to 5Volt (not a 5volt peak to peak)at a frequency of about 20 Khz. i searched in the internet and found many of the circuits consists of a comparator and integrator to generate the triangular wave which varies peak to peak and those circuits uses a negative voltage supply. My guess is i don't need a negative supply for my kind of circuit design.
I found the formula used to design the integrator which is based on the negative and positive saturation voltages of the op amps.
Am really confused to design this circuit and also for choosing the right op amp with the enough slew rate for a proper triangular wave at the output.

Am just a beginner with the electronics please correct me if i am wrong.
 
Use a comparator instead of an op amp. You won't be able to get completely down to 0 or all the way up to 5, but I bet you don't need to.
 
You can use a rail-rail type op amp for the integrator but you will need to add an offset voltage to the (+) input to keep the output within the supply voltage range, since an op amp integrator is an inverter.

Below is a circuit that may meet your needs. You can use other comparators or op amps if they operate from a single-supply and meet your frequency requirements.

View attachment 60477
View attachment 60478
 
Last edited:
Triangle

Here is a cheap and dirty version if you have a spare comparator.:)
 
shall i replace the LT1016 COMPARATOR with an LM393 and the the Lt1213 opamp with the the lm 358opamp and they can operate on single supply.

And also shall i use the same values for the resistor and the capacitor.
You can use a rail-rail type op amp for the integrator but you will need to add an offset voltage to the (+) input to keep the output within the supply voltage range, since an op amp integrator is an inverter.

Below is a circuit that may meet your needs. You can use other comparators or op amps if they operate from a single-supply and meet your frequency requirements.

View attachment 60477
View attachment 60478
 
A lousy old LM358 dual opamp has trouble above only 2kHz.
I would use a OPA034 single opamp (it is low noise and works well at 250kHz). An OPA2134 is a dual opamp. An OPA4134 is a quad.
 
shall i replace the LT1016 COMPARATOR with an LM393 and the the Lt1213 opamp with the the lm 358opamp and they can operate on single supply.

And also shall i use the same values for the resistor and the capacitor.
If you use the LM339 you will need to add a pull-up resistor from the LM339 output to V+. My simulations indicate 10k ohm works well.

I would use a better op amp such as AG suggested.

The resistor and capacitor would remain the same.
 
If you use the LM339 you will need to add a pull-up resistor from the LM339 output to V+. My simulations indicate 10k ohm works well.

I would use a better op amp such as AG suggested.

The resistor and capacitor would remain the same.

thanks crutschow can you tell me what would be a better opamp than the LM339 and also what are the features it should have than the LM339 i have choosen.
 
The LM339 is a quad comparator. It has 4 comparators in a 14 pins package.
An LM393 is a dual comparator. It has 2 comparators in an 8 pins package.

An LM358 is an old dual opamp that has poor performance above 2kHz. You need a better opamp.

Here is a comparason of the high frequency performance of some opamps:
 
The LM339 is a quad comparator. It has 4 comparators in a 14 pins package.
An LM393 is a dual comparator. It has 2 comparators in an 8 pins package.

An LM358 is an old dual opamp that has poor performance above 2kHz. You need a better opamp.

Here is a comparason of the high frequency performance of some opamps:

thanks audioguru . shall i choose a TL071 opamp
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top