RF interference and grounds - Page 1
Forum section: electronics / rf-microwave

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 09:25:57 am
content: I've had this lightning detector running for several weeks now, and its been going well.http://techlib.com/electronics/lightningnew.htmIt is connected to an arduino which counts pulses, and puts the data on a webpage. The arduino is powered by a sealed-lead-acid batt, solar charged. The lightning detector runs on a pair of C-cell alkalines.Problems started when a few cloudy days started hammering the poor battery to low voltages, so I hooked up a mains charger in parallel with the PV panel, and charged away. I noted when the charger was charging, or even just plugged into the wall and turned off, that the detector would report a lot of spurious pulses, I assumed were coming in from the house earth pin.I decided to use an optocoupler between the detector and the arduino, completely separate them, and this worked well on the bench. The 4N37 optocoupler is mounted inside the lightning detector box, and a cable exits the box taking the photo-transistor output to the arduino board.But - if the charger is on now, the detector just flashes consistently, at least 15-20Hz I'd estimate. Fiddling about I worked out the cable from the optocoupler to the arduino is now a floating ground from the arduino/charger, and has become an antenna, moving it closer to the detector's antenna/coil really speeds up the impulses.So with all this background..... what can I do? I'm starting to think that the optocoupler wasn't a great idea - preventing this noise from getting to the detector would be the obvious solution, but how do I go about this? Thanks for any advice anyone can offer....

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 24, 2021, 10:09:43 am
content: Congratulations, you've improved the sensitivity!This probably isn't even sarcastic; if the detector is something like a wire hanging around, and the receiver bandwidth is broad, then that (RF) ground connection via the charger just massively increased the counterpoise for your antenna. And then yeah, any nearby static discharge will go right in -- it might as well be distant lightning, eh?A survey of EMC requires analyzing the entire system. We need to know all devices from wall outlet to antenna to com port (is this connected to a computer? or, if it puts it on a webpage does that mean it just has a wifi shield, or it's Arduino on ESP32 or something? see, there are hundreds of possibilities, we can only guess!), and how they are laid out and wired. It can even matter just how shields are connected (if any).The circuitry around the detector will be most important, but anything making loops (like a mains to com port loop) is a prime suspect, and then everything in that loop is a concern.Also, anything that plugs into mains is suspect. It could be poorly filtered by itself, or could be other devices in the building throwing off noise -- depending on how sensitive your detector is.Tim

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 11:03:23 am
content: Quote from: Lee697 on May 24, 2021, 09:25:57 amHere's an idea, add a second battery, then add a circuit monitoring the "active" battery, that is the one currently feeding the detector, when the battery level goes below a given value, the circuit will switch the detector to the other battery and connect the first one to the charger (and then do the same for the now active battery), this way the detector will always be fed using a charged battery and the auxiliary circuit will switch between batteries A and B as needed

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 11:08:20 am
content: Quote from: T3sl4co1l on May 24, 2021, 10:09:43 amThanks.... I think!Before I added the optocoupler, the detector (LD) shared a ground with the arduino, and is connected to earth (galvanised post 500mm deep), its antenna is a metre or so of insulated hookup wire. The LD output - a low going line, was directly connected to an digital input on the arduino (wifi). If there was no lightning activity on radar for >400km, the LD would show nothing for hours on end, if storm cells were noted on radar it would pick up activity, even out to about 400km (I think!). The arduino gets power from a SLA, and uses a 7809 to drop the voltage a little before its own reg makes its 3.3v.Without the charger plugged in (or especially charging), its all good.I might be better off just picking up a bigger battery and panel, I might be able to navigate a few cloudy days that way!

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 11:10:41 am
content: Quote from: A.Z. on May 24, 2021, 11:03:23 amI've thought of a battery changing system.... more microcontrollers!The actual detector just uses C-cells, so no charging needed, the arduino uses a lot more power, so needs the SLA/charging.....

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 12:26:48 pm
content: Quote from: Lee697 on May 24, 2021, 11:10:41 amWell, no, a simple monitoring device can be realized with some analog components, no need for a microcontroller, all in all it's a voltage monitoring circuit controlling a flip-flop which in turns switches a relay to change the connection of the two batteries (assuming I didn't overlook something, that is), anyhow...QuoteAre the detector and the arduino hosted inside the same enclosure ? I'm asking so, since the Arduino has a clock and the clock may interfere with the detector, so I think it could be a good idea hosting the two stages inside separate shielded boxes, also, the noise picked up by the detector may either come from the arduino or may be hum or noise generated by the charger, so adding a filter stage between the battery and the arduino board and some choking/filtering between the detector an the arduino may be a good idea

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 24, 2021, 12:45:45 pm
content: When I say "all", I really do mean"all". Like, photos showing everything wired up, or a diagram showing every wire and the relative positioning of everything, or a description to the same effect -- it's not going to be a brief description, a picture is very much worth a thousand words here. Even just the ground rod doesn't tell me much -- I see your AU flag, but to me the best guess I can make of that is, well, 90% of the island is a desert, right? So in all likelihood you've got what amounts to this...So we really needa lot more detailhere to be able to say anything much at all. Rest assured youcannotgive us "too much" information. We're professionals here, some of us anyways, and all are helpful.I will note, the very short antenna suggests very high frequency content (100s MHz, down to maybe 10s MHz if it's sensitive to electric fields -- what's the circuit? See, more detail needed already--), which is the same stuff you get from nuisance ESD, converter noise, etc. A lightning detector is probably better off at lower frequencies, where those can be at least somewhat filtered out. The classic version I recall, is simply tuning an AM radio to a dead band; that's in the 1MHz range. You'd probably prefer a magnetic (loop or loopstick) antenna for that, which may also grant some immunity to nearby electric fields (ESD).Tim

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 12:59:54 pm
content: Quote from: T3sl4co1l on May 24, 2021, 12:45:45 pmHi Tim, bad day there ? No need to be so harsh, come onThe circuit was in the initial post, and is herehttp://techlib.com/electronics/lightningnew.htmnothing fancy as you can see (and then I like the one shown herehttp://techlib.com/electronics/spherics.htmmuch more)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 24, 2021, 01:56:07 pm
content: I seem to have a bad habit of skimming over links--thanks and my apologies.Looks like it'll be quite sensitive to lots of signals, roughly tuned in the 200kHz range but I suspect the transistor base loading (or the Q of the 10mH itself) will keep it quite broad; and capacitance from nearby sources, to the circuit, may be an unintended route as well. (Best constructed on ground plane, or stuffed inside a shield can with power and output feedthrus filtered properly.)That's also right in the range of 1-3th harmonic of most power converters and, a ground loop, or actually poor grounding more likely I think, would easily couple that noise into the circuit, tripping it.Mind, it's not a very good circuit in general, being dependent on temperature and battery voltage.I wonder if it's also oscillation-prone, such as due to the tuned-base front end (there's a capacitive path from base to emitter, generally a bad idea -- it may be biased at low enough current that it simply doesn't have enough transconductance to oscillate in that mode), or due to a "motorboating" effect where the supply pulls down due to the rather stiff output (~3mA in the Schmitt trigger, plus whatever the attached LED, device and load draw), and when it rebounds on turn-off it triggers the input stage again (through the same capacitive path).Which is basically to say, the 0.1uF below the antenna, should be referenced to emitter (+V), not GND. 'Cuz, that's what the base is referenced to.Which would also be prone to tripping due to supply ripple on that line -- which could be an even simpler explanation for charging interference. Differential noise is easier understood -- perhaps it has been considered already, so it seems reasonable to make a first assumption that common mode noise is the problem.The magnetic version seems more promising. Although maybe that's what's in use, after all? But the mention of the antenna wire should rule that out.Tim

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 02:30:57 pm
content: Quote from: T3sl4co1l on May 24, 2021, 01:56:07 pmNo problems here, don't worryAs for that "lightning detector" (the first link I posted) it was designed as a "beginners project" and that's why it's quite simplified, if one follows the build directions "by the book" the resulting circuit will work almost always and errors will be easy to detect/fix, but for sure the "sferics detector" (second link I posted) is far better than that simpler versionThat being said, I believe that the problem may be due to the Arduino board generating noise (oscillator...) and due to some more noise generated by the battery charger, as I wrote, I believe it may be possible to improve things by adding some shielding to the arduino board and some filtering stages along the arduino power line, all in all that circuit wasn't designed to be interfaced to a computer but just as a "toy" showing an indication of thunderstorms, and willing to use a similar circuit for data collection and/or computer interfacing I think I'd go for the "sferics detector" which works much better

author: fordem
author_rank: Regular Contributor
timestamp: May 24, 2021, 02:44:24 pm
content: Wouldn't it be simpler to add more "autonomy" to the solar power system? Add more battery storage to allow longer run time and more PV to keep it charged.

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 02:55:37 pm
content: Quote from: fordem on May 24, 2021, 02:44:24 pmAdding more or bigger batteries would allow longer run time for sure, but the problem is that when the solar charger kicks in, it generates noise which is picked up by the detector, that's why I believe that adding some filtering/choking and shielding the units may help taming the issue

author: richard.cs
author_rank: Super Contributor
timestamp: May 24, 2021, 03:33:58 pm
content: Quote from: A.Z. on May 24, 2021, 02:55:37 pmIs the solar charger some kind of maximum power point tracking type? It will have a switching regulator in generating some noise, and it probably won't have been designed to be quiet because in most applications it's not important. How about loosing the MPPT and connecting directly to the battery? (With a linear shunt regulator if the panel is big enough to worry about overcharge).An alternate approach, you already have an optocoupler separating the micro and its power supply from the detector, you could replace it with a length of cheap plastic optical fibre and TX/RX modules and separate them as much as you like.

author: A.Z.
author_rank: Super Contributor
timestamp: May 24, 2021, 03:41:34 pm
content: Quote from: Lee697 on May 24, 2021, 09:25:57 amWait a second; re-re-re-reading, sounds like the problem isn't the solar charger but the mains charger, in such a case the latter (mains charger) probably has BAD filtering and is introducing noise in the circuit, try choking the AC line going to the charger and add some decent filter/choke to the DC line going from the battery to the Arduino unit

author: radiolistener
author_rank: Super Contributor
timestamp: May 24, 2021, 05:10:15 pm
content: Quote from: Lee697 on May 24, 2021, 09:25:57 amMost of all your charger is based on switching mode converter (99% of them are switching mode and 99.999% of solar chargers). It means it generate noise on lighning detection bands. So your detector will see your charger as a lot of lightnings. You can try to replace charger with linear power supply. It can help a lot.Switching mode power supply, DC/DC or solar panel controllers have very high noise below 500 kHz. And this is where lightning detector work. So, the good solution here is to remove (at all) any kind of switching mode PSU and put your lightning detector as far as you can from any switching mode circuit.

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 08:51:08 pm
content: Quote from: A.Z. on May 24, 2021, 12:26:48 pmDifferent enclosures, one cable (alarm wire, 2 conductors) between them, being the arduino ground and collector of the optocoupler transistor. It is this cable that brings in the interference - I can move it away from the detector, and pulses slow and stop, bring it in and it ramps up 1/x with distance. I wondered how to filter this - I clipped a ferrite over the neg wire of the charger at the battery on the weekend, didn't make much difference, but then the optocoupler wasn't in place.Previously the arduino ground was directly connected to the detector ground (and earthed nearby - damp soil), and this issue with the charger was there, but far less, maybe 20 spurious impulses per hour, rather than 20/s......

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 08:57:58 pm
content: Quote from: T3sl4co1l on May 24, 2021, 12:45:45 pmAfter some recent floods, maybe more like this??[ Specified attachment is not available ]I'm about to head off for work, will try and sketch something out - the circuit diagram is the first one in the link I posted. The optocoupler is in parallel with the LED in the circuit, so when the pulses line goes low, its diode is on. The collector/emitter of the opto-transistor leave the detector box to the arduino, funny enough, draped over the inductor coil of the LC tank! This needs revision in V2....

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 09:11:32 pm
content: Quote from: T3sl4co1l on May 24, 2021, 01:56:07 pmYep, its a simple circuit, and very prone to interference (I guess lightning is just the ultimate interference anyway??) - inside the house it carries on nicely, reacting to switches being flicked, static from polarfleeces being removed, all sorts. But out in my observatory, without 240V (usually), its quiet unless there are storms on the radar, so it has been working fine.The circuit author (Charles Wenzel) has actually sent me a couple of the bigger inductors to make the magnetic version, which I'll try, but I just wanted to get this one all finalised..... famous last words!

author: Lee697
author_rank: Regular Contributor
timestamp: May 24, 2021, 09:56:55 pm
content: Quote from: fordem on May 24, 2021, 02:44:24 pmMight be the easiest/cheapest/simplest option too.....

author: Lee697
author_rank: Regular Contributor
timestamp: May 27, 2021, 09:54:46 am
content: After some hairpulling, I decided to just bypass the optocoupler, and use it directly connected as it was before, and working well. But even then the thing was triggering every few minutes or so, and with no weather visible anywhere on our 256km/512km radars, I was sure it was spurious.I disconnected the charger from the battery, no change....Turns out if the observatory is connected to house power at all, even with the outlet switch off, noise in the wiring is setting off the detector. The charger may not be the problem??I picked up a 40W solar panel and a 26Ah SLA batt today, should alleviate the need for 240V power hopefully....

author: A.Z.
author_rank: Super Contributor
timestamp: May 27, 2021, 10:04:19 am
content: Quote from: Lee697 on May 27, 2021, 09:54:46 amYou may try adding a line filter to the AC connection and maybe also adding some chokes to the various power wiresThe issue may also indicate that the AC wiring has poor ground, in such a case it would be a good idea having someone check it since it may represent a safety risk

author: mansaxel
author_rank: Super Contributor
timestamp: May 27, 2021, 10:19:19 am
content: As has been written upthread, expect to get a smörgåsbord of interesting interference from the buck/boost circuitry of most solar "boxes" -- this particular field of EE has a very bad track record WRT interference.In Sweden, we've got a few domestic installations that have been told to shut off or face stiff fines, because they are too close to airports or military radio sites. These were no hobbyist installs, but bought turn-key from retailer with install and all.Especially harsh are the ones where there are "optimisers" to compensate for partial output, like from shaded panels and similar.

author: Lee697
author_rank: Regular Contributor
timestamp: May 27, 2021, 08:49:59 pm
content: Quote from: A.Z. on May 27, 2021, 10:04:19 amThanks - I'll look into the filters, and have the earth checked. I did have to have the earth fixed in the garage last year, I changed a light fitting (turned off) and received a nice AC shock off the earth wire, the sparky found that earth was loose in the fuse box and properly bonded everything. The outdoor point the observatory is hooked to needed to be removed/replaced by wall cladders several years ago.... I wonder if it was put back on correctly. I'll test it this pm......

author: Lee697
author_rank: Regular Contributor
timestamp: May 27, 2021, 08:51:23 pm
content: Quote from: mansaxel on May 27, 2021, 10:19:19 amI know there is a LOT of stray RF signal around our main household solar inverters, but they are a long way from the detector, the little 50W inverter in the observatory has so far proved quiet, and not a problem at all.....