<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahdi Mansouri</title>
    <description>The latest articles on DEV Community by Mahdi Mansouri (@mhmansouri).</description>
    <link>https://dev.to/mhmansouri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4187266%2F15242deb-9859-4d58-a979-9c68ee0c62ca.jpg</url>
      <title>DEV Community: Mahdi Mansouri</title>
      <link>https://dev.to/mhmansouri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhmansouri"/>
    <language>en</language>
    <item>
      <title>Build a water-leak alarm for under the sink (ESP32, one evening)</title>
      <dc:creator>Mahdi Mansouri</dc:creator>
      <pubDate>Thu, 15 Oct 2026 18:27:47 +0000</pubDate>
      <link>https://dev.to/mhmansouri/build-a-water-leak-alarm-for-under-the-sink-esp32-one-evening-1ha3</link>
      <guid>https://dev.to/mhmansouri/build-a-water-leak-alarm-for-under-the-sink-esp32-one-evening-1ha3</guid>
      <description>&lt;p&gt;&lt;em&gt;"How do I get warned before a leak under the sink floods the kitchen?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Water conducts a little electricity. Two metal contacts a few millimetres apart on the cupboard floor, a small board that checks them, a loud buzzer and a phone alert. The test is dramatic: pour a glass of water and it screams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost&lt;/strong&gt; $6–12 · &lt;strong&gt;Time&lt;/strong&gt; one evening · &lt;strong&gt;Level&lt;/strong&gt; first build · &lt;strong&gt;Power&lt;/strong&gt; USB or battery&lt;/p&gt;

&lt;h2&gt;
  
  
  What to buy
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Why this one&lt;/th&gt;
&lt;th&gt;Rough cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ESP32-C3 board&lt;/td&gt;
&lt;td&gt;Small, cheap, WiFi built in.&lt;/td&gt;
&lt;td&gt;$4–7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leak probe: two wires or two screws, a few mm apart&lt;/td&gt;
&lt;td&gt;Or a cheap "rain sensor" board with a comparator, which gives a simple wet/dry signal.&lt;/td&gt;
&lt;td&gt;$0–2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Active buzzer&lt;/td&gt;
&lt;td&gt;Beeps by itself when powered, so no tone code is needed. It still warns you when your phone is off.&lt;/td&gt;
&lt;td&gt;$1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A 100 kΩ resistor&lt;/td&gt;
&lt;td&gt;For reading the probe (see step 1).&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USB power (there's often a socket under the sink) or batteries&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prices are rough ranges, not quotes. Check the current price and stock before you order.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to install
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://esphome.io" rel="noopener noreferrer"&gt;ESPHome&lt;/a&gt; or a short Arduino sketch: check the probe, sound the buzzer when it's wet, and send a phone alert through &lt;a href="https://ntfy.sh" rel="noopener noreferrer"&gt;ntfy&lt;/a&gt; or Home Assistant. Repeat the alert every few minutes until it's dry; a leak is urgent.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Ready-made option:&lt;/strong&gt; leak sensors for Zigbee or WiFi cost about $10–20. Build your own to learn, or to get a loud buzzer right at the sink.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Build it in three steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Test with a glass of water.&lt;/strong&gt; Connect one probe to ground. Connect the other to an analog pin, and through the 100 kΩ resistor to a second pin that you switch on only while measuring. Print the reading dry, and with the probe in water: wet should read clearly lower.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add the buzzer and the alert.&lt;/strong&gt; Drive the buzzer from a pin (through a small transistor if it needs more current than a pin can give). Alert once when it turns wet, then every few minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Place it.&lt;/strong&gt; Probes flat on the lowest point of the cupboard floor; board and buzzer higher up, where they stay dry.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What catches people out
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Probes corrode if they're powered all the time.&lt;/strong&gt; Constant current through wet metal eats it away. Power the probe only for the moment you measure, which is why the resistor goes to a pin, not straight to 3.3V.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Damp isn't a leak.&lt;/strong&gt; Set the alert point from your own test, well away from the dry reading.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Battery version:&lt;/strong&gt; wake every 30–60 seconds, check, sleep. A leak takes minutes to do damage, so that's fast enough.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low voltage only.&lt;/strong&gt; USB or batteries; never run mains wiring near the water.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This guide first appeared on &lt;a href="https://iotmentor.dev/guides/water-leak-alarm" rel="noopener noreferrer"&gt;IotMentor&lt;/a&gt;, a free chat mentor for small electronics builds (I make it). If your setup is different (distance, power, budget, experience), you can ask it there and it will plan your version.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>iot</category>
      <category>arduino</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
