Hello!
This is in continuation to this thead, since I can not reply..
I have made the "sensor" by just cutting a small gap in a two wire cable such that the copper wires are exposed but not touching, see very vague drawing below:
Of course my cut was not so precise. Nevertheless, it worked. I tried it by adding a drop of water on top of it, then drying it out, and it worked flawlessly. I even tried covering it with dirt, then adding water to the dirt and it again worked. Needless to say I'm very happy with the result.
I guess I should also mention my intended use - I want to install it in concrete/brick walls just below water pipes so that eventual leaks can be detected early - combined with a solenoid water valve, thousands of dollars of damage can be potentially prevented. This being said, the wire will most likely reside in some kind of sand/cement mix.
By reading the linked thread and the resources given, I also made the code alternate the signal, to supposedly prevent corrosion:
#define A 16
#define B 17
int state = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
state = !state;
int _A = state ? A : B;
int _B = state ? B : A;
pinMode(_A, OUTPUT);
pinMode(_B, INPUT_PULLUP);
digitalWrite(_A, LOW);
if (!digitalRead(_B)) {
// leak detected, perform action
}
delay(1000);
}
It is truly so simple, that I couldn't even bother adding a schematic, there's just two wires connected to pins 16
and 17
of my controller that join together as a single cable with cut slots in the insulation.
This is not really related to the question but I'm going to mention it just to spare some considerations or eventually help out anyone trying to built this as well. The cable needs to be twisted to prevent EMI and also a small capacitor can be added between the two pins - advice gotten from here.
So getting to the real question - when working on old electrical installations I've seen AC cables that have been severely corroded, which means that the AC electricity alone is not enough to prevent corrosion. I obviously need to make sure the copper does not corrode or else the "sensor" would not work. What do I need to do to make sure the copper will not corrode?
In case there's not much I can do for zero dollars to achieve my goal, I'm not very familiar with metals, so I might be wrong, but I believe aluminum is more corrosion resistant than copper. Would an alternative solution be to just use aluminum cable instead?
Thank you for your attention!