# Question About A Basic Circuit With A MOSFET

#### PGB1

Joined Jan 15, 2013
110
Hi All!
I was studying about types of & uses for MOSFETs and came across a Water Alarm circuit that has me puzzled.
This is a circuit where the author of an article at https://www.cnet.com/how-to/how-to-build-your-own-flood-sensor/ used a dollar store window alarm to make a device that will sound an alarm when water touches the probes. (His circuit diagram is attached with a couple of my notes added.)

There were several things about the circuit design that I could not understand and couldn't find enough information on various references to help me figure out answers. So, if you don't mind some probably very basic questions, here we go...

A) Looking at the diagram, it seems to me that the wires I labeled "P-2" & "P-3" will end up making a direct connection between the positive and negative battery poles when the sensor probes are in conductive water. This is visible in the diagram where the source, the water probe and the negative terminal all come together. The other probe wire is on the positive battery terminal. Why does not the battery self-destruct when the two probe wires are 'joined' through the water?

B) I think I am correct that the purpose of the resistor is to protect the MOSFET device. Did I get that right?

C) How did the author choose the value for the resistor? (The text of his article shows it is 3.3 Meg Ohm.) The batteries are (3) 1.5 volt coin cells in series for 4.5 volts. I worked the numbers through Ohm's Law in various combinations and am still stumped.

D) Why did he use a MOSFET at all? Couldn't one take the alarm as-found and then interrupt one of the wires to the battery and send it to the water. Next one would take a wire from the water and send it back to the battery? Is the MOSFET to make it so a lower voltage (than the battery 4.5 volts) to make the alarm sound? My guess is that since water will have some resistance, a lower voltage trigger will allow the alarm to sound where the full 4.5 volt battery would not, thus the MOSFET. Did I get this correct?

Thank You all for helping me learn about the use of the MOSFET and the resistor calculations for this circuit. I appreciate the education.

Paul

#### Attachments

• 258.9 KB Views: 79

#### bertus

Joined Apr 5, 2008
20,240
Hello,

There is a mistake in the given circuit.
The sensor is accross the battery, so the mosfet will never switch.
I have drawn a red line where the sensor should be connected:

Bertus

#### AnalogKid

Joined Aug 1, 2013
8,259
The diagram is incorrect.

A MOSFET has an input impedance that is near-infinite, tens of megohms. Because of this it is extremely sensitive to external electrical noise. One way to protect it, and to guarantee that it is turned off when the probes are not in water, is a large value resistor from the gate to the source, as shown. This resistor has to be "overcome" by the input signal when the probes are in water, so its value depends on the resistance of the water.

The problem with the diagram is that the probe wire P3 is connected directly to GND. It should be connected directly to the gate.

Water is not a very good conductor of electricity. Its resistance probably is too high to pass enough current to run the alarm directly. That is why a transistor switch (actually, in this circuit it is a voltage to current converter) is needed.

Bertus posted while I was typing.

ak

#### AlbertHall

Joined Jun 4, 2014
9,040
P3 should connect to the MOSFET gate not the negative battery terminal.

Water has a fairly high resistance. The circuit has the battery positive connected to one of the water sensing electrodes. The other water sensing electrode is connected by the resistor to the battery negative forming a potential divider. The resistor value is selected to match the resistance between the electrodes when there is water around. The MOSFET takes the voltage across the resistor and when that voltage is high enough (when water is around) the MOSFET turns on and the alarm sounds.

#### PGB1

Joined Jan 15, 2013
110
Thank You Bertus, AnalogKid & AlbertHall for taking the time to reply with very helpful & informative explanations. I appreciate the corrected drawing Bertus.

Now, thanks to your explanations, the MOSFET's importance and function in this circuit makes sense to me.

I'm still kind of confused about the resistor value.
AlbertHall mentioned that the resistor value is selected to match the resistance between the electrodes when water is around. I experimented and found that the resistance of the water changes quite a bit.

A plastic container of Detroit tap water yielded 1.5 Meg Ohm with the probes a maximum of 1/2" apart. The 1.5 Meg Ohm was the minimum the meter displayed, even with the probes almost touching each other. As expected, the resistance increased as the probes were moved farther apart, eventually reaching the meter's open circuit reading.
Then I tried spilling water on the concrete basement floor to create a puddle. After a few minutes, the resistance began decreasing. I, perhaps incorrectly, assumed that this was due to the salts in the concrete dissolving into the water. In that situation, the resistance settled at just over 6 K-ohm range with the probes 1/2 inch apart or less. Widening the distance between the probes did not increase the resistance as much as it did in the water-in-a-container test. For fun, outside, I tried the same experiment to see if temperature changed resistance, but the water froze solid as I was pouring it. (It reminded me of my father, brothers & I dumping garbage cans full of water on the lawn to make a skating rink way back in the early 1960's. We'd marvel at how the water froze solid while it still was spreading.)

My remaining confusion is-
With all of these variable resistances, how would one select the proper resistor- or would the choice be a resistor that will always be of higher resistance than the water will provide across the probes?

And, to make sure I understand correctly-
With the probes dry & having an assumed almost infinite resistance between them, current will flow from the negative battery terminal to the Gate, but the voltage will not be high enough to cause the MOSFET to connect Drain & Source?

I apologize if I am not understanding & asking elementary questions. I'm trying....

Thank You All again for helping and for the lessons. Any day that I can learn something is a very good day. (But, when my brain learns something new, something old falls out!)

Enjoy Today!
Paul

#### AlbertHall

Joined Jun 4, 2014
9,040

#### PGB1

Joined Jan 15, 2013
110
Thanks for the link and explanation, AlbertHall. After reading it, I remembered that where I used to work one of the tools I had to test for proper chemical treatment of a cooling tower's water was a conductivity meter. It read in microsiemens. The treatment was molybdate, a conductive metal.

Thanks also to RichardO for your linked post showing your alarm & schematic. For fun I believe I'll build one! I have an outdated 9 volt smoke detector and perhaps before I recycle it, I'll loot the buzzer to test if it would make a good annunciator for your design. Should be a fun adventure!

#### Jon123

Joined Apr 1, 2018
1
Thanks for the link and explanation, AlbertHall. After reading it, I remembered that where I used to work one of the tools I had to test for proper chemical treatment of a cooling tower's water was a conductivity meter. It read in microsiemens. The treatment was molybdate, a conductive metal.

Thanks also to RichardO for your linked post showing your alarm & schematic. For fun I believe I'll build one! I have an outdated 9 volt smoke detector and perhaps before I recycle it, I'll loot the buzzer to test if it would make a good annunciator for your design. Should be a fun adventure!
Hi, Just curious, have you tried the modified circuit and does it work?

Thanks
Jon

#### Janis59

Joined Aug 21, 2017
984
Most af all possible CMOS gates has input impedance large enough to be usable straight, without of any transimpedance stage by means of BC170.
More over, for simple gates there works principle poorly documented - first came in, last came out, so they can be used for flood-pump driving without of sophisticated logics. Just put the couple of wires in two different heigths and ground plate (hopefully stainless). One NAND cell controls the one wire, another the second one. Both wires get the Vcc via some 1-3 MOhm resistor. When I used for 200 pcs stock the very old scraps from soviets costing me three cents a kilogram, then best results was at 2 MOhm. Generally, if too large, may cause a false alarm, but if too small, then sensitivity may be lost if water is rather clean. So, both outputs of NAND gates are connected to cross-link prost trigger built on the same NAND elements and it output steers the optron what steers the SCR driving the flood pump. The histeresis is gathered by adjusting the sensor-wire heigths, and only riddle is why anything may happen if both trigger inputs has contradicting input signals. Now there works that badly documented principle, and it works well.

#### PGB1

Joined Jan 15, 2013
110
Thank You Janis59 for the informative explanation. I apologize that I didn't see your answer when posted earlier. I stopped getting notices for replies to this thread.

Jon123- If you were asking about the modification Bertus showed in Post #2, I built a couple of them as he drew for us. They work great.

One uses a piece of perforated circuit project board with bare wires snaked back & forth in opposite polarity rows. The other sensor, which stays flat on the floor better, is made of 4 coins. The wires are soldered to pairs of coins. In the photo- The two showing President Lincoln's head are soldered to the green wire & the two showing the shields are soldered to the white-green wire. The gap between coins in perhaps 1/16".

They aren't the greatest looking sensors, but rather the "prototypes".

#### AnalogKid

Joined Aug 1, 2013
8,259
I apologize that I didn't see your answer when posted earlier. I stopped getting notices for replies to this thread.
I created this post so I could report it and get the moderators attention. I've mentioned more than once that alerts for watched threads randomly stop happening. As you can see, I'm not the only one. Whatever was not functioning correctly five years ago still is broken.

ak

#### -live wire-

Joined Dec 22, 2017
901
Usually you just need to refresh the page. Anyways, this sounds like a cool project. Maybe add a p-fet and have an LED on when there is no flood emergency. The best way to learn is by doing things.

#### WBahn

Joined Mar 31, 2012
25,115
I created this post so I could report it and get the moderators attention. I've mentioned more than once that alerts for watched threads randomly stop happening. As you can see, I'm not the only one. Whatever was not functioning correctly five years ago still is broken.

ak
The moderators don't have access to even explore the issue. We can't see who has or has not gotten an alert, let alone figure out whether someone that didn't get an alert should have and whether one was sent or not. Therefore we certainly don't have the ability to track down what was wrong and fix it.

I don't even know if that kind of activity if logged in the system in a way that an admin can explore it. The ONLY thing we can do is bring it to @jrap 's attention.