Square wave edge noise on power rail causing issues with low current AC detector - Page 1
Forum section: electronics / projects

author: leonababy
author_rank: Regular Contributor
timestamp: September 01, 2019, 05:21:02 pm
content: I am prototyping building blocks on a breadboard for digital clock projects using vintage clock chips (like MM531x) that will have VFD, numitron or Nixie displays. One of my elements is (was) a zero cross detector, to create twice the mains frequency for the purpose of among other things getting seconds out of the chip.I prototyped a ZCD that does what I need using a diode bridge, BJT and 4N28. However, to reduce part count and eliminate a capacitor I switched to anHPCL3700AC voltage detector, which has all these parts except the capacitor, which is not needed because it is not a ZCD (I don't have to have pulses at ZC). So I have my needed pulse at twice the mains f. It is powered by the 5V rail, and draws only 1-2mA (it has an O-C output).The only problem I have is the noise from another block is disturbing the sensitive 3700 voltage detector. For VFD builds there is a filament driver, which is an LM4871 (same asLM9022) running off the 5V rail self oscillating at 25kHz in bridge configuration, generating a square wave. This draws 100mA. At the edges, there are narrow spikes of about 100mV of noise on the 5V rail, which when they coincide with voltage thresholds of the 3700 corrupt its output.I considered two approaches - use a separate PS for the detector chip, and reducing the amplitude of the noise - something I have little experience in.Approach 1I have decoupling caps, both large and small across each block's Vcc and GND. I tried powering the AC detector only from another power supply, with a common ground, and sure enough the issue goes away. The 3700 operates down to 2V, and only draws 1-2mA, so my thought was maybe use a small 4V LDO chip to power just this device. Smallest capacity is 50mA. I have never used an LDO, and don't know anything about noise from the input to output (seems to be largely PSRR), or minimum loads (will it work OK with only 1mA draw?). Might this eliminate or greatly reduce the spikes?Approach 2A part of me says "there should be a way to reduce that switching noise". I considered changing to a sine wave, which the LM9022 datasheet (which shows the design I am using) says can be done by modifying the feedback of the first opamp. They say a sine, triangle etc are all possible. This seems like a good approach, except I have no clue how to implement feedback that would me give a sine wave output. I also considered that with my breadboard, wires all over the place, and the friction contact connections, may be a factor in the amplitude I have. Perhaps a circuit board would not have as much.I should mention that the 100mV noise is not creating any other issues, and the design for VFD is complete and working otherwise.Any suggestions or comments would be very much appreciated. I was excited that I may be able to greatly reduce my part count with the new frequency generator - and then I zoomed in. Adding a second PS and obtaining a working solution is encouraging, but how to implement a solution within the circuit itself.Don

author: rstofer
author_rank: Super Contributor
timestamp: September 01, 2019, 05:30:59 pm
content: You mentioned decoupling caps but you didn't say how you applied them or the value. They should probably be 100 nF placed as close to the Vcc and Gnd pins as possible. In the old days, we could be sockets with built-in capacitors - that's what 'close as possible' means.You might also distribute some additional decoupling capacitors here and there but consider putting bulk capacitors in a couple of places. Something like 100 uF.Prototype boards are a notorious problem for just about any high speed project.If the pulse is being radiated, you can probably insert a 330 Ohm resistor in series with the pin to slow down the edge and eliminate reflections.

author: leonababy
author_rank: Regular Contributor
timestamp: September 01, 2019, 05:41:06 pm
content: Good question. The decoupling caps I have used are only at the chips - not distributed along the power rail strip. And they are plugged into the board sockets, not soldered to the chip leads - meaning straddling the chip. I have some DIP carriers here with solder lugs - maybe I could mount the LM9022 and some decoupling on that, so the caps are directly connected? Mine are more like 0.1 and 0.01, and 10uf electrolytic. There are two recommendations in 7841/9022 datasheets, for 10uf or 20uf. I haven't tried other values yet - and yours seem significantly different, especially on the low end.

author: leonababy
author_rank: Regular Contributor
timestamp: September 01, 2019, 07:46:47 pm
content: After looking over an LDO datasheet, I believe it will do what I want. For $0.30 and the cost of a small cap, it will be good insurance. I see that LDO's are specified where one circuit element is affecting another on the same rail, which is what I have. I can appreciate there are things I can likely do to reduce the ripple on the rail - and I will try varying some capacitor values and locations, and neaten up the wiring. It would be nice to isolate the LM9022 with its own regulator, but it uses a lot more current and I don't want to lower its Vcc.

author: StillTrying
author_rank: Super Contributor
timestamp: September 01, 2019, 09:06:13 pm
content: I can't see how 100mv of noise on the 5V DC effects the HCPL-3700. At only 100Hz you've got options to put a small cap. filter on the AC or DC side, across pins 2 & 3 on the AC side."For ac input applications, a filter capacitor can be placed across the dc input terminals for either signal or transient filtering."https://docs.broadcom.com/docs/AV02-2107EN

author: David Hess
author_rank: Super Contributor
timestamp: September 02, 2019, 01:06:12 am
content: Assuming that there is not a ground loop, RLC power supply decoupling with a parallel resistor is usually the best solution. This is effective at either the sensitive circuit or the circuit generating the noise or both in extreme cases.

author: djacobow
author_rank: Super Contributor
timestamp: September 02, 2019, 02:09:27 am
content: I just had a scan of the 531x datasheet, and they seem to indicate a 50/60 Hz signal, not double that. I don't understand your decision to abandon the $0.60 4n28 for the $4 hcpl3700. For the 4n28 zcd, all you need on the ac side is current limiting resistor and some diode that can withstand the negative mains. On the open collector output, all you need is a pull-up resistor. That's your 60 Hz pulse right there.I must be missing something.

author: leonababy
author_rank: Regular Contributor
timestamp: September 03, 2019, 10:34:16 pm
content: Quote from: djacobow on September 02, 2019, 02:09:27 amTo address your observations, my goal was to get a 120 Hz clock from a 12V 60 cps AC source. Both a ZCD and the HCPL3700 do this. Most applications of the 3700 appear to be for power detection GO, NOGO, and the output is filtered. I am not filtering, so I get a window in both directions. The 3700 allows user modification of the thresholds using a series and also a parallel resistor - I used these to adjust the pulse width to a minimum - about 1.2ms. With the ZCD, I had 800us. Otherwise the outputs are the same with the exception of phase relative to 0V, which is not critical. I am using the trailing edge of the pulse to "window" a gate being made by the clock divided by 2, in order to create a blanking time between digits.To address economy, you are correct in the relative cost. I am using a DIP version of the 3700, which is NLA. I bought them you-know-where, for about $1 each. They could be fakes, but they work perfectly with the exception of the noise issue that is not the fault of the chip - which I have solved. I had the pull-up - that was not the issue. It was the noise on the rail. An application note for the 3700 shows the 2x pulses graphically:http://www.slottechforum.com/slotinfo/Techstuff/CD2%20Diodes%20and%20Transistors/Opto%20and%20LED/Optoisolators/HCPL3700%20app%20note.pdf

author: leonababy
author_rank: Regular Contributor
timestamp: September 03, 2019, 10:44:05 pm
content: Quote from: rstofer on September 01, 2019, 05:30:59 pmYour tips got me motivated to what I realize is basic noise troubleshooting. We used some really nice proto boards back in the 80's at GE, which had +Vcc strips on one side, and GND on the other, between all the rows. Decoupling caps along top and bottom, and they were wirewrap and not these sockets. So I never had to confront this on-board noise issue, only signals going off board.I added a few 100uF caps along the proto power strip, and changed my layout a bit to kind of "star" the Vcc to each element. Perhaps the real culprit was a ground loop described below. The noise is reduced significantly, and the 3700 output is no longer being affected. Thank you for kicking me into action and being pleasant about it!

author: leonababy
author_rank: Regular Contributor
timestamp: September 03, 2019, 10:51:33 pm
content: Quote from: David Hess on September 02, 2019, 01:06:12 amI believe I may well have had a ground loop - a good sized one. This was one of the alterations I made. Basically, I had a separate pair of wires that went to the source of input to the breadboard, for no good reason other than I was testing the 3700 by itself without the board powered. This may have been the main issue. I thought about that before I saw your reply - I have little experience with such troubleshooting but I have had ground loops in a couple of situations. Experienced people will read this and say "you did what???" I was just being lazy without consideration of consequences.

author: leonababy
author_rank: Regular Contributor
timestamp: September 03, 2019, 11:00:55 pm
content: Quote from: StillTrying on September 01, 2019, 09:06:13 pmAC side - this appeared to me to be to filter noise on the AC input, so I did not try it since the noise was on the rail. DC side (of bridge) - same reasoning as AC. DC output - adding capacitance here is for filtering the output pulses so that a change in output only occurs when the AC comes on or off - for app's that desire this function. This would slow the signal down of my pulses and wreck the shape of it, and it may not solve the problem that I had, was my interpretation.