# Square wave to sawtooth wave using two BJT

I have two circuits that are supposed to be square wave to sawtooth wave converters: Both circuits receive a positive square wave as their input and generate a positive sawtooth as their output. Do these circuits actually work? What are the modes of operation of the transistors? I need to know these in order to set up the equations for calculating the component values.

You should just plug this circuit topology into circuit simulator and start experimenting to figure out on your own how these work. This way you will learn the most.

These circuits use one transistor as a constant current circuit (sinking in your left circuit / sourcing in the right circuit) to linearly discharge / charge the capacitor. The other transistor is driven by the square wave to quickly charge / discharge the capacitor on one state of the square wave signal.

To convince you that the circuits work I plugged the right side circuit with the current source into the LTSpice with some nominal values and obtained the following results.  • It would be interesting to AC couple the base resistor to obtain a signal in which the capacitor is charging most of the time. A sawtooth wave is most commonly seen without this long constant time. – vangelo Jun 30 '19 at 11:43
• @vangelo - The left circuit on the question shows an AC coupled input. With these circuits the resistor values, capacitor values and applied voltage levels all contribute to the amplitude and shape of the output signal. – Michael Karas Jun 30 '19 at 11:47
• sure. I just thought it would be interesting to point this out considering the normal uses of sawtooth signals. – vangelo Jun 30 '19 at 11:58
• Thank you very much for your answer. I now understand and am able to set up equations for the circuit with pnp and npn transistors. But I still cannot figure out how the circuit with both npn transistors works. Could you tell me the modes of operation of the transistors? – Haris Gušić Jul 1 '19 at 13:55

Michael's simulation already provided a detailed view on the circuit. To quickly answer the question regarding the component calculations:

R1 and R2 form a voltage divider which determines, after Vbe drop, the voltage on R3, forming the constant current to charge the capacitor (charge circuit on the right, discharge on the left).

R1||R2 should be low enough to avoid loading from the base current.

Constant current and capacitor value determine the charge time. Be careful with capacitor value as the current in the transistor during the faster capacitor voltage change may be quite high. As Michael mentioned, simulation will help analyzing the energy dissipated by the BJT.

RB on the right protects the transistor by limiting BE current and limits the current drawn from the square signal source. Lower values lead to faster discharge (circuit on the right).