simulate this circuit – Schematic created using CircuitLab
I have created my voltage follower circuit as shown above. But when I connect an oscilloscope, it shows me a square wave at the output instead of a sine wave . Why would this happen?
simulate this circuit – Schematic created using CircuitLab
I have created my voltage follower circuit as shown above. But when I connect an oscilloscope, it shows me a square wave at the output instead of a sine wave . Why would this happen?
Because you don't have negative feedback: inverting input should be connected to the output. Compare your schematic with a proper voltage follower. Without negative feedback, your amplifier gain is very large, so even small signals get amplified to levels far beyond the maximum output level.
My mistake was that
1) I had connected the ground terminal to the inverting terminal
2) I had not connected the negative terminal of the 12V ac source and the negative terminal of the 5V DC source. There should be a common ground between them.