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.

 

Arduino-Based DIY Voltage Booster (EE Tip #117)

If your project needs a higher voltage rail than is already available in the circuit, you can use an off-the-shelf step-up device. But when you want a variable output voltage, it’s less easy to find a ready-made IC. However, it’s not complicated to build such a circuit yourself, especially if you have a microcontroller board that’s as easy to program as an Arduino. And this also lets you experiment with the circuit so you can get a better understanding of how it works.

Source: Elektor, April 2010

Source: Elektor, April 2010

No surprises in the circuit—a largely conventional boost converter. The MOSFET is driven by a pulse width modulated (PWM) signal from the microcontroller, and the output voltage is measured by one of the microcontroller’s analog inputs. The driver adjusts the PWM signal according to the difference between the output voltage measured and the voltage wanted.

We don’t have enough space here to go into details about how this circuit works, but it’s worth mentioning a few points of special interest.

The small capacitor across the diode improves the efficiency of the circuit. The load is represented by R3. The components used make it possible to supply over 1 A (current limited by the MSS1260T 683MLB inductor from Coilcraft), but maximum efficiency (89%) is at around 95 mA (at an output voltage of 10 V). To avoid damaging the controller’s analog input (≤5 V), the output voltage may not exceed 24 V. For higher voltages, the values of resistors R1 and R2 would need to be changed.

The MOSFET is driven by the microcontroller, which is nothing but a little Arduino board. The Arduino’s default PWM signal frequency is around 500 Hz—too low for this application, which needs a frequency at least 100 times higher. So we can’t use the PWM functions offered by Arduino. But that’s no problem, as the Arduino can also be programmed in assembler, allowing a maximum frequency of 62.5 kHz (the microcontroller runs at 16 MHz). To sample the output voltage, a frequency of 100 Hz is acceptable, which means we can use Arduino’s standard timers and analog functions. The Arduino serial port is very handy: we can use it for sending the output voltage set point (5–24 V) and for collecting certain information about the operation. Thanks to the Arduino environment, it only took about half an hour to program. Software is available. — Clemens Valens (Elektor, April 2010)

Issue 282: EQ Answers

PROBLEM 1
Construct an electrical circuit to find the values of Xa, Xb, and Xc in this system of equations:

21Xa – 10Xb – 10Xc = 1
–10Xa + 22Xb – 10Xc = –2
–10Xa – 10Xb + 20Xc = 10

Your circuit should include only the following elements:

one 1-Ω resistor
one 2-Ω resistor
three 10-Ω resistors
three ideal constant voltage sources
three ideal ammeters

The circuit should be designed so that each ammeter displays one of the values Xa, Xb, or Xc. Given that the Xa, Xb, and Xc values represent currents, what kind of circuit analysis yields equations in this form?

ANSWER 1
You get equations in this form when you do mesh analysis of a circuit. Each equation represents the sum of the voltages around one loop in the mesh.

PROBLEM 2
What do the coefficients on the left side of the equations represent? What about the constants on the right side?

ANSWER 2
The coefficients on the left side of each equation represent resistances. Resistance multiplied by current (the unknown Xa, Xb, and Xc values) yields voltage.
The “bare” numbers on the right side of each equation represent voltages directly (i.e., independent voltage sources).

PROBLEM 3
What is the numerical solution for the equations?

ANSWER 3
To solve the equations directly, start by solving the third equation for Xc and substituting it into the other two equations:

Xc = 1/2 Xa + 1/2 Xb + 1/2

21Xa – 10Xb – 5Xa – 5Xb – 5 = 1
–10Xa + 22Xb – 5Xa – 5Xb – 5 = –2

16Xa – 15Xb = 6
–15Xa + 17Xb = 3

Solve for Xa by multiplying the first equation by 17 and the second equation by 15 and then adding them:

272Xa – 255Xb = 102
–225Xa + 255Xb = 45

47Xa = 147 → Xa = 147/47

Solve for Xb by multiplying the first equation by 15 and the second equation by 16 and then adding them:

240Xa – 225Xb = 90
–240Xa + 272Xb = 48

47Xb = 138 → Xb = 138/47

Finally, substitute those two results into the equation for Xc:

Xc = 147/94 + 138/94 + 47/94 = 332/94 = 166/47

PROBLEM 4
Finally, what is the actual circuit? Draw a diagram of the circuit and indicate the required value of each voltage source.

ANSWER 4
The circuit is a mesh comprising three loops, each with a voltage source. The common elements of the three loops are the three 10-Ω resistors, connected in a Y configuration (see the figure below).

cc281_eq_fig1The values of the voltage sources in each loop are given directly by the equations, as shown. To verify the numeric solution calculated previously, you can calculate all of the node voltages around the outer loop, plus the voltage at the center of the Y, and ensure they’re self-consistent.

We’ll start by naming Va as ground, or 0 V:

Vb = Va + 2 V = 2 V

Vc = Vb + 2 Ω × Xb = 2V + 2 Ω × 138/47 A = 370/47 V = 7.87234 V

Vd = Vc + 1 Ω × Xa = 370/47 V + 1 Ω × 147/47A = 517/47 V = 11.000 V

Ve = Vd – 1 V = 11.000 V – 1.000 V = 10.000 V

Va = Ve – 10 V = 0 V

which is where we started.

The center node, Vf, should be at the average of the three voltages Va, Vc, and Ve:

0 V + 370/47 V + 10 V/3 = 840/141 V = 5.95745 V

We should also be able to get this value by calculating the voltage drops across each of the three 10-Ω resistors:

Va + (Xc – Xb) × 10 Ω = 0 V + (166 – 138)/47A × 10 Ω = 280/47 V = 5.95745 V

Vc + (Xb – Xa) × 10 Ω = 370/47V + (138-147)/47A × 10 Ω = 280/47 V = 5.95745 V

Ve + (Xa – Xc) × 10 Ω = 10 V + (147-166)/47 A × 10 Ω = 280/47 V = 5.95745 V

High-Voltage Gate Driver IC

Allegro A4900 Gate Driver IC

Allegro A4900 Gate Driver IC

The A4900 is a high-voltage brushless DC (BLDC) MOSFET gate driver IC. It is designed for high-voltage motor control for hybrid, electric vehicle, and 48-V automotive battery systems (e.g., electronic power steering, A/C compressors, fans, pumps, and blowers).

The A4900’s six gate drives can drive a range of N-channel insulated-gate bipolar transistors (IGBTs) or power MOSFET switches. The gate drives are configured as three high-voltage high-side drives and three low-side drives. The high-side drives are isolated up to 600 V to enable operation with high-bridge (motor) supply voltages. The high-side drives use a bootstrap capacitor to provide the supply gate drive voltage required for N-channel FETs. A TTL logic-level input compatible with 3.3- or 5-V logic systems can be used to control each FET.

A single-supply input provides the gate drive supply and the bootstrap capacitor charge source. An internal regulator from the single supply provides the logic circuit’s lower internal voltage. The A4900’s internal monitors ensure that the high- and low-side external FET’s gate source voltage is above 9 V when active.

The control inputs to the A4900 offer a flexible solution for many motor control applications. Each driver can be driven with an independent PWM signal, which enables implementation of all motor excitation methods including trapezoidal and sinusoidal drive. The IC’s integrated diagnostics detect undervoltage, overtemperature, and power bridge faults that can be configured to protect the power switches under most short-circuit conditions. Detailed diagnostics are available as a serial data word.

The A4900 is supplied in a 44-lead QSOP package and costs $3.23 in 1,000-unit quantities.

Allegro MicroSystems, LLC
www.allegromicro.com

Dual-Channel Waveform Generators

B&K Precision 4053 Waveform Generator

B&K Precision 4053 Waveform Generator

The 4050 Series is a new line of four dual-channel function/arbitrary waveform generators. The instruments can generate 5-to-50-MHz waveforms for applications requiring stable and precise sine, square, triangle, and pulse waveforms with modulation and arbitrary waveform capabilities.

All models provide a main output voltage that can be vary from 0 to 10 VPP into 50 Ω and a secondary output that can vary from 0 to 3 VPP into 50 Ω. The generators feature a 3.5” color LCD, a rotary control knob, and a numeric keypad with dedicated waveform keys and output buttons.

The 4050 Series provides users with 48 built-in arbitrary waveforms. Using the included waveform editing software via the standard USB interface on the rear, users can create and load up to 10 custom 16-kpt waveforms. For general-purpose interface bus (GPIB) connectivity, an optional USB-to-GPIB adapter is available.

The generators offer a variety of modulation schemes for modulated signal applications including amplitude and frequency modulation (AM/FM), double sideband amplitude modulation (DSB-AM), amplitude and frequency shift keying (ASK/FSK), phase modulation (PM), and pulse-width modulation (PWM). Additional standard features include a linear and logarithmic sweep function, a built-in counter, sync output, a trigger I/O terminal, and a USB host port on the front panel to save and recall instrument settings and waveforms. A standard external 10-MHz reference clock input is provided to synchronize the instrument to another generator.

The 4052 (5-MHz) costs $499, the 4053 (10 MHz) costs $599, the 4054 (25 MHz) costs $850, and the 4055 (50 MHz) costs $1,050. Note: B&K Precision is offering 10% off MSRP through November 30, 2013. See website for details.

B&K Precision Corp.
www.bkprecision.com