0

I am making a DIY water changing system for my reef aquarium. I have some peristaltic peristaltic pumps and a .NET IOT app (am professional .NET developer) that controls the pumps.

The last piece of this puzzle is high/low water detection. I'd like to do this with metal probes rather than any sort of float sensor that may be more prone to failure. I've experimented with TDS sensors such as this one, but it does more than I need it to and I'd like like to avoid 2 additional breakout boards per sensor. I just need to tell if two wires are shorted or not with as little current flowing through the water as possible so as not to harm the fish.

My working example uses one wire connected to a GPIO INPUT_PULL_UP pin. The other is connected to ground. I sample the input pin every 100ms. When there is no water, it reads HIGH. When submerged in salt water, it reads LOW.

I am a novice when it comes to basic circuit design like this. Am I doing anything catastrophically wrong? One of these "sensors" will be continuously submerged and always read LOW when sampled. Am I unknowingly frying the internal resistor or passing current through the water?

Thanks

3
  • 1
    This seems to be a basic electrical question. The Pi is irrelevant.
    – joan
    Commented Sep 4 at 8:57
  • 1
    "reef aquarium" so salt is involved? FYI, any current passing between electrodes in water (with salt) will likely case chemical reactions to occur. I'd search for a solution that isolates current and water. Maybe a reed switch and floating magnet. This question belongs in the electronics stackexchange web site.
    – st2000
    Commented Sep 4 at 12:55
  • I’m voting to close this question because it is devoid of any prior research; research is fundamental to asking a good question.
    – Seamus
    Commented Sep 4 at 19:43

2 Answers 2

0

Q: Am I doing anything catastrophically wrong?

If you include poisoning your fish to be "catastrophically wrong", then the answer to this question is, "Yes".

If you want to avoid this "catastrophe" perhaps do some research into the process of "electrolysis".

Perhaps better yet would be to test your "water level detector" in a jar of plain water (with no fish in it). Then, after a day or two, try to identify the bubbly green scum that has floated to the the water's surface. At least this will avoid poisoning your fish.

0

An alternative solution would be to use an ultrasonic distance sensor, such as an HC-SR04.

The sensor measures the time it takes for an ultrasonic sound signal to travel from the sensor to the water surface and back to the sensor.

There are many guides (e.g. https://pimylifeup.com/raspberry-pi-distance-sensor/ , https://tutorials-raspberrypi.com/raspberry-pi-ultrasonic-sensor-hc-sr04/) on how to connect the sensor to a Pi.

You would need to write code to convert time to distance. The references above include example code, in Python.

A word of warning: Many HC-SR04 models are designed to work horizontally (e.g. how close an obstruction is to your model car), while you want to measure vertical distance. Product descriptions rarely mention this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.