0
\$\begingroup\$

I basically need to detect if the switch is closed (the application is a water level sensor where current flows to the grounded tank through the water). Is this a good design, or how can it be improved? The op-amp would be normally positive but go negative when the switch is closed. The resistance and switch at the bottom represent the water. The resistances would be chosen to work well with the resistance of the water(so the values are just illustrative).

enter image description here

\$\endgroup\$
8
  • 1
    \$\begingroup\$ This circuit will not work properly, when the switch is open, both inputs of the opamp or comparator get the same voltage and the output of the opamp will have an unpredictable value. This is not how an opamp or comparator should be used. Where does Vout go to? If it connects to the input of a microcontroller then you do not need an opamp. \$\endgroup\$ Jun 24, 2020 at 11:40
  • \$\begingroup\$ @Bimpelrekkie: The switch represents two contacts in water. Some sort of comparator will be needed, but I don't think just a couple of wires hanging in the tank connected to an opamp going to be very useful or reliable. \$\endgroup\$
    – JRE
    Jun 24, 2020 at 11:47
  • \$\begingroup\$ Consider using a PNP transistor with the base connected to the tank \$\endgroup\$
    – user253751
    Jun 24, 2020 at 12:24
  • \$\begingroup\$ Thank you @Bimpelrekkie, I will try to make a design that switches between high and low - my knowledge of opamps is not so good. Thought it would just be zero when both inputs are the same. \$\endgroup\$ Jun 24, 2020 at 13:06
  • \$\begingroup\$ Tip: look at what others do, there are plenty of "plants need watering" detector projects, look at what circuits they use. Learn from that. Designing your own "from scratch" isn't going to work when you're a newbee at electronics. \$\endgroup\$ Jun 24, 2020 at 13:18

1 Answer 1

1
\$\begingroup\$

As indicated in the comments, this circuit you propose for water level detection isn't going to work. There are a couple of "water level detecting" circuits and even products out there. I've used a simple npn transistor to detect when water is present on two electrodes but I'll provide you with some better examples. Also tap water resistance can vary depending on what impurities there are in the water and what distance you measure the resistance. From my experience water resistance can be in the 100's of kilohoms. Just today I measured resistance of container of water with my multimeter where electrodes were placed 12 inches apart, it gave a resistance of at least 300kohm.it may be different where you are and your set up. In any case:

For the first circuit shown, there is a ground electrode at bottom of water tank and another electrode placed at certain level within tank. When water is below the level, the circuit will output 0V. When water reaches level, circuit will output 12V. This circuit is based off the idea of a pnp Darlington pair.

enter image description here

For the second circuit shown, there is also a ground electrode at bottom of water tank and another electrode placed at certain level within tank. When water is below the level, the circuit will output 12V. When water reaches level, circuit will output 0V. This circuit is based off the idea of the complementary feedback pair or Sziklai pair.

enter image description here

Note that for both circuits, they use 12V supply, two transistors and resistor values that I determined based on 330kohm water resistance. The R1 3.3kohm resistor is optional but it prevents too much base current if resistance of water reached a low value. If you use a different supply voltage then the resistance of resistors would need to be changed to give better performance.

\$\endgroup\$

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.