Hi,
we have a tipping bucket rain gauge connected to a CR1000 over a fairly long distance (50m).
We use the P2 input and the PulseCount() Switch Closure command.
We experience a 50Hz noise being picked up and interpreted as a switch closure. Potentially it comes from the power supply which is connected to a PS100, because we don't see the noise when running the logger on the 9Ah battery with the charge wires to the PS100 disconnected.
I measured the voltage between the P2 and GND terminals and it reads 2.6V.
When we trigger the switch, we experience a bouncing signal and usually read many switch closures for one tipping.
What are your recommendations for filtering the noise and bouncing of the signal?
That sounds like the classic combination of noise and switch bounce! Dealing with a long 50m run definitely makes it tougher.
For the 50Hz noise, since it goes away when running on battery, try adding a small capacitor (maybe 0.1µF or 0.01µF) across your P2 input and Ground terminal. That should help filter out the AC noise before it gets to the logger.
For the switch bouncing, the quickest fix is usually using the built-in debounce. Are you setting a minimum closure time (debounce) in the PulseCount() instruction? Upping that to something like 10-15 ms usually fixes the extra counts from bouncing easily!