I have properly connected and coded it. It works fine in my test room. However, when I deployed it in its final location I’m experiencing spurious counters in the rain gauge when it is not raining.
In the following image you can see the data I get:
This data corresponds to the rain gauge during a week (it didn’t rain in the whole week so all this data corresponds to spurious counters in the rain gauge). As you can see, there is a pattern which is repeated every day. That is, it starts getting wrong counters and after a while, it suddenly stops and spurious counters disappear.
I have my rain gauge installed on top of a warehouse where there are machines working. I noticed that this pattern where there are spurious counters corresponds to the time were there is activity in the warehouse. During the night, there is no activity and that’s why the rain counter is 0 (since it doesn’t rain).
Notice also how the last period where the rain is 0 is longer than the others. This is because it corresponds to the weekend where there is no activity in the warehouse.
From this data I concluded that the warehouse activity is influencing the rain gauge.
I discarded any mechanical vibrations so I think that this is caused by some electromagnetic interference.
The questions are:
1- Is this rain gauge sensor so sensible to electromagnetic interferences?
1- Is this rain gauge sensor so sensible to electromagnetic interferences?
It uses small-gauge unshielded wires; anything that makes EM interference might skew it
2- How could I solve this problem?
You have 3 options, listed in presumed order of difficulty:
Move the sensor
Create a faraday cage around the apparatus (pretty easy/neat…youtube examples) or wall it off with some other ferromagnetic material (ie lead plates around it, if’n you have some)
Compensate for the drift in your code, subtracting the erroneous stuff
I responded on a different thread, but this thread is particularly great (in that the OP had some really good info on correlation between EMF events and the triggering).
If you think your rain count is triggered when there is wind gusts (as an example) then you need to ensure the rain bucket is secured so it cannot sway or move (imagine a thin tall pole and on top of that pole is a bell - when the pole sways the bell rings).
If you think the rain bucket has no movement, then it could be EMF-related (what the OP) was describing. The use of a ferrite bead is a known solution; you run the RJ11 telephone cable through the bead and it cuts down on common noise getting into it (not sure how old you are, but if you ever saw an old Playstation, GameConsole, old telephone/cellphone power cable and noticed some funny looking bump or donut secured to it that is an external Ferrite bead). If you are running the gage next to WiFi you may want to try a 61 material; if you do not think there is any such interference then perhaps 75 material, or 43 material. Three such examples below: