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.

 

NJIT Professor Invents a Flexible Battery

Researchers at the New Jersey Institute of Technology (NJIT) have developed a flexible battery made with carbon nanotubes that could potentially power electronic devices with flexible displays, according to an NJIT press release.

Electronic manufacturers are now making flexible organic light-emitting diode (OLED) displays, a pioneering technology that allow devices such as cell phones, tablet computers and TVs to literally fold up.

(c) iStockPhoto.com/shawn_hempel

(c) iStockPhoto.com/ (shawn_hempel)

And this new battery, given its flexibility and components, can be used to power this new generation of bendable electronics. The battery is made from carbon nanotubes and micro-particles that serve as active components—similar to those found in conventional batteries. It is designed, though, to contain the electro-active ingredients while remaining flexible.

“This battery can be made as small as a pinhead or as large as a carpet in your living room,” says Somenath Mitra, of Bridgewater, a professor of chemistry and environmental science whose research group invented the battery. “So its applications are endless. You can place a rolled-up battery in the trunk of your electric car and have it power the vehicle.”

A patent application on the battery has been filed, and the battery will be featured in an upcoming issue of “Advanced Materials.”  Mitra developed the new technology at NJIT with assistance from Zhiqian Wang, of Kearney, a doctoral student in chemistry.

The battery has another revolutionary potential, in that it could be fabricated at home by consumers.  All one would need to make the battery is a kit composed of electrode paste and a laminating machine. One would coat two plastic sheets with the electrode paste, place a plastic separator between the sheets and then laminate the assembly. The battery assembly would function in the same way as a double-A or a triple-A battery.

“We have been experimenting with carbon nanotubes and other leading technologies for many years at NJIT,” says Mitra, “and it’s exciting to apply leading-edge technologies to create a flexible battery that has myriad consumer applications.”

Solar Cells Explained (EE Tip #104)

All solar cells are made from at least two different materials, often in the form of two thin, adjacent layers. One of the materials must act as an electron donor under illumination, while the other material must act as an electron acceptor. If there is some sort of electron barrier between the two materials, the result is an electrical potential. If each of these materials is now provided with an electrode made from an electrically conductive material and the two electrodes are connected to an external load, the electrons will follow this path.

Source: Jens Nickels, Elektor, 070798-I, 6/2009

Source: Jens Nickels, Elektor, 070798-I, 6/2009

The most commonly used solar cells are made from thin wafers of polycrystalline silicon (polycrystalline cells have a typical “frosty” appearance after sawing and polishing). The silicon is very pure, but it contains an extremely small amount of boron as a dopant (an intentionally introduced impurity), and it has a thin surface layer doped with phosphorus. This creates a PN junction in the cell, exactly the same as in a diode. When the cell is exposed to light, electrons are released and holes (positive charge carriers) are generated. The holes can recombine with the electrons. The charge carriers are kept apart by the electrical field of the PN junction, which partially prevents the direct recombination of electrons and holes.

The electrical potential between the electrodes on the top and bottom of the cell is approximately 0.6 V. The maximum current (short-circuit current) is proportional to the surface area of the cell, the impinging light energy, and the efficiency. Higher voltages and currents are obtained by connecting cells in series to form strings and connecting these strings of cells in parallel to form modules.

The maximum efficiency achieved by polycrystalline cells is 17%, while monocrystalline cells can achieve up to 22%, although the overall efficiency is lower if the total module area is taken into account. On a sunny day in central Europe, the available solar energy is approximately 1000 W/m2, and around 150 W/m2 of this can be converted into electrical energy with currently available solar cells.

Source: Jens Nickels, Elektor, 070798-I, 6/2009

Source: Jens Nickels, Elektor, 070798-I, 6/2009

Cells made from selenium, gallium arsenide, or other compounds can achieve even higher efficiency, but they are more expensive and are only used in special applications, such as space travel. There are also other approaches that are aimed primarily at reducing costs instead of increasing efficiency. The objective of such approaches is to considerably reduce the amount of pure silicon that has to be used or eliminate its use entirely. One example is thin-film solar cells made from amorphous silicon, which have an efficiency of 8 to 10% and a good price/performance ratio. The silicon can be applied to a glass sheet or plastic film in the form of a thin layer. This thin-film technology is quite suitable for the production of robust, flexible modules, such as the examples described in this article.

Battery Charging

From an electrical viewpoint, an ideal solar cell consists of a pure current source in parallel with a diode (the outlined components in the accompanying schematic diagram). When the solar cell is illuminated, the typical U/I characteristic of the diode shifts downward (see the drawing, which also shows the opencircuit voltage UOC and the short-circuit current ISC). The panel supplies maximum power when the load corresponds to the points marked “MPP” (maximum power point) in the drawing. The power rating of a cell or panel specified by the manufacturer usually refers to operation at the MPP with a light intensity of 100,000 lux and a temperature of 25°C. The power decreases by approximately 0.2 to 0.5 %/°C as the temperature increases.

A battery can be charged directly from a panel without any problems if the open-circuit voltage of the panel is higher than the nominal voltage of the battery. No voltage divider is necessary, even if the battery voltage is only 3 V and the nominal voltage of the solar panel is 12 V. This is because a solar cell always acts as a current source instead of a voltage source.

If the battery is connected directly to the solar panel, a small leakage current will flow through the solar panel when it is not illuminated. The can be prevented by adding a blocking diode to the circuit (see the schematic). Many portable solar modules have a built-in blocking diode (check the manufacturer’s specifications).

This simple arrangement is adequate if the maximum current from the solar panel is less than the maximum allowable overcharging current of the battery. NiMH cells can be overcharged for up to 100 hours if the charging current (in A) is less than one-tenth of their rated capacity in Ah. This means that a panel with a rated current of 2 A can be connected directly to a 20-Ah battery without any problems. However, under these conditions the battery must be fully discharged by a load from time to time.

Practical Matters

When positioning a solar panel, you should ensure that no part of the panel is in the shade, as otherwise the voltage will decrease markedly, with a good chance that no current will flow into the connected battery.

Most modules have integrated bypass diodes connected in reverse parallel with the solar cells. These diodes prevent reverse polarization of any cells that are not exposed to sunlight, so the current from the other cells flows through the diodes, which can cause overheating and damage to the cells. To reduce costs, it is common practice to fit only one diode to a group of cells instead of providing a separate diode for each cell.

—Jens Nickels, Elektor, 070798-I, 6/2009

CC279: What’s Ahead in the October Issue

Although we’re still in September, it’s not too early to be looking forward to the October issue already available online.

The theme of the issue is signal processing, and contributor Devlin Gualtieri offers an interesting take on that topic.

Gualtieiri, who writes a science and technology blog, looks at how to improve Improvig Microprocessor Audio microprocessor audio.

“We’re immersed in a world of beeps and boops,” Gualtieri says. “Every digital knick-knack we own, from cell phones to microwave ovens, seeks to attract our attention.”

“Many simple microprocessor circuits need to generate one, or several, audio alert signals,” he adds. “The designer usually uses an easily programmed square wave voltage as an output pin that feeds a simple piezoelectric speaker element. It works, but it sounds awful. How can microprocessor audio be improved in some simple ways?”

Gualtieri’s article explains how analog circuitry and sine waves are often a better option than digital circuitry and square waves for audio alert signals.

Another article that touches on signal processing is columnist Colin Flynn’s look at advanced methods of debugging an FPGA design. It’s the debut of his new column Programmable Logic in Practice.

“This first article introduces the use of integrated logic analyzers, which provide an internal view of your running hardware,” O’Flynn says. “My next article will continue this topic and show you how hardware co-simulation enables you to seamlessly split the verification between real hardware interfacing to external devices and simulated hardware on your computer.”

You can find videos and other material that complement Colin’s articles on his website.

Another October issue highlight is a real prize-winner. The issue features the first installment of a two-part series on the SunSeeker Solar Array Tracker, which won third SunSeekerplace in the 2012 DesignSpark chipKit challenge overseen by Circuit Cellar.

The SunSeeker, designed by Canadian Graig Pearen, uses a Microchip Technology chipKIT Max32 and tracks, monitors, and adjusts PV arrays based on weather and sky conditions. It measures PV and air temperature, compiles statistics, and communicates with a local server that enables the SunSeeker to facilitate software algorithm development. Diagnostic software monitors the design’s motors to show both movement and position.

Pearen, semi-retired from the telecommunications industry and a part-time solar technician, is still refining his original design.

“Over the next two to three years of development and field testing, I plan for it to evolve into a full-featured ‘bells-and-whistles’ solar array tracker,” Pearen says. “I added a few enhancements as the software evolved, but I will develop most of the additional features later.”

Walter Krawec, a PhD student studying Computer Science at the Stevens Institute of Technology in Hoboken, NJ, wraps up his two-part series on “Experiments in Developmental Robotics.”

In Part 1, he introduced readers to the basics of artificial neural networks (ANNs) in robots and outlined an architecture for a robot’s evolving neural network, short-term memory system, and simple reflexes and instincts. In Part 2, Krawec discusses the reflex and instinct system that rewards an ENN.

“I’ll also explain the ‘decision path’ system, which rewards/penalizes chains of actions,” he says. “Finally, I’ll describe the experiments we’ve run demonstrating this architecture in a simulated environment.”

Videos of some of Krawec’s robot simulations can be found on his website.

Speaking of robotics, in this issue columnist Jeff Bachiochi introduces readers to the free robot control programming language RobotBASIC and explains how to use it with an integrated simulator for robot communication.

Other columnists also take on a number of very practical subjects. Robert Lacoste explains how inexpensive bipolar junction transistors (BJTs) can be helpful in many designs and outlines how to use one to build an amplifier.

George Novacek, who has found that the cost of battery packs account for half the DIY Battery Chargerpurchase price of his equipment, explains how to build a back-up power source with a lead-acid battery and a charger.

“Building a good battery charger is easy these days because there are many ICs specifically designed for battery chargers,” he says.

Columnist Bob Japenga begins a new series looking at file systems available on Linux for embedded systems.

“Although you could build a Linux system without a file system, most Linux systems will have some sort of file system,” Japenga says. “And there are various types. There are files systems that do not retain their data (volatile) across power outages (i.e., RAM drives). There are nonvolatile read-only file systems that cannot be changed (e.g., CRAMFS). And there are nonvolatile read/write file systems.”

Linux provides all three types of file systems, Japenga says, and his series will address all of them.

Finally, the magazine offers some special features, including an interview with Alenka Zajić, who teaches signal processing and electromagnetics at Georgia Institute of Technology’s School of Electrical and Computer Engineering. Also, two North Carolina State University researchers write about advances in 3-D liquid metal printing and possible applications such as electrical wires that can “heal” themselves after being severed.

For more, check out the Circuit Cellar’s October issue.

 

 

CC278: Battery Basics

Front of a battery analyzer

The University of Washington recently announced its engineers have created a wireless communications system that enables everyday devices to power up and connect to the web without the use of batteries. Instead, such devices would tap the energy available in wireless signals.

According to an August article on the university’s website,  engineers have developed a communication system that takes advantage of what they call  “ambient backscatter,”  the TV and cellular transmissions all around us. You can read more about the breakthrough by checking out the university article.

It will be some time before such an approach becomes commercially viable. In the meantime, we’ll still be relying heavily on batteries. With that in mind, you should check out columnist George Novacek’s article in Circuit Cellar’s September issue. Novacek goes “back to the basics” of batteries in this first installment of a two-part series.

“Battery usage has increased due to the proliferation of mobile and cordless devices,” Novacek says in Part 1. “This article describes battery types generally available in retail stores. I’ll discuss their features, operation, and usages. While many exotic batteries and custom packages are available, this article focuses on standard batteries, which are the type you are most likely to encounter.”

He opens his discussion by distinguishing between batteries vs. cells and describing common battery packages.

“Although we tend to use the words ‘battery’ and ‘cell’ interchangeably, there is a difference,” Novacek says. “Batteries comprise cells (e.g., the well-known 9-V battery contains six 1.5-V cells, while the omnipresent AA ‘battery’ and many others are just single cells). I will use the common terminology, even though it may be at times technically incorrect.

“Batteries store chemical energy. When activated, the chemical process occurring internally converts the chemical into electrical energy. Alessandro Volta, an Italian physicist, is credited with inventing the “voltaic pile” in the early 19th century, although archeological discoveries suggest that some form of an electrical battery was known in ancient Babylon. National Carbon Company, known today as Eveready, began marketing a precursor of the ubiquitous carbon-zinc battery in 1896…

“According to Wikipedia, the most common battery packages available today include AA, AAA, C, D, 9-V pack, and different types of “button cells”. There is also a plethora of custom-made battery packs for power tools, cordless telephones, and so forth. No matter what kind of packaging, the battery principles for the given type remain the same.

“There are two categories of batteries: primary (i.e., single use) and rechargeable. Carbon-zinc is the oldest—and at one point the most common—primary battery. They are available in standard packages and inexpensive. Consequently, carbon-zinc batteries are often included by original equipment manufacturers (OEM) with devices (e.g., TV remote controls, portable radios, etc.). Although they have been improved over the years, some significant shortcomings remain, so I avoid using them.”

Novacek goes on to examine the drawbacks and advantages of carbon-zinc, alkaline, lithium, mercuric-oxide, silver-oxide button cell, lead-acid, nickel-cadmium (NiCad), and nickel-metal hydride (NiMH) batteries.

To learn more about what may be powering your handheld or other device, check out the September issue.