How can I boost/limit a signal to TTL levels?

I am researching a data acquisition system to measure the amplitude and frequency of a 4,100Hz 5v-25v AC square wave signal. Actually this is version 2 for me, in the previous version I analyzed the captured data points and counted the rising edges to determine the frequency, this worked pretty good. On version 2 of my system I would like to use the 32bit counter that is present on the data acquisition card. This counter accepts a TTL level signal. The card has a maximum of 10v analog input for the amplitude measurement, I will use a voltage divider to divide down the signal to within acceptable ranges. R1 = 806Ω, R2 = 196Ω which will result in a vOut range of .98V - 4.89v

All this is fine, but now I run into the problem of the divided signal not be within the valid TTL input range of 2.0v - 5.0v. I had planned on using the divided signal as an input to the counter. I'm not an electronics engineer and this is a problem I know nothing about.

How can I condition the signal so that small positive voltages are boosted to TTL HIGH levels (i.e. 2V) and high positive voltages are limited to TTL HIGH voltages (i.e. 5v)? All of this with minimal effect on the signal being measured.

Any help or guidance greatly will be greatly appreciated.

• Why not a voltage follower followed by a zener diode? Dec 23, 2014 at 8:59
• I'm a noob, I should of said that in my post. I have no idea what a "voltage follower is" or where a zener diode fits into the equation. I googled and read a few articles about them, it seems they don't increase the voltage "This means that the op amp does not provide any amplification to the signal" learningaboutelectronics.com/Articles/Voltage-follower Dec 23, 2014 at 16:56

You may wish to try an open collector for the TTL input. Get some cheap high gain npn transistor:

• connect its emitter to ground;
• connect its collector to the TTL input;
• add 1k resistor between the collector and +5V rail;
• add (if needed, check the transistor's cpecs) a diode between base and emitter in the direction reverse to "base-emitter" junction to save the junction on negative half-periods of your AC;
• connect the AC output to the base of the transistor through, say, 100k resistor;

So, at 5V AC the peak of base current will be approx 0.05ma - more than enough to handle 1k resistor on the collector and TTL input (for high gain transistor). At 50V AC the peak of base current will be approx 1ma, quite within the specs for most transistors.

• I created this from your description, is this what you had in mind? screencast.com/t/FLflUTti It looks like the transistor will normally be closed which pulls the counter to ground and then when the signal is high it will open the transistor and the current from +5v will flow to the counter input - is that basically accurate? BTW, I'm a newb. Never used a transistor before. Dec 23, 2014 at 18:07
• Connect R3 directly to AC output, not through the divider. And depending on the transistor a diode may be needed between base and emitter. Dec 23, 2014 at 18:20
• Open collectors have been used to drive TTL inputs for centuries, well, for decades :-) Dec 23, 2014 at 18:25
• Done. How would I know if a diode is required? Do you have a hint to what spec I would look at to determine if one was needed? Dec 23, 2014 at 18:26
• Better, I'd suggest, just place the diode there without even looking at a transistor specifications. Your negative AC peak is rather great, I don't think a cheap transistor would feature the diode protection built-in. Dec 23, 2014 at 18:33