Fork me on GitHub

Project Notes

#105 BJT SawTooth

Testing a simple BJT saw-tooth oscillator.

The Build

Notes

This circuit examines a simple method for generating a simple sawtooth oscillation using only NPN and PNP transistors. I’m cribbing from the tutorial posted by w2aew.

Here’s the principle of operation:

  • R1/R2 bias Q1 as a constant current source
  • Q1 charges C1 at constant rate (Ic/C)
  • Q2 base is set with the R3/R4 voltage divider
  • Q2 is initially in cut-off as Ve (0v) < Vb (4.5v) > Vc (~0.7v)
  • As C1 charge exceeds Q2 base, Q2 becomes forward biased, which in turn forward biases Q3
  • C1 discharges through Q2 + Q3
  • discharge continues until Q2 collector falls low-enough to force cut-off, and the cycle repeats

The standard guidelines for NPN/PNP operation (from BJT page on wikipedia ) help understand the behaviour:

Voltage Relation NPN PNP
E < B < C forward-active reverse-active
E < B > C saturation cut-off
E > B < C cut-off saturation
E > B > C reverse-active forward-active

Not Oscillating?

The trick seems to be to ensure that the Q2/Q3 pair effectively cut-off. The original circuit set R3 at 10kΩ. Depending on transistor characteristics, this may not pull the voltage high enough to ensure oscillation occurs. If not, the typical behaviour is to see one oscillation, and then C1 peg at about 1 diode-drop.

Reducing the value of R3 seems to overcome the problem (here I’m using 4.7kΩ with 2N3904/2N3906 transistors). As a side-effect, this also increases the amplitude of the wave.

Changing Frequency

The capacitance of C1 affects the slope of the charge. Since we are using a constant current, charge time in V/sec = Ic/C. So higher capacitor values will slow down the wave frequency and vice versa. Here I’m using a 10µF electrolytic to give a very slow wave, visible to the eye.

Here’s a sample trace recorded using PlotNValues (a simple Processing sketch) to read the data collected by the SawTooth.ino program:

processing trace

Code

The SawTooth.ino sketch is a simple data capture and reporting interface. It uses the FlexiTimer2 library to provide data capture on an accurate and stable time base.

Construction

Breadboard

The Schematic

Credits and References

About LEAP#105 BJTOscillators
Project Source on GitHub Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is my personal collection of electronics projects, usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.