For my homework, we are supposed to simulate an inverting and noninverting amplifier using a single supply and the LM324 opamp. I built the inverting amplifier using a voltage divider, but my output voltage is not a sinusoidal wave rather a square wave that has a cutoff. The output signal should be amplified sinusoidal wave. so, how can I fix this?
Two problems; firstly you need to AC couple the 2.5 Vrms signal to the 470 ohm resistor (R1) or you inevitably are trying to force the op-amp to produce an output voltage that is highly offset from mid-rail: -
If you can't AC couple, you should bias the 2.5 Vrms signal so that it has the same DC level as the node of R3 and R4. Maybe by doing this: -
The 2nd problem is that 2.5 Vrms is 7.071 volts RMS and, with an amplifier gain magnitude of approximately 20 (R2/R1) the op-amp will try and produce an output level of 141.4 volts p-p. That of course is impossible for the LM324 or any op-amp on the limited power supply voltage of 9 volts.