Let's call the top resistor of a voltage divider R1 and the bottom R2. The output impedance is R1 // R2, and the gain is R2/(R1+R2). Set these two equations equal to what you want. Now you have two equations and two unknowns. Solve accordingly.
Note that R1 encompasses the 50 Ω of the source, so the actual top resistor (what you add directly in series with the signal generator) will be 50 Ω less than what you solve for R1. At your very low gain, this will make little difference though.
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
How about this:
simulate this circuit – Schematic created using CircuitLab
Make sure that when the input is low, PMOS is conducting. In other words, ensure that when the input is low the voltage divider ratio satisfies:
$$V_{SG}=V_{led}-(V_{in}+(V_{led}-V_{in})\frac{R_{bias}}{R_{bias}+R_{pullup}})>V_T$$
Also, depending on the frequency of the square wave and the current drive capability of the signal generator in series with switch, you may need to make sure that the transistor's gate capacitance is low enough and half the period of your input signal suffices for this capacitance to discharge.
If you got just NMOSs you might use this topology:
simulate this circuit
In addition to what I said about the PMOS configuration, in this circuit you must also ensure that the (-) pin of your function generator is floating (i.e. it is not grounded internally).