PIR Op-Amp Intermittent Oscillation - Page 1
Forum section: electronics / projects

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 23, 2020, 07:21:23 pm
content: A few years back one a customer had a PIR sensor designed by a third party, I'm not an analog guy so was happy enough with that. We took the schematic, did the layout and integrated it into a little housing. It's low volume but there were occasional field failures 1-2% where the sensor would oscillate indefinitely (i.e. for weeks until service team gets to it), as volume has increased it's becoming more of a pain for the service team as most of the units are very remote.Where Murphy strikes is that we can't replicate the problem and have never seen it in production units. Even returned units power up fine for us.The unit passed EMC immunity at the test house, although I can get it to oscillate by blasting it with 800-900MHz in a TEKBOX TEM cell at full power it doesn't stay oscillating when I turn the amplifier off. It's fine outside this band up to 1600MHzIt's battery powered so it can't be supply ripple, it even behaves on a noisy SMPS. Units are remote and as far away from electrical noise as you can get.The circuit as provided to us is as attached. Apologies for the format I tidied it as best I could.Layout is 4-Layer with internal ground and power planes, close attention paid to the routing of the sensitive signals.It seems the original designer used this as a reference design:https://www.st.com/resource/en/application_note/dm00096551-signal-conditioning-for-pyroelectric-passive-infrared-pir-sensors-stmicroelectronics.pdfTwo stages amplifier then into two comparators to give the two outputs, lowpass filters on both amplifier stages.My thoughts/questions on the source of the issue (bearing in mind I'm no Op-Amp expert)(1) The gain is set quite high, the customer wanted long range. Could this be the root cause? It doesn't explain why some units work totally fine for years Even increasing the gain to the point it occasionally false activates doesn't induce oscillation(2) The 22nf on the outputs were part of the design handed to us. Could this capacitance be having a negative effect?(3) The ESD diodes are ESDLIN1524BJ and were my idea in case static was the issue, though it seems to have had no effect.(4) The outputs go to a PIC24F (via a shielded 250mm cable) which interrupt it from sleep mode, it does it's thing then goes back to sleep. We have ruled out firmware bug as the customer has had units on his bench which he observed oscillating. He was able to see the output go high/low on a meter.My plan of attack is to try to replicate the problem by making the circuit "worse". Once I can replicate reliably I can figure countermeasures.We have already tried and failed to replicate with:- Increased gain- Supply noise- Increased Output capacitance- EMIAny analogue experts have any suggestions?

author: mikerj
author_rank: Super Contributor
timestamp: October 23, 2020, 08:36:31 pm
content: Quote from: bookaboo on October 23, 2020, 07:21:23 pmThat could certainly be a problem, though it depends on the op-amp and I don't see a part number in the schematic. If it the same TSU101 as used in the reference design then the datasheet shows just a couple hundred pF can have a major impact on phase margin. 22nF may be high enough to form a dominant pole and make it stable, or barely stable.Also there may be an error in the schematic since OP2 has two 22n capacitors to ground and OP1 has none.

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 23, 2020, 08:45:37 pm
content: Hi Mike,Yes there should be a 22nF on both not two on one. The original schematic and PCB is correct though, I made that error while tidying the schematic for posting.The opamp is the TI LP324Dhttps://www.ti.com/lit/ds/symlink/lp324.pdf?

author: Kleinstein
author_rank: Super Contributor
timestamp: October 23, 2020, 09:40:10 pm
content: The LP324 is an odd choice: it is specified for 3-32 V supply. So 2.8 V are quite low. The supply current is also quite high for battery operation.The high gain may require a reasonable good layout, but with the 1 st stage non inverting and the 2 nd inverting the tendency for oscillation should not be very high.OPs don't like capacitive loading on the output. It would need some extra series resistor (e.g. some 1K) to isolate it.Many µCs include a reasonable quality comparator with not to a high a supply current. So one may be able to use µC internal comparators instead of the last 2 OPs. This would also reduce the cables to only one.

author: ace1903
author_rank: Regular Contributor
timestamp: October 24, 2020, 07:19:13 am
content: We had a similar issue with certain types of batteries. With batteries supplied by us device operated a year or two.Then when the buyer replaced them with some from the market sporadic false triggering occurred.Interestingly some expensive brand batteries with advertised long life were most problematic. Internal resistance was traded for long life.Later, our analog designer modified the circuit to add a large RC filter for sensor element supply only.

author: magic
author_rank: Super Contributor
timestamp: October 24, 2020, 08:26:59 am
content: Besides battery voltage and ESR it could perhaps be a matter of extreme temperatures.Capacitors on channel C and D outputs should not cause instability because these channels operate without feedback as comparators. Phase margin is not a concern.Quote from: bookaboo on October 23, 2020, 07:21:23 pmWith a meter? What's the frequency of that oscillation?Are both channels switching back and forth or only one?Are their states valid, i.e. if one is high then the other is low and vice versa, or whatever it is that they are supposed to be?

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 24, 2020, 05:59:24 pm
content: Quote from: Kleinstein on October 23, 2020, 09:40:10 pmNoted for my upcoming redesign, thanks.Still looking for fixes for field and stock units.Quote from: ace1903 on October 24, 2020, 07:19:13 amYes the customer uses a mix of both D and Lithium Thionyl Chloride ER34615D cells, nominal 7.5v or 7.2v packs respectively.I'm told both type have been found on faulty sites.I was able to reproduce the problem in an unrealistic manner by simulating a bad battery, a high series resistor caused the 2V8 regulated voltage to dip. The unit then oscillates, only when attached to the motherboard as the PIC gets into a wake/sleep cycle which causes the voltage drop and oscillation.It was a bit of an extreme test, 200-400r to cause the problem (happens on site with fresh batteries too).Quote from: magic on October 24, 2020, 08:26:59 amI know it's both channels as the firmware looks for both before recording an event. The customer is competent but not a tech so was only able to see voltage swinging high and low. When I simulate the oscillation with aforementioned series resistance the frequency is <1Hz and can be seen on the 2V8 supply and the PIR element (though I'm not sure if this is reflective of the situation on site).

author: Kleinstein
author_rank: Super Contributor
timestamp: October 24, 2020, 06:27:18 pm
content: If the problem is supply related, one may reduce it by increasing C7 and maybe also R5 (maybe 22 K instead of 10 K), so more filtering for the supply to the PIR sensor. Similar additional capacitance (e.g. maybe 100 µF) before the regulator can help.The 22nF caps at the output of the OPs used as comparator may also cause more current spikes - reducing those capacitors (to maybe 1 nF or leave them out all together) could also help, if drop is due to extra current from the OP. I don't see much use in the added capacitor at the OPs ouput: the signal is essentially digital and relatively low impedance. So there is very little positive effect expected, mainly negative effects.

author: Kasper
author_rank: Frequent Contributor
timestamp: October 25, 2020, 04:24:18 pm
content: Quote from: bookaboo on October 24, 2020, 05:59:24 pmLithium Thionyl Chloride batteries advertise long shelf life due to internal passivation. The internal resistance climbs over time and could get to 400 ohms.This caused a big problem for me years ago when they were either older than the manufacturer claimed or they passivated faster than the manufacturer claimed. Our solution was to de-passivate them with a resistor and a timer.Coincidentally we used them in a PIR which had a problem with false triggers but that was more about bad PCB design: the wireless tcvr module and the PIR amp shared 1 skinny ground trace so when the tcvr transmitted and sent 40mA down that trace, it caused false motion detect.If we didn't have hold time to reduce the amount of wireless transmitting, it could have 'oscillated': wireless transmission causes motion detect which causes wireless transmission...

author: temperance
author_rank: Super Contributor
timestamp: October 25, 2020, 05:06:35 pm
content: -The schematic looks like its drawn by a hobbyist.-Is C1 really polarized capacitors. They are probable X7R. X7R capacitors should not be placed in the feedback of an op amp. You need class I capacitors in those places like NPO's.-If you're customer can see it oscillating with a meter, it's clearly not oscillating because that would not be visible on a meter. The 22nF caps are probably the cause of the problem you see. Try flexing the board of a faulty device while observing the outputs of the op amp.-You should never place capacitors directly at outputs of op amps. Add resistors in between the op amp outputs and the 22nF capacitors. By doing so you can remove the ESD diodes because the 22nF caps will eat any ESD if the board layout is ok.

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 26, 2020, 07:57:45 am
content: Not my schematic but I did my best to tidy it, all caps are non-polar.After a long drive I retrieved a faulty unit from site. Finally caught one in the act, the outputs were indeed oscillating at about 1Hz.Output from PIR seemed fine, output from stage 1 seemed fine, output from stage 2 was all over the place.There my luck ran out as while probing the oscillation stopped and I can't get it going again. I'm not sure if it is the 22nf output caps as we investigated by increasing that value with no ill effect.

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 26, 2020, 08:17:46 am
content: The board flex point is intriguing. Often (including this time) the oscillation stops not long after the PCB has been removed from its housing, its a compression fit inside the plastics. Though flexing and tapping does not cause oscillation.

author: temperance
author_rank: Super Contributor
timestamp: October 26, 2020, 06:27:36 pm
content: The first stage reading "normal" doesn't help you much. Any variation at the output of the first stage is amplified by a factor 100 in the second stage and the total gain of this circuit is 10K.Attach an oscilloscope at the second stage output and try cold spray on:C11, C9, C22, C12 and C1

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 28, 2020, 03:24:03 pm
content: Freezer spray does send the device into oscillation but I dont think it's the cold but rather the moisture. It oscillates after the temp has returned to normal and until the liquid has fully gone. As a double check we put a unit in the freezer with a logger, no ill effects.Got hold of a few units faults. Murphy really is all over this one, when out of the box they all return to normal operation after a few minutes. Put them back in the enclosure, some work fine indefinitely while others have the fault return after a few minutes.... safely hidden from my scope probes! May try to take a few wires out of the box and hope that doesn't interfere with the measurement.Also have a few where the sensitivity drops to near zero (but still picks up a soldering tip waved close by). They exhibit the same "in the box / out of the box"

author: Kasper
author_rank: Frequent Contributor
timestamp: October 28, 2020, 03:41:40 pm
content: Quote from: bookaboo on October 28, 2020, 03:24:03 pmThat sounds like a PCB flex issue. Perhaps it takes a few minutes for the oscillations to build up or calm down enough to be noticeable.How else would the enclosure affect it? It holds heat in, it could reflect or block IR, it could push the mirror housing against something. Do you have a conductive mirror housing on the PIR and is it occasionally shorting against something? That was another bit of fun I was handed with a PIR, it reset occasionally, turned out the plastic PIR mirror housing was covered in conductive material that would short to nearby components.

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 28, 2020, 06:57:02 pm
content: Its a standard ABS housing with a slit and IR translucent material to give a narrow field of view. Nothing conductive internally, I wouldnt rule out flexing but still unsure.More weirdness, probing around a unit that has developed a fault of low sensitivity I find that probing TP3, TP4 (voltage divider inputs to the comparators) or U3-5 (Center point of voltage divider) cause the output of the 2nd stage TP2 to saturate and clip, it settles quickly.Even multimeter leads have an effect although they do not cause saturation.Probing 2V8 or Vin does not have the same effect.My theory is the capacitance of probes on U3-5 is having the effect, I cant see how the comparator stages TP3 ot TP4 would be able to affect TP2?In any case it doesn't take much to throw this circuit off, even though these effects are temporary.I wonder if R1-R4 are too large? Could it be an issue that they are part of the same network (even though all the reference designs use this topology)?For all of these tests I've already removed C13, C14, D3, D4 as part of the investigation.In any redesign I'd use separate dedicated comparators and dedicated voltage references.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 28, 2020, 08:08:56 pm
content: There is some coupling from the input of OP C and D to the test_points 3 and 4, as the differential input impedance is not very high. So the voltage divider may indeed be to high in impedance. For a test one could try a different (CMOS) OP like MCP6004 - this should have much less coupling. Alternatively use a separate divider chain for input B+.

author: temperance
author_rank: Super Contributor
timestamp: October 29, 2020, 02:20:11 am
content: Probing TP3 and 4: oscilloscope probes are 10Mohm at DC and any wiring at those nodes will pickup 50Hz.If the op amp is really an LP324:The inputs of OP2 are operating outside their common mode range which is at least VCC-1.4 (The data sheet does not specify the CM range but you will see a Darlington PNP long tailed pair at the inputs.) To this voltage you will have to add the voltage required for biasing circuit for the input stage.The LM324 has a similar input stage and the CM range is Vcc-1.5V.The MCP6004 suggested by Kleinstein is a much batter choice for this circuit.

author: bookaboo
author_rank: Frequent Contributor
timestamp: October 31, 2020, 05:45:16 pm
content: The plot thickens. MCP6004 arrived in yesterday and I replaced on a faulty unit (note this unit has stopped counting which was another failure mode occasionally seen. My MCP6004 worked first time, the waveforms looked good so I set it on the bench for the day to test. It seemed to gradually get less sensitive then stopped altogether.I took it out of it's box and it played nice for once and remained faulty I noted this on TP2 which should swing around 1/2 VCC. Instead it was biased to ground:Tested the resistor divider, all good on dmm (though the input impedance of the scope is enough to mess measurements).Then compared OUTA to OUTB (TP2) :Pretty much at a loss, R7 and C6 should AC couple the signal into the second stage so I can't figure why it biased to ground.Probed around C6 but the problem seemed to get worse, not sure if that was a product of above mentioned probe capacitance/impedence:TP2 (CH2) and junction R7-C6 (CH1)(voltage across C6):Hand waved in front of sensor.THe only thing I could think was that something has damaged the opamp, I hadn't removed C13 or C14 until this point so I removed those along with D3,D4 and fitted a new MCP4006. The unit has been working a few hours now:I wonder if the 22nf would be enough to actually damage the opamp. I'll refit the original MCP6004 once I pin test it against a new one.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 31, 2020, 07:52:02 pm
content: The 22 nF should not damage the OPs. However even when used as a comparator is may cause oscillation: if the comparator switches it would cause more unwanted load (spike at some 20 mA = short circuit current of the OP) to the supply and this may be enough to cause a drop large enough to couple to the PIR sensor. So it would definitely be good to remove the caps.With X7R capacitors there may the odd effect that the capacitor tend to loose some of the capacitance over time after soldering. This is a known kind of effect. With border-line sized caps this can cause nasty delayed faults.It is hard to test, as soldering again can reset the aging effect.