Build an Inexpensive Wireless Water Alarm

The best DIY electrical engineering projects are effective, simple, and inexpensive. Devlin Gualtieri’s design of a wireless water alarm, which he describes in Circuit Cellar’s February issue, meets all those requirements.

Like most homeowners, Gualtieri has discovered water leaks in his northern New Jersey home after the damage has already started.

“In all cases, an early warning about water on the floor would have prevented a lot of the resulting damage,” he says.

You can certainly buy water alarm systems that will alert you to everything from a leak in a well-water storage tank to moisture from a cracked boiler. But they typically work with proprietary and expensive home-alarm systems that also charge a monthly “monitoring” fee.

“As an advocate of free and open-source software, it’s not surprising that I object to such schemes,” Gualtieri says.

In February’s Circuit Cellar magazine, now available for membership download or single-issue purchase, Gualtieri describes his battery-operated water alarm. The system, which includes a number of wireless units that signal a single receiver, includes a wireless receiver, audible alarm, and battery monitor to indicate low power.

Photo 1: An interdigital water detection sensor is shown. Alternate rows are lengths of AWG 22 copper wire, which is either bare or has its insulation removed. The sensor is shown mounted to the bottom of the box containing the water alarm circuitry. I attached it with double-stick foam tape, but silicone adhesive should also work.

Photo 1: An interdigital water detection sensor is shown. Alternate rows are lengths of AWG 22 copper wire, which is either bare or has its insulation removed. The sensor is shown mounted to the bottom of the box containing the water alarm circuitry. I attached it with double-stick foam tape, but silicone adhesive should also work.

Because water conducts electricity, Gualtieri sensors are DIY interdigital electrodes that can lie flat on a surface to detect the first presence of water. And their design couldn’t be easier.

“You can simply wind two parallel coils of 22 AWG wire on a perforated board about 2″ by 4″, he says. (See Photo 1.)

He also shares a number of design “tricks,” including one he used to make his low-battery alert work:

“A battery monitor is an important feature of any battery-powered alarm circuit. The Microchip Technology PIC12F675 microcontroller I used in my alarm circuit has 10-bit ADCs that can be optionally assigned to the I/O pins. However, the problem is that the reference voltage for this conversion comes from the battery itself. As the battery drains from 100% downward, so does the voltage reference, so no voltage change would be registered.

Figure 1: This is the portion of the water alarm circuit used for the battery monitor. The series diodes offer a 1.33-V total  drop, which offers a reference voltage so the ADC can see changes in the battery voltage.

Figure 1: This is the portion of the water alarm circuit used for the battery monitor. The series diodes offer a 1.33-V total drop, which offers a reference voltage so the ADC can see changes in the battery voltage.

“I used a simple mathematical trick to enable battery monitoring. Figure 1 shows a portion of the schematic diagram. As you can see, the analog input pin connects to an output pin, which is at the battery voltage when it’s high through a series connection of four small signal diodes (1N4148). The 1-MΩ resistor in series with the diodes limits their current to a few microamps when the output pin is energized. At such low current, the voltage drop across each diode is about 0.35 V. An actual measurement showed the total voltage drop across the four diodes to be 1.33 V.

“This voltage actually presents a new reference value for my analog conversion. The analog conversion now provides the following digital values:

EQ1Table 1 shows the digital values as a function of battery voltage. The nominal voltage of three alkaline cells is 4.75 V. The nominal voltage of three lithium cells is 5.4 V. The PIC12F675 functions from approximately 2 to 6.5 V, but the wireless transmitter needs as much voltage as possible to generate a reliable signal. I arbitrarily coded the battery alarm at 685, or a little above 4 V. That way, there’s still enough power to energize the wireless transmitter at a useful power level.”

Table 1
Battery Voltage ADC Value
5 751
4.75 737
4.5 721
4.24 704
4 683
3.75 661

 

Gaultieri’s wireless transmitter, utilizing lower-frequency bands, is also straightforward.

Photo 2 shows one of the transmitter modules I used in my system,” he says. “The round device is a surface acoustic wave (SAW) resonator. It just takes a few components to transform this into a low-power transmitter operable over a wide supply voltage range, up to 12 V. The companion receiver module is also shown. My alarm has a 916.5-MHz operating frequency, but 433 MHz is a more popular alarm frequency with many similar modules.”

These transmitter and receiver modules are used in the water alarm. The modules operate at 916.5 MHz, but 433 MHz is a more common alarm frequency with similar modules. The scale is inches.

Photo 2: These transmitter and receiver modules are used in the water alarm. The modules operate at 916.5 MHz, but 433 MHz is a more common alarm frequency with similar modules. The scale is inches.

Gualtieri goes on to describe the alarm circuitry (see Photo 3) and receiver circuit (see Photo 4.)

For more details on this easy and affordable early-warning water alarm, check out the February issue.

Photo 3: This is the water alarm’s interior. The transmitter module with its antenna can be seen in the upper right. The battery holder was harvested from a $1 LED flashlight. The box is 2.25“ × 3.5“, excluding the tabs.

Photo 3: This is the water alarm’s interior. The transmitter module with its antenna can be seen in the upper right. The battery holder was harvested from a $1 LED flashlight. The box is 2.25“ × 3.5“, excluding the tabs.

Photo 4: Here is my receiver circuit. One connector was used to monitor the signal strength voltage during development. The other connector feeds an input on a home alarm system. The short antenna reveals its 916.5-MHz operating frequency. Modules with a 433-MHz frequency will have a longer antenna.

Photo 4: Here is my receiver circuit. One connector was used to monitor the signal strength voltage during development. The other connector feeds an input on a home alarm system. The short antenna reveals its 916.5-MHz operating frequency. Modules with a 433-MHz frequency will have a longer antenna.

 

Client Profile: Pico Technology

Pico Technology
320 North Glenwood Boulevard
Tyler, TX 75702

Contact: sales@picotech.com

Embedded Products/Services: Pico Technology’s PicoScope 5000 series uses reconfigurable ADC technology to offer a choice of resolutions from 8 to 16 bits. For more information, visit www.picotech.com/picoscope5000.html.

PicoProduct information: The new PicoScope 5000 series oscilloscopes have a significantly different architecture. High-resolution ADCs can be applied to the input channels in different series and parallel combinations to boost the sampling rate or the resolution.

In Series mode, the ADCs are interleaved to provide 1 GB/s at 8 bits. In Parallel mode, multiple ADCs are sampled in phase on each channel to increase the resolution and dynamic performance (up to 16 bits).

In addition to their flexible resolution, the oscilloscopes have ultra-deep memory buffers of up to 512 MB to enable long captures at high sampling rates. They also feature standard, advanced software, including serial decoding, mask limit testing, and segmented memory.

The PicoScope 5000 series oscilloscopes are currently available at www.picotech.com.

The two-channel, 60-MHz model with built-function generator costs $1,153. The four-channel, 200-MHz model with built-in arbitrary waveform generator (AWG) costs $2,803. The pricing includes a set of matched probes, all necessary software, and a five-year warranty.

CC280: Analog Communications and Calibration

Are you an analog aficionado? You’re in luck. Two articles, in particular, focus on the November issue’s analog techniques theme. (Look for the issue shortly after mid-October, when it will be available on our website.)

Block Diagram

Data from the base adapter is sent by level shifting the RS-232 or CMOS serial data between 9 and 12 V. A voltage comparator at the remote adapter slices the signal to generate a 0-to-5-V logic signal. The voltage on the signal wire never goes low enough for the 5-V regulator to go out of regulation.

These adapters use a combination of tricks. A single pair of wires carries full-duplex serial data and a small amount of power to a remote device for tasks (e.g., continuous remote data collection and control). The digital signals can be simple on/off signals or more complex signals (e.g., RS-232).

These adapters use a combination of tricks. A single pair of wires carries full-duplex serial data and a small amount of power to a remote device for tasks (e.g., continuous remote data collection and control). The digital signals can be simple on/off signals or more complex signals (e.g., RS-232).

Dick Cappels, a consultant who tinkers with analog and mixed-signal projects, presents a design using a pair of cable adapters and simple analog circuits to enable full-duplex, bidirectional communications and power over more than 100 m of paired wires. Why bother when Power Over Ethernet  (PoE), Bluetooth, and Wi-Fi approaches are available?

“In some applications, using Ethernet is a disadvantage because of the higher costs and greater interface complexity,” Cappels says. “You can use a microcontroller that costs less than a dollar and a few analog parts described in this article to perform remote data gathering and control.”

The base unit including the 5-to-15-V power supply is simple for its functionality. The two eight-pin DIP ICs are a voltage comparator and the switching regulator.

The base unit including the 5-to-15-V power supply is simple for its functionality. The two eight-pin DIP ICs are a voltage comparator and the switching regulator.

Cappels’s need for data channels to monitor his inground water tank inspired his design. Because his local municipality did not always keep the tank filled, he needed to know when it was dry so his pumps wouldn’t run without water and possibly become damaged.
“Besides the mundane application of monitoring a water tank, the system would be excellent for other communication uses,” Cappels says, including computer connection to a home weather station and intrusion-detection systems. Bit rates up to 250 kHz also enable the system to be used in two-way voice communication such as intercoms, he says.

Retired engineer David Cass Tyler became interested in writing his series about calibration while working on a consulting project. “I came to realize that some people don’t really know how to approach the issue of taking an analog-to-digital value to actual engineering units, nor how to correct calibration factors after the fact,” Tyler says

In Part 1 of his article series, Tyler notes: “Digital inputs and digital outputs are pretty simple. They are either on or off. However, for ADCs and DACs to be accurate, they must first be calibrated. This article addresses linear ADCs and DACs.” Part 2, appearing in the December issue, will discuss using polynomial curve fitting to convert nonlinear data to real-world engineering values.

In addition to its analog-themed articles, the November issue includes topics ranging from a DIY solar array tracker’s software to power-capped computer systems.

Editor’s Note: Learn more about Circuit Cellar contributors Dick Cappels and David Cass Tyler by reading their posts about their workspaces and favorite DIY tools.

Data Acquisition Instrument

The DI-145 USB data acquisition instrument features four ±100-V analog channels and two dedicated digital inputs. The included DATAQ WinDaq data acquisition software (DAS) enables you to display and record data to a PC hard drive in real time. Once recorded, data can be played back, analyzed, or exported to an array of data acquisition and spreadsheet formats.

DATAQ also provides access to the DI-145 data protocol, which enables access to the DI-145 on any Windows, Linux, or MAC OS. In addition, .NET control is available to Windows users who wish to use a third-party programming language (e.g., Microsoft’s Visual Basic or National Instruments’s LabVIEW) to interface with the DI-145.

The four ±10-V fixed differential channels are protected from transient spikes up to ±150 V peak (±75 V, continuous). A 10-bit ADC provides 19.5-mV resolution across the full-scale measurement range. Digital inputs are protected up to ±30 VDC/peak AC. The digital inputs enable you to use a switch closure or TTL signal to remotely insert event marks or record data to disk.

The DI-145 measures 1.53” × 2.625” × 5.5” (3.89 cm × 6.67 cm × 13.97 cm) and weighs 3.6 oz. The data acquisition instrument costs $29 and includes a mini screwdriver, a USB cable, WinDaq/Lite DAS, access to the data protocol, and .NET control.

DATAQ Instruments, Inc.
www.dataq.com