---
title: "Square wave generator using op-amp"
subject: "Basic Electronics Engineering"
chapter: 4
key: "semester_2/basic_electronics_engineering:square-wave-generator-opamp"
source: https://www.bctengineer.com/q/semester_2/basic_electronics_engineering/square-wave-generator-opamp
site: BCT Engineering
---

# Square wave generator using op-amp

Basic Electronics Engineering · Chapter 4: The Operational Amplifier and Oscillator

- Asked in: 2075 Baisakh, 4 marks; 2073 Bhadra, 2+3+1 marks; 2071 Bhadra, 4+1 marks; 2070 Bhadra, 6 marks; 2069 Poush, 6 marks; 2068 Bhadra, 4 marks; 2067 Mangsir, 3 marks; 2067 Chaitra, 4 marks (asked 8 times)
- Video: [Astable Multivibrator (using op-amp) Explained](https://www.youtube.com/watch?v=T7T3At9N9dk) — ALL ABOUT ELECTRONICS
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_2/basic_electronics_engineering/square-wave-generator-opamp
- Whole chapter: https://www.bctengineer.com/md/semester_2/basic_electronics_engineering/chapter-4

## Question

Explain how a square wave can be generated using Op-Amp (draw the circuit, explain its working principle) and write the relation for frequency of oscillation.

## Short answer

An op‑amp astable multivibrator uses positive feedback (divider R1, R2) and an RC timing network. The output toggles between +Vsat and –Vsat when the capacitor voltage reaches ±βVsat. Frequency: f = 1/[2RC ln(1 + 2R2/R1)]. For R1 = 1.16 R2, f ≈ 1/(2RC).

## Answer

A **square wave generator** using an op-amp is an astable multivibrator (relaxation oscillator). It uses positive feedback to switch the output between the saturation levels +Vsat and −Vsat, and an RC circuit to set the time period.

#### Circuit
```text
          +----------[ R ]-----------+
          |                          |
          |         |\               |
          +---------|- \             |
          |         |   >------------+----o Vo
         === C   +--|+ /             |
          |      |  |/               |
         GND     +-------[ R1 ]------+
                 |
               [ R2 ]
                 |
                GND
```
- R and C form the timing network: R from the output to the inverting input (−), and C from that input to ground.
- R1 and R2 form the positive feedback divider from the output to the non-inverting input (+): the feedback fraction is β = R2/(R1 + R2).

#### Working principle
1. Suppose Vo = +Vsat. The voltage at the non-inverting input is V+ = +βVsat. The capacitor charges through R towards +Vsat.
2. When the capacitor voltage Vc reaches +βVsat, the inverting input exceeds the non-inverting input, so the output switches to −Vsat. Now V+ = −βVsat.
3. The capacitor now discharges and charges toward −Vsat. When Vc falls to −βVsat, the output switches back to +Vsat.
4. The process repeats, giving a square wave.

```text
 Vo
       +Vsat  ___     ___     ___
             |   |   |   |   |   |
       -Vsat |   |___|   |___|   |

 Vc
      +βVsat    /\      /\      /\
               /  \    /  \    /  \
      -βVsat__/    \__/    \__/    \
```

#### Frequency of oscillation
The capacitor voltage moves between −βVsat and +βVsat while charging toward ±Vsat:

Vc(t) = Vsat − (Vsat + βVsat) e^(−t/RC)

The half period T/2 is the time to go from −βVsat to +βVsat:

T/2 = RC ln((1 + β)/(1 − β))

T = 2RC ln((1 + β)/(1 − β)) = 2RC ln(1 + 2R2/R1)

**f = 1/T = 1 / [2RC ln(1 + 2R2/R1)]**

If R1 = 1.16 R2 (β = 0.462), then T = 2RC and f = 1/(2RC). The output has a 50% duty cycle with amplitude ±Vsat.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What type of circuit is the op-amp square wave generator?
   A. Astable multivibrator (relaxation oscillator) using positive feedback
   B. Amplifier using negative feedback only
   C. Monostable multivibrator
   D. Integrator
   Answer: A. Positive feedback drives the output between +Vsat and -Vsat while an RC network sets the timing. (Key point: Type of circuit)

2. What is the positive feedback fraction β?
   A. R1/(R1 + R2)
   B. R2/(R1 + R2)
   C. R1/R2
   D. R1 R2
   Answer: B. R1 and R2 form a divider from the output to the non-inverting input, giving β = R2/(R1 + R2). (Key point: Feedback fraction)

3. When does the output switch from +Vsat to -Vsat?
   A. When the capacitor voltage reaches +βVsat
   B. When the capacitor is fully charged to +Vsat
   C. When Vc = 0
   D. When the capacitor voltage reaches -βVsat
   Answer: A. When Vc exceeds V+ = +βVsat, the inverting input is higher and the comparator output flips. (Key point: Switching instant)

4. Which is the frequency of oscillation?
   A. f = 1/(2πRC)
   B. f = 1/[2RC ln(1 + 2R2/R1)]
   C. f = 1/(RC)
   D. f = 2RC ln(1 + 2R2/R1)
   Answer: B. Half period is RC ln((1 + β)/(1 - β)), so T = 2RC ln(1 + 2R2/R1) and f = 1/T. (Key point: Frequency)

## Related in Basic Electronics Engineering

- [Op-amp properties; square wave generator](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Aopamp-five-props-square-wave) — Basic Electronics Engineering, chapter 4
- [Triangular wave generator circuit](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Atriangular-wave-generator) — Basic Electronics Engineering, chapter 4
- [Feedback concept and square wave oscillator](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Afeedback-theory-square-wave) — Basic Electronics Engineering, chapter 4
- [Barkhausen criteria and square wave generator](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Abarkhausen-square-wave-generator) — Basic Electronics Engineering, chapter 4
- [Op-amp properties and differentiator](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Aopamp-props-differentiator) — Basic Electronics Engineering, chapter 4, asked 2×
- [Op-amp properties and integrator](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Aopamp-props-integrator) — Basic Electronics Engineering, chapter 4

## Related in other subjects

- [Square wave generator circuit](https://www.bctengineer.com/question.md?key=semester_3%2Felectronics_devices_and_circuit%3Asquare-wave-generator-circuit) — Electronics Devices and Circuit, chapter 5
- [Op-amp astable multivibrator](https://www.bctengineer.com/question.md?key=semester_3%2Felectronics_devices_and_circuit%3Aopamp-astable-multivibrator) — Electronics Devices and Circuit, chapter 5, asked 3×
- [Transfer function of op-amp phase-shift circuit](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Atf-opamp-allpass-r1-c-r2) — Control Systems, chapter 2, asked 2×
- [Find coefficients of op-amp summing circuit](https://www.bctengineer.com/question.md?key=semester_4%2Fadvanced_electronics%3Asumming-amplifier-coefficients) — Advanced Electronics, chapter 1
