Schmit trigger help

Thread Starter

axeman22

Joined Jun 8, 2009
54
Hi,

After a little advice on Schmit trigger IC's. I have a SN74LS14N chip. I've got a signal which is relatively square wave at about 100mV Peak to Peak. I want to take this circuit and make it bounce nice and hard with solid levels in accordance with the input voltage. So a +50mV input would equate to around +5v and a =50mV would equate to -5V. So I'm thinking this is ideal for a schmit trigger circuit?

I understand(perhaps incorrectly) that a schmit trigger will take the input to either the Vcc voltage or to ground depending on the input. - is that correct..? with the IC I hve, what are the trigger voltages which will result in the schmit trigger transitioning from state to state on the output. I read the data sheet but it's a bit complex for simple old me.. here it is : http://www.datasheetcatalog.com/datasheets_pdf/S/N/7/4/SN74LS14N.shtml

appreciate if anyone could confirm my understanding of the schmit trigger.. and if anyone has other ideas on how to achieve the desired output based on the inputs - a fluctuating AC signal (decoded POCSAG code actually) of around 100mVp-p. I'm trying to take this small signal and drive it up to RS-232 levels, whilst cleaning it a little at the same time.

Thanks!
 

SgtWookie

Joined Jul 17, 2007
22,230
I'm afraid that your 100mV p-p signal is not of sufficient amplitude to trigger a 74LS14.

You really need to use a comparator with hysteresis; which is basically a Schmitt trigger.

Have a look at the attached schematic & simulation. The title is somewhat misleading; with Vcc=5v, hysteresis is actually about 25mV. To increase hysteresis to 50mV, decrease the value of R5 from 470k Ohms to around 240k Ohms. If you're going to be using a Vcc of 10v, then leave it at 470k.

C1 blocks the DC level of your 100v p-p signal (A), shown on the simulated O-scope on the bottom as the cyan trace.
R1/R2 are a voltage divider that centers your signal at Vcc/2; in this case 2.5v.

R3/R4 centers the voltage reference at Vcc/2. In actual practice, R3/R4 should be about 4.3k Ohms, and there should be a 1k pot between them to allow for adjustment; real-world resistors are not exactly their specified value.

R5 provides negative feedback to the reference input for hysteresis. This also keeps the circuit from oscillating on it's own.

R6 is a pull-up resistor; this is necessary because the LM339 has open-collector outputs. It can sink current, but it cannot source current. R6 provides a current source.
 

Attachments

Thread Starter

axeman22

Joined Jun 8, 2009
54
my god.. that little program just makes it look too easy! Circuit Maker.. I just had a look and it's no longer supported.. ?

I had been using SuperSpice.. seems very powerful but I find to tooo complex for simple stuff like this.

what would the advice be for a person like me who is just playing around with circuits for the fun of it and the learning - as far as a electronics sim program like this goes? I had done little research but ti seemed to me there was no clear leader in the field. if possible I'd like also to be able to have a Picaxe micro in there - do any of these circuit sims handle having a microprocessor in there well?
 

SgtWookie

Joined Jul 17, 2007
22,230
my god.. that little program just makes it look too easy! Circuit Maker.. I just had a look and it's no longer supported.. ?
Correct. I just use it for "quick and dirty" schematics/simulations for this site; the interface is pretty intuitive, and I can throw together a simulation more quickly using it than other simulators. The library has most components that a typical hobbyist would use. But it's at least 12 years old, and can't be updated; you can't add to the library, use macros, or use more than 50 components in a schematic.

I had been using SuperSpice.. seems very powerful but I find to tooo complex for simple stuff like this.
Hadn't heard of it. There are quite a number of simulators available, costing anywhere from nothing (freeware) to tens of thousands of dollars per installation.

what would the advice be for a person like me who is just playing around with circuits for the fun of it and the learning - as far as a electronics sim program like this goes? I had done little research but ti seemed to me there was no clear leader in the field. if possible I'd like also to be able to have a Picaxe micro in there - do any of these circuit sims handle having a microprocessor in there well?
Some do.
Circuit maker was superseded by Altium Designer. Circuit Maker Student is/was a freeware download. Altium Designer cost around $10,000 per installation a few years ago.

Microchip's MPLAB IDE has a built-in emulator for various PIC uC's. You could test out a program in it to see how it'll work. You could use another PSPICE program to test out the linear portions of the circuit.

Linear Techology's LTSpice is a very good (and free) PSPICE and schematic capture program. The interface is just a little bit quirky, and the library contains mainly just Linear Technology's components. However, you can add as many components to the library as you wish.
 

SgtWookie

Joined Jul 17, 2007
22,230
Oh, one more thing - I used an LM339 quad comparator because you can find them at your local Radio Shack. There are 3 other comparators in that IC; if you aren't going to use them, you should ground their inputs, otherwise you may have stability problems.
 

Thread Starter

axeman22

Joined Jun 8, 2009
54
well I found a download of Circuit Maker... but it won;t install under W7! .. I've just spent 20 minutes trying to find out hwo to get it working.. but it seems no go :-(

having a play with a program called MicroCap at the moment.. hmm... wish I just could just pay $29.95 once of and get a 'real good' program that solves all my needs.. this is a new area to me(sims), there seems so many options.. I just want to build circuits and get going.

if I may ask..SgtWookie how would you take the circuit you made and make it trigger on 100mVp-p fluctuating about zero V and make the output around 5Vp-p fluctuating about zero V also..? (being a bit lazy here but you're so damn quick!)
 

SgtWookie

Joined Jul 17, 2007
22,230
well I found a download of Circuit Maker... but it won;t install under W7! .. I've just spent 20 minutes trying to find out hwo to get it working.. but it seems no go :-(
I am NO fan of Vista/W7! :mad: I like W XP Pro just fine, thxvrymch. ;)

having a play with a program called MicroCap at the moment.. hmm... wish I just could just pay $29.95 once of and get a 'real good' program that solves all my needs..
Don't say that too loudly - the Chinese may just do that! :eek:
this is a new area to me(sims), there seems so many options.. I just want to build circuits and get going.
There certainly are quite a few options out there.
Have a look at Tina-TI over at Texas Instruments' website. http://www.ti.com It's a free download. It's a somewhat stripped-down version of Tina.

if I may ask..SgtWookie how would you take the circuit you made and make it trigger on 100mVp-p fluctuating about zero V and make the output around 5Vp-p fluctuating about zero V also..? (being a bit lazy here but you're so damn quick!)
Almost like I sorta knew how to fake it pretty well?

OK, do you have a -5v rail source?
 

Thread Starter

axeman22

Joined Jun 8, 2009
54
No.. I think for the moment in testing I'll just use batteries.. so it will be +4.5 and -4.5V rails actually. I need to drive RS-232 ok and the RS-232 spec says that between 3-15 volts is ok so 4.5 should be fine I'm thinking, and easy enough to get a hold of .. going to download and try that program now.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, I put in a -4.5v Vee, some Zener diodes in the output to limit the output voltage swing to around +/-2.5v, and the cap/resistors on the input were no longer necessary. The Zeners really aren't necessary, as RS232 could swing to +/-12v.

Note that the output polarity is opposite from the input.
 

Attachments

Thread Starter

axeman22

Joined Jun 8, 2009
54
Well I did a LOT of messing about and found that Micro-Cap works ok for me.. at least I seemed to be able to muddle my way around it.

Putting the following circuit up for review with comments..;

- I made R1 22k for some reason which I can't recall.. it's a size I have handy and I noticed that the ripple on the peaks is less.. ok..?
- I took away the 500R pot with no apparent effect(?), I figured this would reduce the ability to set it incorrectly.. why was that required?
- took out the zeners to get a bigger voltage as I needed a bit more for RS-232
- changed the battery voltage to 4.2 to simulate real values.. seems very important that theses are quite well a matched pair so I'll use 3 x new batteries on each rail.
- I used a LM338_TI - I guess that just means it's an LM339 made by texas instruments.. should work fine? the actual chip I have is an LM339N by Phillips.

the circuit seems to simple to be real..

This has been a great learning experience.. Micro-Cap is soo good when you get to know how to use it!
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
- I made R1 22k for some reason which I can't recall.. it's a size I have handy and I noticed that the ripple on the peaks is less.. ok..?
R1 should allow between 3mA-4.5mA current from Vcc to the comparator's output when it's sinking current. This is because the typical sink current with a low saturation voltage for the 339's output is typically 6mA; but you want to ensure that you'll get the output close to Vee when it's sinking current.

Since you have Vcc @ +4.2v and Vee @ -4.2v, that's a total of 8.4v.
8.4v/3mA = 2.8k Ohms.
8.4v/4.5mA = 1.87k Ohms.
Choose a value somewhere between the two.
Since you have removed the Zeners, R2 could be reduced considerably or possibly eliminated. You might want to leave a low-value resistance in there (say 50 to 100 Ohms) to help reduce the possibility of "ringing", or oscillations along the RS232 cable when the '339 is sinking current.
- I took away the 500R pot with no apparent effect(?), I figured this would reduce the ability to set it incorrectly.. why was that required?
I explained that before; "real world" components have a tolerance; they might have 4.7k Ohms marked, but depending on the tolerance, they may be +/-5%, +/-10%, etc. If you don't have a means of compensating for their tolerance, you will have a problem.
- took out the zeners to get a bigger voltage as I needed a bit more for RS-232
That's fine.
- changed the battery voltage to 4.2 to simulate real values.. seems very important that theses are quite well a matched pair so I'll use 3 x new batteries on each rail.
That's OK. Get your ground reference from the middle of the six batteries.
- I used a LM338_TI - I guess that just means it's an LM339 made by texas instruments.. should work fine? the actual chip I have is an LM339N by Phillips.
Actually, you used an LM339_TI - an LM338 is a 5A linear regulator. ;)

the circuit seems to simple to be real..
Hang on to your hat... it's going to get even more simple. ;)

Try this out:


The ground for the source signal and ground between the batteries must be common, or it won't work.
The voltage divider network for the noninverting input has been replaced by a single resistor to ground. This way, no adjustment is required.

There is no protection against the inverting input exceeding Vcc or Vee. If this happens, the comparator will most likely be destroyed. A 10k resistor between the signal source and the inverting input would help that situation.
 

Attachments

Top