removing spikes

Thread Starter

Legend killer

Joined Jan 24, 2010
10
Hi everyone,I made a circuit in which in which i gave the output of opamp comparator to pulse input of counter ic.but i beleive that because of some spikes generated by opamp while transition from one stage to another,i am not getting proper count.Is there a way to remove spikes using some sort of resistors,capacitors,diodes etc.Thanks in advance
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, where is your circuit? Please post it.

Schematics tell a thousand words. Documenting how you have things wired up currently will help a great deal in understanding where you are now, and in what direction you might go.

Please make certain to include the part numbers of the opamp or comparator and the counter.
 

Thread Starter

Legend killer

Joined Jan 24, 2010
10
:)Hi,
Seems like i was having problems with my pc,thats why i couldn't post the file earlier.Anyways,the circuit is infrared counter
I posted the word document with necessary details.
Hope u can help
Thanks
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
I have extracted your image from the Word document:



It is preferable to post schematics as .png images, as it does not require loading other software; browsers can view the .png images directly.

You can create the image by performing a screen print, starting MSPaint, and then pasting the image into it, and saving it as a .png.

It's also preferable to crop the image, unless you have a simulation also - those generally need the full-size image.

You don't seem to have any hysteresis in your circuit. This will cause the output of the opamp-as-a-comparator to trigger many times quickly when the inverting (-) and noninverting (+) inputs are nearly the same. You can fix that by using a feedback resistor.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
The LM358 is one of the slowest opamps ever made. Its output is a slow ramp that is too slow to properly trigger the 74LS160A counter.

Use a much faster LM393 dual comparator instead. It can have some hysteresis and it needs an output pullup resistor.
 

SgtWookie

Joined Jul 17, 2007
22,230
I have modified your basic circuit diagram; added a signal generator to provide a slowly transitioning input pulse, added a potentiometer to adjust the trip threshold level, and added a feedback resistor to provide hysteresis.

Note also that I have shown the 2nd half of the opamp with it's output connected to the noninverting input, and the inverting input tied to ground. This is very important, as otherwise the opamp can oscillate at high frequency. The inverting input tied to the output sets the gain for that opamp to 1, and tying the noninverting input causes the output to "follow" the input ground signal.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
He probably bought the LM358 from Radio Shack. They don't stock the LM393, but do stock the LM339, which is a quad comparator.

The LM339 could be used, but you would need to wire all of the unused comparator inputs to ground. Use a 1.2k pull-up resistor on the output of the comparator.
 

Thread Starter

Legend killer

Joined Jan 24, 2010
10
Hi sgtwoogie,is it necessary to connecct the unused opamp as u have shown,or will it affect the other opamp.It may sound stupid but for a beginner like me,it is necessary to learn the basics of making a circuit.Thanks</p>
 

Wendy

Joined Mar 24, 2008
23,429
As a matter of good practice ground all unused op amp inputs to ground. Similar practices also apply for digital chips (unless the input needs to be high to work).

Basically it prevents the IC from going into an unpredictable action. In some cases this can show up as high frequency oscillation, a very bad thing indeed.
 
Top