An oscillator is a device that produces a waveform by its own, without any input. Though some dc voltage is applied for the device to work, it will not produce any waveform as input. A relaxation oscillator is a device that produces a non-sinusoidal waveform on its own. This waveform depends generally upon the charging and discharging time constants of a capacitor in the circuit.
The emitter of UJT is connected with a resistor and capacitor as shown. The RC time constant determines the timings of the output waveform of the relaxation oscillator. Both the bases are connected with a resistor each. The dc voltage supply VBB is given.
The following figure shows how to use a UJT as a relaxation oscillator.
Initially, the voltage across the capacitor is zero.
$$V_c = 0$$
The UJT is in OFF condition. The resistor R provides a path for the capacitor C to charge through the voltage applied.
The capacitor charges according to the voltage
$$V = V_0(1 - e^{-t/RC})$$
The capacitor usually starts charging and continues to charge until the maximum voltage VBB. But in this circuit, when the voltage across capacitor reaches a value, which enables the UJT to turn ON (the peak voltage) then the capacitor stops to charge and starts discharging through UJT. Now, this discharging continues until the minimum voltage which turns the UJT OFF (the valley voltage). This process continues and the voltage across the capacitor, when indicated on a graph, the following waveform is observed.
So, the charge and discharge of capacitor produces the sweep waveform as shown above. The charging time produces increasing sweep and the discharging time produces decreasing sweep. The repetition of this cycle, forms a continuous sweep output waveform.
As the output is a non-sinusoidal waveform, this circuit is said to be working as a relaxation oscillator.
Relaxation oscillators are widely used in function generators, electronic beepers, SMPS, inverters, blinkers, and voltage controlled oscillators.