Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Square Wave Generator Circuit with Op Amp IC LM358
Electronics Circuits Op-Amp Circuits

Square Wave Generator Circuit with Op Amp IC LM358

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 20251 Comment5 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Square Wave Generator Circuit with Op Amp IC LM358
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this tutorial, we will explore the Square Wave Generator Circuit using the Op-Amp IC LM358. The LM358 operational amplifier is versatile enough to be configured for generating a square wave output.

The LM358 IC is a widely used and versatile operational amplifier that finds applications in various circuits including comparators, wave generators, amplifiers, and more.

A square wave generator is an electronic circuit that produces a square wave output. The operational amplifier-based square wave generator is a straightforward circuit that is commonly utilized in function generators. The circuit for the square wave generator is designed using the LM358 op amp.


Bill of Materials

Following are the components required for building this circuit.

S.N.Components DescriptionQuantity
1Resistor10 KΩ2
Resistor 100 KΩ1
Resistor 47 KΩ1
2Variable Resistor2 MΩ1
3Capacitor0.01uF1
4Op-Amp ICLM358
1



Op-Amp IC LM358

The LM358 is a dual operational amplifier IC featuring a wide range of capabilities. This IC is available in several different packages, making it adaptable for various applications. The internal circuitry of the LM358 is designed with numerous transistors to handle diverse analog tasks efficiently.

LM358 IC

Notable for its high gain, low power consumption, and ability to operate from a single power supply over a wide range of voltages, the LM358 is particularly suited for battery-operated devices. Additionally, the IC is equipped with short-circuit protection at both the input and output stages, which safeguards the internal components from overload damage. This makes the LM358 a reliable choice for many analog circuits requiring operational robustness.

Check the IC LM358 Datasheets


Square Wave Generator Circuit Diagram using LM358 IC

Take a look at this circuit diagram—it’s a neat setup for a square wave generator using the LM358 operational amplifier, which is configured here as a Schmitt trigger. The core of the circuit includes the LM358 op-amp itself, accompanied by three fixed resistors (R1, R2, and R3), a variable resistor (RV1), and a capacitor (C1).

Square Wave Generator Circuit using LM358

In terms of layout, there’s a feedback loop in place. The output from the op-amp cycles back to its non-inverting input via R2. This loop is what provides the necessary hysteresis for stable Schmitt trigger operation. The resistors R1 and R2 create a voltage divider that sets critical threshold levels at the non-inverting input—these thresholds help determine when the op-amp switches its output. Meanwhile, the capacitor C1 is linked to the inverting input and plays a vital role in the circuit’s timing, as it charges and discharges according to the settings of the nearby resistors.

This setup not only efficiently churns out square waves via the LM358, but also allows for easy frequency adjustments through the variable resistor RV1.




Working of Square Wave Generator Using Op-Amp 741

The square wave generator circuit using the LM358 op-amp operates based on the principles of a Schmitt trigger, which is a type of comparator circuit with hysteresis.

  1. Initial Conditions and Charging:

    When the circuit is powered, the capacitor C1 begins to charge through the resistors R3 and the variable resistor RV1. The initial state of the op-amp’s output (pin 1) is determined by the voltage levels at its non-inverting (pin 3) and inverting (pin 2) inputs. Initially, the non-inverting input, influenced by the voltage divider formed by R1 and R2, is at a lower voltage compared to the inverting input.

  2. Reaching the Upper Threshold:

    As C1 charges, the voltage at the inverting input (pin 2) increases. Once this voltage surpasses the voltage at the non-inverting input (pin 3), the output of the op-amp switches from low to high. This switching point is the upper threshold of the Schmitt trigger, which is set by the ratios of R1 and R2.

  3. Feedback and Discharging:

    With the output now high, feedback through R2 raises the voltage at the non-inverting input, effectively setting a new, higher threshold for the inverting input to cross back. Meanwhile, the capacitor C1 begins to discharge through R3 and RV1.

  4. Reaching the Lower Threshold:

    The voltage at the inverting input decreases as C1 discharges. Once it falls below the elevated threshold at the non-inverting input, the output of the op-amp switches back from high to low. This lower threshold is crucial for the hysteresis characteristic of the Schmitt trigger, preventing noise from triggering false switches.

  5. Cycle Repeats:

    After the output switches to low, the feedback through R2 lowers the voltage at the non-inverting input again, setting up the conditions for another cycle of charging and discharging of C1. This cycle repeats continuously, creating a stable square wave at the output.

  6. Frequency Adjustment:

    The frequency of the square wave output can be adjusted by varying the resistance of RV1. Increasing RV1 increases the total resistance in the charging and discharging path of C1, which slows down the rate of voltage change at the inverting input, thereby lowering the frequency of the output square wave.

This circuit uses a simple setup where a capacitor charges and discharges through a group of resistors, and the LM358 op-amp acts like a switch that flips between two states. This setup helps produce a steady and clean square wave, which is useful for many electronic applications.




Circuit Simulation

The circuit can be simulated using Proteus Software. The below circuit simulation gives the perfect output on the Oscilloscope. You can change the value of resistors to observe the change in the waveform.

Square Wave Generator LM358

You can also make a Triangular Wave Generator Circuit with Op Amp IC 741 or 741 Based Pulse Generator and in order to view the waveform you can design your own DIY Oscilloscope at home.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleMars Rover Robot Replica using ESP32 CAM & Arduino
Next Article DIY Smart Blind Stick using Op-Amp & IR Sensor

Related Posts

Water Level Alert using Float Sensor & 555 Timer

Water Level Alert using Float Sensor & 555 Timer

2K
Adjustable Auto On Off Delay Timer Circuit Using 555 IC

555 Based Adjustable Auto On Off Delay Timer Circuit

Updated:February 14, 20252K

12V DC to 220V AC Inverter Circuit & PCB

Updated:February 2, 20251461K
DIY Smart Blind Stick using Op-Amp & IR Sensor

DIY Smart Blind Stick using Op-Amp & IR Sensor

Updated:February 2, 202515K
Gas Leak Detection & Alarm using 555 Timer IC

Gas Leak Detection & Alarm using 555 Timer IC

Updated:February 2, 202525K
Inductive Water Level Indicator with Display using IC 74HC157 & CD4511

Inductive Water Level Indicator with Display using IC 74HC157 & CD4511

Updated:February 2, 202522K
View 1 Comment

1 Comment

  1. Raushan on July 4, 2024 11:17 PM

    Thanks -D

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • MAX30102 & Arduino: Heart Rate + Blood Oxygen Monitoring
    MAX30102 & Arduino: Heart Rate + Blood Oxygen Monitoring
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.