I think you've got your opamp "upside down" in your schematic though it's hard to tell for sure due to the coarse resolution of the image. But it does look like your feedback divider is connected to the non-inverting input rather than to the inverting input.
If so, you've got something like a schmitt trigger circuit there rather than the difference amplifier you intended.
Method 1: Do nothing special...
Simple if the generated signal can be DC-biased by the signal generator, i.e. instead of -1.4 to 1.4 Volts, output a waveform of 1.0 to 3.8 Volts.
This signal can be directly used as digital input to an Arduino GPIO pin. For standard Arduino boards, Vcc is 5 Volts, while some clones and specific newer boards work at 3.3 Volts. For the 5 Volt case:
- GPIO port thresholds (from ATmega328 datasheet):
- LOW is < 0.3 Vcc, i.e. < 1.5 Volts
- HIGH is > 0.7 Vcc, i.e. > 3.5 Volts
Thus, raise the voltage floor of the square wave so it goes beyond these voltage levels at high and low, and it's all done.
Method 2: Use a comparator, or an Op Amp as comparator
This is as already suggested by Nick Alexeev in comments. Please note that the LF355N may not be suitable for this purpose: Minimum Vcc supported is +/- 5 Volts, i.e. 10 Volts in single supply configuration. You will need a (preferably) rail-to-rail output op-amp supporting single supply operation at Vcc of 5 Volts.
(from this web page, which has additional explanations)
Clamp (or adjust at signal generator) the negative part of the incoming signal so it does not go below Ground potential. If the generator does not support DC biasing, a diode-based voltage clamp could be used, several suitable schematics show up on a web search.
Choose R1 and R2 such that the voltage divider provides a comparison threshold within the voltage high and low levels of the square wave, say 0.8 Volts. The output will be inverted, but will toggle between the supply and ground levels (or as close to the supply rails as the op amp chosen can drive its output) according to the input signal.
Method 3: Use an NPN transistor as a switch
A BJT designed for switching, such as the 2n2222, can be used for this purpose. This transistor is designed to withstand higher reverse bias voltages at the base than the -1.4 Volts that a 2.8 Volt peak to peak signal would have, so no additional care needs to be taken for the negative part of the cycle.
What is the better route?
- If the signal generator supports DC biasing, Method 1 is the obvious answer.
- If not, the simplest and least expensive solution would be Method 3.
Best Answer
Let's say that body resistance is 100k and the op-amp chosen is a TL082. This op-amp has an input bias current of 50pA and through 100kohm will generate an offset voltage of 5uV. Multiply this by the gain of 1000 and no problems - the output voltage will be 5mV and not end-stopping. However, the TL082 has an input offset voltage of 5mV so this would offset the output by 5V when gain is 1000. But remember that two op-amps are present and their offset voltages could be additive.
What about the LM324? Bias current is 40nA and with 100kohm this generates an input offset of 4mV and not surprisingly produces a whopping 4V offset after amplification of 1000. It looks like the beginning of the problem if the LM324 is used but there's another issue - the LM324 has an input offset voltage of typically 2mV so, after a gain of 1000 this might look more like 2V added to the 4V due to input bias currents. Given also that there are two amps the offset voltage could be additive making a total of 8V offset.
An LM741 has a bias current of 80nA and this, given the same rationale as above produces an 8V offset on the output. Plus, the input offset voltage is maybe 2mV thus adding another 2x 2V. Grand total is 12V offset.
My favourite quad op-amp (OP4177) has a typical offset voltage of 25uV and a bias current of 0.5nA - this would, in the configuration above produce 50mV at the output due to bias currents and 2x 25mV due to offset voltages. 100mV total offset, ahhh that's better....
So, what op-amp are you using?