Detecting Water With And Without Headaches

In Texas — at least around Houston — we don’t have basements. We do, however, have bilges. Both of these are subject to taking on water when no one is paying attention. A friend of mine asked me what I thought of an Instructable that showed how to make a water sensor using a few discrete components. The circuit would probably work — it relied on the conductivity of most water to supply enough current to a bipolar transistor’s base to turn it on.

It is easy to overthink something like this, so I told my friend he should go with something a little more old-fashioned. I don’t know the origin of it, but it is older than I am. You can make a perfectly good water detector with things you probably already have around the house. My point isn’t that you should (or shouldn’t) construct a homemade water sensor. My point is that you don’t always need to go to the high-tech solution.

On the other hand, this is Hackaday, so I’m sure you want to know how to hack a water sensor out of common household items. The picture probably tells you the story anyway, but if not, read on.

What Do You Need?

The heart of the water sensor is a spring clothes pin. You also need two flat metal pieces. I’ve seen it done with pennies but you could probably use a couple of washers or pieces of scrap metal. I’ve even seen it done with aluminum foil, but I don’t recommend it. There’s one critical piece left: an aspirin. You could probably use some other things, but it has to be something hard enough to keep the clothespin open, but will also dissolve when in contact with water.

You can figure out the rest. You connect wire to the metal contacts, make a sandwich with the aspirin in the middle of the contacts and clamp it together with the clothes pin. If detecting water isn’t your thing, you might enjoy [American Hacker’s] video (see below) that uses the same idea to detect when a door opens.

More Simple Sensors

Anti-static foam, wire, Plasti Dip for an analog pressure sensor
Anti-static foam, wire, Plasti Dip for an analog pressure sensor

The aspirin and clothes pin trick is just one way to make a simple sensor. Conductive foam works well as a pressure transducer (especially if you use a little Plasti-Dip to seal it). A lot of sensors use the property of another component (like this temperature sensor). Foil seems to be a common component, too.

Many times, a component made to create something can also sense it, as odd as that sounds. For example, LEDs can act as light sensors. A speaker can work as a microphone (or, you can rip the magnet out of it, steal a relay coil, and make a magnetic speed sensor).

Rant On

If you think about it, the point I’m making is one we often see in the comments for Hackaday posts. No, not “That’s not a hack.” I’m thinking more of the latest Raspberry Pi project that turns a light on when it gets dark that will elicit a lot of comments about how you could do that with a 2N2222 (or an op amp, or a 555, or whatever your weapon of choice is).

Generally, we don’t mind projects like that. People don’t need a program that prints “Hello World!” but it is a good way to get familiar with a programming language. By the same token, sometimes doing a simple project with an Arduino, a Raspberry Pi, or an FPGA is more about getting familiar with the development environment and how to apply the tool.

On the other hand, your LED blinker doesn’t need a 2 GHz CPU with 32 GB of RAM running an RTOS. My point with these sensors is the same: there are times you really do need a sensitive, precise sensor. Most of the time you need a lot less. If you aren’t going for an educational project, take some time to think about if you are using a shovel to put sugar in your coffee.

Your Turn: Homemade Sensors

There are lots of ways to make simple sensors. Your turn. What’s your favorite do-it-yourself sensor? Drop a note in the comments and let us know what sensors you’ve hacked out of improbable things.

36 thoughts on “Detecting Water With And Without Headaches

  1. I use the sane clothes-peg, but with foil, as a low capacitance sensor/pickup, for pulsed HV, ok, lets be honest, to clip over spark plug wires whilst tinkering with car performance. Another fave is a ‘plug’ of double sided PCB material with a wire soldered to either side. It slips between the battery and battery holder on portable devices and lets me easily monitor current draw without disrupting the device. Or it can be used as an absolute switch too!

  2. great article! In other words… KISS (“Keep It Simple Stupid” or “keep it simple and safe” or “keep is super simple”). This is what hackaday could be all about (not about lifehacks, that is just a hipster term that many times results in disappointing youtube videos, but that’s a different story).

  3. Ah, the mighty clothespin switch hack. Brings back found memories of defending a back-country boyscout campsite from a rival troupe. Built up barricades using random brush & deadfall with strategic openings. Ran trip lines across the openings to said clothespin switches which were wired to trigger one time use battery powered flashbulbs hanging by thread at eye level. We then retired to our shelter and enjoyed a relaxing evening campfire.

    The yelling and cursing alerted us to the initial attack wave :-) at which point my friend & I donned our darkest clothes and an eye patch to protect our night vision and crawled through the bush with more modern 35mm hot-shoe mounted battery powered flashbulbs in our hands.

    The second wave was extra humorous as our opponents were now wise to the trip wires and were bending over carefully feeling for them. However, they had not studied tactical night vision strategies, and once they were less than 5′ from us, we’d reach up and hit the test button of our flashes – popping them at near point blank range.

    They retreated cursing not knowing where the trip lines were and never came back that night :-)

  4. The cloths pin and aspirin water sensor is quite old – I remember seeing it in an electronics magazine in the 50s or 60s as a rain detector for parked convertables.

    One improvement: put the aspirin in the concave area next to the contacts edgewise. This will keep hard to dissolve aspirin debris from keeping the contacts apart when the moist pill crumbles.

    1. It’s listed in the “Improvised Munitions Handbook” originally published in 1969, which is a bible for these sorts of improvised sensors.

      Their version makes an improvised switch by pressing two thumb tacks into the jaws of a clothespin, and soldering wires to the nails that stick through. Then put something between the jaws to break the contact.

      https://cdn.hackaday.io/images/970471481836412764.jpg

      For example, grab the plastic tab that holds a loaf of bread shut and tie some fishing line to that. Place the plastic tab between the jaws, run the line across a doorway or path, and anchor the end to the wall somehow.

      When a person enters the room/crosses the path, their leg snags the fishing line and pulls the tab out from the jaws of the clothespin, completing the circuit. (Note: The particular buzzer used is really, *really* loud!)

      https://cdn.hackaday.io/images/4928501481837034373.jpg

      The version below includes a battery and a transistor socket. Stick the wires of a flashbulb into the socket and use the plastic tab as described above to make a flash-bulb warning of intruders.

      https://cdn.hackaday.io/images/7719091481836439064.jpg

      I probably shouldn’t mention this, but mount a 35mm film canister on the clothespin, put the flashbulb *inside* the canister, and fill the canister with gunpowder.
      This makes a very satisfying flash *and* bang for unwanted intruders!
      It’s also reasonably safe, assuming you use a plastic film canister and not a metal one.

    2. I too remember that. Nothing about weather it used a relay and how the usually manually operated motor-pump was run without burnout. Also raising the top while a blow comes with the first drops… rip.

      1. If it’s a coated aspirin, that’s going to take a while. Besides, if the detection circuit is triggered by ionic flow due to sodium or other salts, the aspirin is probably not even necessary – ground water typically has plenty of dissolved calcium and magnesium (and frequently iron and sulfur) to be conductive. It’s cheaper to separate the clothespin contacts with a plastic button, and doesn’t require reloading as in the case of aspirin.

        By the way, aspirin is acetylsalicylic acid (C9H8O4, which doesn’t contain sodium).

        1. LOL was a classic case of a little knowledge is a dangerous thing! Most tablets contain (and this is why you used them) a mix of fillers and active ingredient, plus sodium bicarbonate and citric acid. The moment water hits the mix it will conduct, even before the contacts touch. The other types would be pointless and you’d have to be rather gormless to not know the difference, so much so that it is safe to assume that the HAD audience do know what type to use.

          1. Sure, MOST tablets contained such fillers and buffers, but the bottom line is that it’s the rest of the circuit that defines what’s acceptable/preferable. If all you care about is a little bit of ionic conductivity, the aspirin constituents are a red herring; the ground water is already high in ionic content. Of course, you’d know that if YOU had even a little knowledge.

        2. I suppose it depends on the application, but for a lot of uses, you’d not only want to know when a thing floods, but also that it had flooded. A sensor that tells you a thing is wet might be less useful than one that tells you that it is or has been wet, assuming you don’t spend 100% of your time within earshot of the thing.

    1. Instead of aspirin use a piece of cloth (like felt) that will get wet and start conducting current. Besides that, if it is cut in a long strip, and it wets faster than the water level rises, it could set of the alarm long before the water level reaches dangerous levels (i.e. without drowning the circuit like when you put it on the floor).

      1. I don’t know if Forrest invented the aspirin water detector trick. Was it Forrest or someone else? Would the metal contacts corrode from the aspirin, making metal to metal contact iffy?

  5. Here’s a salvage rather than a hack: Washing machines. Nearly every washing machine you see by the curb or in a scrapyard has a still-functional pressure-tube level switch (it’s how the tub knows to quit filling, given a variable load of laundry). It’s a couple of feet of plastic tubing with a large-diameter diaphragm switch at the end. If you’d like you can get the cheapest of these at an appliance store for ~$15. The “gotcha” is that the sensing end (the open end of the tubing) can’t get clogged with debris if not screened. The advantage over conventional float switches is that they can run in any tiny column of fluid, and the fluid itself doesn’t contact the switch, just the air pressure of it rising up the tube.

      1. The way I used a sump pump to protect a basement from flooding, I cut a hole in the lowest corner of the basement, lined it with a 5 gallon bucket with some holes in it, and installed the sump pump in there.

        That way, ideally water never appears on the basement floor, or at least any that does immediately runs into the bucket and so no more than about a 1/16th inch of water ever collects on the floor.

        For one, my uncle and I installed a block of wood with a hole in it on a 1/4 inch copper plated rod. It activated a toggle switch. It rises up a couple of inches, it turns the toggle on. It has some play so that it has to drop an inch from there to shut the toggle off.

        The other came with some kind of switch in a box on the end of a piece of powercord. It hangs down, motor is off. Water rises, box rises up and the angle changes, it turns on the pump.

  6. Nice. I remember seeing similar hack for rc submarine, it only uses sugar and stronger spring connected to sharp pin. If the submarine is flooded by accident, the sugar dissolves and the pin pierces co pressure cyllinder (from soda bottle if I remember correctly) and inflates a balloon which surfaces the sub.
    Something like that :-)

  7. The design of this with aspirin — is pretty simple — but would require a lot of maintenance.

    You’d probably want to use some metal with an anti-corrosion layer added (such as chromium).
    Those pennies will eventually corrode (be covered in a green patina, like the statue of liberty) — this means that you will be replacing the pennies and aspirin — probably — more than you would like to.

    I think it wold be better to use a column with a float that will activate a switch and you can choose the size of float and the height of the switch to detect different levels of water, heck you have even use multiple units to let you know the water height
    .
    That’s the same in principle, but doesn’t require as much maintenance.

  8. First use?
    Late 1939 / early 1940, by Major Millis Jefferis and Stuart Macrae and the others who made up “Winston Churchill’s toy shop”. They relocated to the village of Whitchurch in Bucks after being bombed out of their London offices.

    This was the same team that came up with, among other things; Sticky bombs, time pencil fuses, PIAT anti tank weapon and were involved in Hedgehog anti submarine weapon too. At least two of their inventions used a water soluble switch. They used Alka-seltza in the W mines, which dissolved in water and armed the contact fuses. The mines were used in German rivers and canals to disrupt traffic and blow up bridges. Another use was in limpet mines, initially based on a washing up bowl and some magnets. They used aniseed balls as fuses on those.

  9. I’ve used capacitive sensing to detect liquid levels for a lot of projects. You can either set it as a go/no-go switch, or measure levels continuously.

    Two insulated probes are put into the tank. The capacitance when empty is zero’d out, then calibrate it to 100% when full. As long as the nature of the fluid does not change appreciably, it can be pretty accurate. So it must be calibrated differently for gasoline than for oil, or for water. Pond water will measure somewhat differently than distilled water.

    I just used a couple of 555 timers. Astable clock, followed by a monostable where the capacitance is part of the RC circuit. You can either measure the length of the pulse, or compare it to a reference pulse from another 555, or use an RC network to smooth it to DC and measure it on a DMM.

    I used to build capacitance meters this way. I found one of my old drawings from 1985, but I started building them in the late ’70s.
    http://www.polyphoto.com/tutorials/ElectronicCircuits/Dual555CapMeter150dpi.jpg

    You can increase the resolution by winding two insulated wires around a thin walled hollow plastic rod (like a cheap pen body) so more wire is under water more quickly as it rises. I’ve successfully used this to monitor inkjet ink levels in tanks only a couple of inches tall.

    I replaced the gas gauge on one of my cars with this. Teflon insulation, it must be able to stand up to the gasoline and any additives. I avoid vinyl insulation even for water, as vinyl absorbs some water.

    You can even just stick two strips of copper or aluminum tape on the outside of a plastic container. I did this to monitor windshield washer fluid and the radiator overflow tank.

    Back when microcontrollers and their development software were insanely expensive… I’d use the pulse to enable counting on a 4017 decade counter. So if the pulse length indicated 50% full, the clock speed to the 4017 was just fast enough for it to count to 5 and then hold until the next cycle.

    1. I still have one of the cap meters I built from that design. I intentionally built this one from junkbox parts so I would not sell it (like all the rest). I recently connected it to a 6 digit DMM that measures down to 10uV and therefore 0.01pF at the last digit and found it to be stable even at that low a capacitance.

      I guess I should have been charging more for them.

  10. During my mandatory national service I had the great “pleasure” to help train the guys going to real war in south-eastern (German solidiers, Hehe. Get your jokes done now.) I was more or less an actor, impersonating some bad guy, I was never to be going there. One of the booby traps we talked about was well a kind of water sensor… remove the water from the siphon of a toilet, insert hand grenade with pin pulled and fill with lump sugar. When the sugar dissolved due to toilet usage, the spring force was able to overcome the (mechanical) resistance of the sugar and initiate detonation.

    Yes, a microphone-based setup could have been used to detect sucessful engagement.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.