Amplifier Spikes - Page 1
Forum section: electronics / beginners

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 10:53:53 am
content: Hi,I am trying to build an amplifier for a signal from about 5kHz to 100kHz. I came up with the attached circuit, which basically works quite well. I built this circuit on a breadboard and now there are very strong spikes with a frequency of 100Hz. These spikes are visible after the first opamp stage even with the input tied down to ground.Can anyone tell me where these spikes come from? What am I doing wrong? Are there any obvious errors in this circuit?In the attached circuit I drew a resistor voltage divider, but in the real circuit it is done with an opamp. I have lots of decoupling capacitors. I cannot see any spikes on the VDD, VGND nor on GND. The spikes are there even if the circuit is powered by a battery. The strange thing is, that the magnitude of the spikes changes when i move my hand over the circuit.Also see attache photo of the scope (2ms/div horizontal, 10mV/div vertical).Thanks for your help!

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 11:27:19 am
content: Thanks for your help!Could you elaborate a little? Where would that come from? How can I prevent it? Why would that even happen when the circuit is powered from a Battery?

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 11:41:23 am
content: Yes, as far as I can tell it is. Also these spikes happen when the scope is not attaches as well (measure by a multimeter in frequency mode).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 26, 2015, 02:15:36 pm
content: Uh... what op-amp?Layout pics?Tim

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 02:33:11 pm
content: The OpAmp is a TL974.I assume that by "Layout pics" you mean a foto of the breadboard? I attached one. The gray part in the lower left corner is not relevant for my problem (spikes are there even if I remove that circuit completely). Top left is the input signal currently tied to ground. Next to it is the microphone that would generate the real signal, but is not connected right now (spikes are there even if I remove the mic completely).

author: SeanB
author_rank: Super Contributor
timestamp: December 26, 2015, 03:11:46 pm
content: What is the power supply? Is there a fluorescent lamp directly above your bench? The power supply could be injecting the pulses, or the fluorescent lamp can also generate the pulses as the lamp turns on when the mains reaches 60V on each half cycle.

author: mij59
author_rank: Frequent Contributor
timestamp: December 26, 2015, 03:15:31 pm
content: Check if the power rail sections of the breadboard are connected.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 03:18:28 pm
content: @SeanB:The power supply is a EP-613 Benchtop PS. But the spikes are there even when powered from a battery.Also, yes there is a fluorescent lamp above the bench, but again, the spikes are there even if I switch it of.@mij59: Yes, I checked. I also tried adding more connectors.

author: PA0PBZ
author_rank: Super Contributor
timestamp: December 26, 2015, 03:35:55 pm
content: Looks like your IN1+ and IN2+ are not connected to 1/2 VCC, only IN3+ has a connection.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 03:51:10 pm
content: I think they are. It is not easy to see, as the connection to IN1+ and IN2+ take a bit of a roundabout path...PIN8 (Out 3) is VCC/2. This is then connected to IN1+ (Pin3) and IN2+ (Pin5) by Green, Violet, Gray, White.

author: mij59
author_rank: Frequent Contributor
timestamp: December 26, 2015, 03:58:55 pm
content: Measure the dc voltage of the power rails and the outputs of the op amp's, part of the circuit must be floating.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 04:15:11 pm
content: No sure if I understood correctly:I measured DC on all pins of the opamp. They are all at 1.6V except for VCC=3.3V and GND=0V

author: mij59
author_rank: Frequent Contributor
timestamp: December 26, 2015, 04:29:42 pm
content: Quote from: mjeanrichard on December 26, 2015, 04:15:11 pmThanks, that is exactly what I wanted to know, although now I am running out of options.What does the output voltage look like at a lower oscilloscope setting ?

author: PA0PBZ
author_rank: Super Contributor
timestamp: December 26, 2015, 04:37:46 pm
content: Quote from: mjeanrichard on December 26, 2015, 03:51:10 pmNot in your schematics.QuoteYou said that the gray part was not relevant...

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 04:42:34 pm
content: @mij59: What do you mean by "lower oscilloscope setting"? Horizontal or Vertical?@PA0PBZ: Yes I noticed too. I drew the gray rectangle a bit too big... Sorry about that.

author: mij59
author_rank: Frequent Contributor
timestamp: December 26, 2015, 04:51:00 pm
content: Quote from: mjeanrichard on December 26, 2015, 04:42:34 pmVertical, something like 1V/div.

author: PA0PBZ
author_rank: Super Contributor
timestamp: December 26, 2015, 04:57:41 pm
content: If it reacts on you moving hand it means that one of the inputs is very high impedance. Could it be that one of the pins is not soldered correctly?

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 05:02:54 pm
content: @mij59: See attached Image: 1V/div; 1ms/div@PA0PBZ: Hmm, kind of hard to tell, but I'll try to re-solder all pins... Is it possible that the high impedance is caused by the breadboard connectors?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 26, 2015, 05:04:11 pm
content: Oh, and please annotate your oscilloscope shots, so no one has to guess what they are!FWIW, your cutoff frequencies are about 10kHz high pass per stage, and 100kHz lowpass per stage. Which means your total gain for three stages cascaded will be a fairly lazy -18dB/octave far from the passband, and -3dB over a rather narrow span, not even reaching a flat midband even, I think.Especially if you're going to the trouble of chaining stages, you should use at least second order filters in each stage. These can be produced from any standard active filter calculator. What you will find is -- if you calculate it out -- each stage will have wider bandwidth, and the later stages will be extra "peaky" (or is it the earlier stages, I forget). When you add them all together, you get the desired filter characteristic.Your resistor values also suggest a desired gain around 60dB, which is nothing to scoff at. You can easily get an oscillator, especially with a quad op-amp on a breadboard. Though I would expect something more sinusoidal in that case.Basic duh checks: verify that the supply voltage (at the op-amp pins) is actually stable (scope it, AC coupling), and that the reference voltage is, too. Your schematic shows no bypass on the voltage divider, making it a prime target for noise interference. Even if it's buffered, the op-amp output will have considerable impedance at higher frequencies, and the divider in front of it still needs to be bypassed for the same reason.Tim

author: mij59
author_rank: Frequent Contributor
timestamp: December 26, 2015, 05:42:01 pm
content: Quote from: mjeanrichard on December 26, 2015, 05:02:54 pmDoes not look it's mains related, it's more like an oscillation.Try using only one opamp, connect the the +IN of the other opamp's to ground.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 06:18:49 pm
content: @mij59: I tried and the spikes are still there after the first stage. Between 10mV and 40mV peak to peak (depending on hand movement).@PA0PBZ:Supply and reference have some high frequency noise that my scope is not quite able to show <5mV. I added bypass caps to the input and the output of the reference buffer (one 1uf and 100n each).

author: Kalvin
author_rank: Super Contributor
timestamp: December 26, 2015, 06:26:28 pm
content: Try adding a 100nF - 1uF capacitor in parallel with R5 and R6 in order to make your virtual ground better filtered.

author: fivefish
author_rank: Frequent Contributor
timestamp: December 26, 2015, 06:28:17 pm
content: TL974 is rated at +/-2.4V minimum.You're running it at +/-1.6VCould that be the problem?

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 06:35:54 pm
content: @fivefish: I am not quite sure that I read the specs correctly, but I assumed, that "Supply voltage: min. 2.7V" means that it is ok to power it with 3.3V. Anyway I cranked the PS up to 5V (just to be sure) and it still behaves the same way.@Kalvin: I already did at the suggestion of @T3sl4co1l

author: Kalvin
author_rank: Super Contributor
timestamp: December 26, 2015, 06:46:40 pm
content: Quote from: mjeanrichard on December 26, 2015, 06:35:54 pmI seems that you have quite bad ground/power loop in R5 and R6 versus other signals and ground. Try to move the R5 and R6 to the same ground/power rail with the rest of the circuit.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 07:08:01 pm
content: @T3sl4co1l: I tried to find a filter configuration that fits my problem but this was the best I could come up with. My Signal is about 2-5mV p-p. and between 10kHz and 80kHz. Most of the calculators would not give me the required gain (at least 50dB). Or only with a lot more stages. But I am a bit out of my depth here... So if you could point me into the right direction that would be very much appreciated!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 26, 2015, 07:22:51 pm
content: Expecting gain out of an active filter is tricky, because you need GBW sufficient to include the filter's behavior, plus the gain, and this very quickly limits your performance. A 4th order Butterworth filter might need a Q factor of 3ish in one stage, which means GBW roughly that many times the cutoff frequency. Which means, for 12MHz op-amps, you are limited to a gain of 40 in that stage. (Which is still not unreasonable, but you should allow some headroom to keep distortion down, and the bandwidth accurate.)If you could tell us more about your signal source and its nature, maybe a better suited system design could be considered. Is the signal always exactly ~2mV? Does the midband gain really have to be exactly 1000? Would a cheaper gain stage using discrete transistors be overall better? Would a variable gain stage (the equivalent of radio AGC) be desirable?It's best to have a chunk of low-noise gain out in front, to raise your signal level above the noise level of the remaining signal chain. Then you can apply whatever filtering and amplification is necessary, without having to worry about noise (which will be a modest concern for ~2mV signal levels, in this bandwidth).Point being, you don't need a 10-100kHz bandpass on each stage. The bandwidth limiting only matters to the stages where excess bandwidth is a problem: the first stage probably doesn't mind, because the signal is so small. But if there are strong interfering signals around, they need to be filtered away, or even the first stage can be driven into clipping. (To account for RFI, a modest CLC filter might be used, with a cutoff frequency of ~MHz. It won't affect the desired signal bandwidth, but it will do a damn good job preventing interference.) The bandwidth probably should be kept within the desired range before the final gain/output stage, because it's close to clipping, just from the signal alone.Oh, and note that an oscilloscope with 10x probes will have basically no reading for ~2mV signals, while your circuit will be slamming into the rails at the output. Just because you can't see it on your instrumentation, doesn't mean the circuit isn't seeing it! That's really what's meant by "scope the rails": measure it to a degree satisfactory to your circuit's sensitivity.Tim

author: Habropoda
author_rank: Regular Contributor
timestamp: December 26, 2015, 07:38:36 pm
content: Since you can use this with a battery and you can detect the spikes with your DMM, an easy check would be to move it to another part of the house or even outside.I use the same circuit for bat detector experiments, and with the high gain and the fact that it operates well into radio frequencies means that I pick up all kind of stray signals around the house; TVs, computers, all those little power supplies and phone chargers, clocks. The breadboard with all those wires makes it much worse. I never realize how noisy my environment is in those frequencies.

author: mjeanrichard
author_rank: Contributor
timestamp: December 26, 2015, 08:47:14 pm
content: @Habropoda: The "same" as in exactly the same or similar? I use it for the same purpose, and would like to sample the signal with a teensy 3.0 to analyze the frequencies of the calls... What kind of mic are you using?

author: Habropoda
author_rank: Regular Contributor
timestamp: December 26, 2015, 09:50:59 pm
content: Not exactly the same but very similar. I’m using two stages since the op amps I use have enough bandwidth – yours might as well. For microphones I use Panasonic WM-61a clones and the Knowles SPU0410HR5H. Here’s a project I’m working on for the Hackaday Square Inch contest.https://hackaday.io/project/8353-worlds-smallest-bat-detectorThat is the circuit I use. For this project it is way overamped and clips like crazy but that is just fine to drive the LEDs. For your purpose you would need to lower the gain.See the Resources and Further sections for other uses for this circuit. As noted there I am very excited about using the preamp/RPi/Cirrus combo for bat call analysis. For the contest deadline I will be adding some more video, photos and content over the next couple of days.Keep in mind I am not an expert at this stuff and I look forward to more comments from T3sl4co1l and others on ways to improve it. Using two stages for gain and two stages for active filters might work out well.edit: added schematic here for ease of discussion.

author: mjeanrichard
author_rank: Contributor
timestamp: December 27, 2015, 09:29:00 am
content: @T3sl4co1l:The input signal comes from a mic. The 2mV is just what I can measure with the expected sound volume. Basically I just want to amplify the signal enough to be able to sample it with an ADC and to create a envelope detector. The precise gain is not really important nor is the exact passband. It is just important that the signal is attenuated above 100kHz to prevent aliasing. The highpass is there to prevent loud low frequency noise to "hide" the interesting signal.The circuit has to operate for hours without user interaction so I don't think variable gain will help.If I understand correctly, I should amplify the signal before the filter? Also I would like to keep the part count (and price) down as best as possible...

author: mjeanrichard
author_rank: Contributor
timestamp: December 27, 2015, 12:30:12 pm
content: Quote from: Habropoda on December 26, 2015, 07:38:36 pmI finally got around to do just that. My DMM does not show any frequency when I try it outside. Unfortunately I cannot take my scope outside to check if the noise is just to small for the DMM to pick up or if it is really not there.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 27, 2015, 12:44:09 pm
content: ADC then detector? You need over 200kSps! Man, why not detect in analog?! Kids these days!Manually variable gain might be useless, but I meantautomaticgain control (AGC). Ideally, you'd start with the one high frequency signal, and process it into two signals: the detected audio output (which consists of the envelope of the 10-100kHz signal), and an AGC signal (which varies slowly, perhaps ~100Hz bandwidth) which ideally has an exponential relationship between AGC voltage and input signal. In effect, you have the "sound", and its "volume", separated!Indeed, you can apply enough gain that the detector is always reading a signal, even if it's ambient noise, or amplifier hiss. Use a comparator on the AGC to determine what's loud enough to count as a signal (otherwise known as a squelch function).You'd get enough gain from about 4 transistors, but a variable bias, high gain differential amplifier (using perhaps 7 transistors) would be more convenient (or, for example, using an LM13700, which provides variable gain control with a single pin). The whole thing should be possible in under 1mA of supply current, though to make it easy, you might use more.And, if you ever want an introduction to radio circuitry, it would be the perfect learning environment, because it does almost everything a radio does (except frequency conversion; which could still be done, but it's probably not worthwhile here).Tim

author: mjeanrichard
author_rank: Contributor
timestamp: December 27, 2015, 01:21:01 pm
content: Sorry I was not clear enough:There are two signals going into two analog ports of a microprocessor. One is the envelope used to detect the signal, the other is the signal, which is sampled at ~250kSps and further processed with an FFT (but only if a signal is present...).Yes, what you describe sounds exactly what I need. The volume would be used to check if a signal is there, the AGC signal would be used for sampling and then FFT.My problem is, that I have no idea how to implement that. I just about understand how an opamp works...

author: chris_leyson
author_rank: Super Contributor
timestamp: December 27, 2015, 02:43:58 pm
content: Is your Vcc/2 rail bypassed ? Try 100n or 1uF across R6. I see you wired up the unused amplifier as a unity gain buffer and connected it's +ve input to Vcc/2, that's always good practice. Had a quick look at the data sheet, the input common mode range for the TL974 is Vss+1.15V to Vcc-1.15V, or 1.15V to 2.15V if using 3.3V supply.Some older generation dual and quad op-amps share a common bias generator for all of the amplifiers and in some cases if you take any of the amplifiers out of their common mode range this upsets the bias for all of the other amplifiers. I don't think this is true for the TL974 but I've had amplifiers do some very strange things when using a spare op-amp as a comparator AND not staying within the recommended common mode range.Figure. 18 in the TL97x data sheet (Rev H), output voltage verses input voltage, started to ring alarm bells. I think this could be where the problem is. If you believe Fig. 18 then the TL974 isn't designed to run at low supply voltages. The transfer function of the unity gain buffer in fig. 17 changes sign at around 1V input !!! Tried running the TL972 spice model in LTspice and it looks OK, i.e no sign change at around 1V input, but spice models are not always accurate and there is no guarantee that they will include all non linear effects.If all else fails try getting one op-amp to work and keep your wiring reasonably short.Good luck.

author: fivefish
author_rank: Frequent Contributor
timestamp: December 27, 2015, 06:27:01 pm
content: He's using a 3.3V total. with virtual ground, he's really just using +1.65 and -1.65V to power his opamp.I still suspect the problem is somewhere related here but he said he upped the voltage to 5V and he's still seeing the spikes.

author: mjeanrichard
author_rank: Contributor
timestamp: December 27, 2015, 06:45:56 pm
content: Actually the spikes go away as soon as I go outside. I currently blame the Wifi Router that is in the same room as my workbench... :-)

author: Audioguru
author_rank: Super Contributor
timestamp: December 27, 2015, 09:15:06 pm
content: A solderless breadboard uses many rows of contacts and many messy jumper wires that are antennas that pickup all kinds of interference, especially when you have a high gain wide bandwidth circuit.Use a compact pcb instead.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 27, 2015, 09:37:41 pm
content: RF interference is more common with GSM phones nearby than wifi, but it is a bipolar amp, so that could be a contributor. Ideally you'd have some amount of RLC filtering (say, 1nF to GND plane, 1kohm, or 1uH or ferrite bead, something around there) in effect around all lengthy traces/leads going to the amp. But on a breadboard, you can't really do that...Tim

author: garre
author_rank: Contributor
timestamp: December 27, 2015, 10:10:22 pm
content: I have heard a number of good ideas and suggestions, but most likely your problem is from your electrical power. 100Hz is the first harmonic of your power supply in Europe. The noise is likely being injected from some appliance or lighting in you home. With a typical breadboard you wiring will likely allow either RF or magnetic coupling to inject the noise from an electrical appliance not your WiFi router. By reducing your breadboard lead lengths and putting the amplifier in a shielded box with a good ground should eliminate the noise.

author: DimitriP
author_rank: Super Contributor
timestamp: December 28, 2015, 12:47:01 am
content: QuoteQuote from: garre on December 27, 2015, 10:10:22 pmYeah...well... we are only on page three...we have ways to go... 1 + 1 is soo full of possibilities....

author: mjeanrichard
author_rank: Contributor
timestamp: December 28, 2015, 07:06:50 pm
content: Yeah, it was not the wifi (tried switching it of...). Still don't know what it was, but as soon as I leave my office the signal disappears.As long it is not some oscillation within my circuit i am happy.Thanks for all the helpful tipps!!