One-wire bus powers water-level sensor

-February 15, 2001

You can use the simple sensor circuit in Figure 1 to remotely monitor the level of liquid water in a vessel such as a swimming pool. The LMC555 sensor oscillator provides an output-signal frequency that is a function of the water level. This signal drives a DS2423 pulse counter. A host PC or µC reads the output of the pulse counter via the Dallas Semiconductor one-wire bus (Reference 1). The circuit uses approximately 150 µA of current, allowing the circuit to steal its power from the bus via the Schottky diode, D1. Because the circuit is sensing water that is part of the electrical circuit, you should use an ac-coupled signal to avoid polarization of the water and plating of the electrodes. One approach is to have the water in a circuit branch that is in series with some capacitance. In this sensor circuit, the water is in the branch containing the timing capacitance of a CMOS 555 timer, configured as a free-running oscillator with a 50% duty cycle. The sensor provides a capacitance that varies with water level.

Figure 2 shows one method of fabricating the sensor. You epoxy-bond a series string of N radial-leaded ceramic capacitors of equal value C underneath a pc board. Twist the leads of adjacent capacitors, solder them together, and trim them to serve as electrodes to contact the water. The outer shell of the sensor, a piece of 0.75 in. copper pipe, forms another electrode. If you place this assembly vertically in a vessel, the capacitance between the terminals of the sensor (the uppermost lead of C1 and the outer shell) increases in steps as the water rises and covers more of the capacitors. The water effectively short-circuits the capacitors to the outer-shell electrode. Because the capacitors are in series, the total capacitance changes according to: CTOTAL=C/(N–n), where n is the number of capacitors with both leads covered by water. When you insert this expression in the equation for the 555 oscillation frequency, you obtain fOSC=(N–n)/1.4RCC. Note that the frequency changes linearly with water level.

This application uses 20 0.1µF, CK06-style capacitors. The lead spacing of these capacitors is 0.2 in. These dimensions provide a measurement range of 4 in. with a resolution of 0.2 in. This design uses 1MΩ for the oscillator timing resistor, RC, because the timing resistance must be much larger than the impedance of the water to minimize timing error. (Measurements of several municipal and residential well-water samples revealed impedance values of approximately 5kΩ in the frequency of 5 Hz to 1 kHz with 0.5 in. probe spacing.) Another reason for 1MΩ oscillator timing is that the DS2423 counter has a maximum input frequency of approximately 2 kHz. Also, you must minimize the power stolen from the bus. Finally, you must maintain maximum isolation of the water from the bus in the event of a catastrophic bus fault.

With these values of capacitance and resistance, the sensor's output-frequency range is approximately 7 to 142 Hz in steps of approximately 7 Hz. In practice, you might read the counter at intervals of several seconds to several minutes to obtain an averaging effect. This sensor has found application for two summers in a residential swimming pool. Users noticed no change in performance from corrosion or plating of the electrodes.


Reference 1:  Awtrey, Dan, 'Transmitting data and power over a one-wire bus,' Sensors, February 1997.

Loading comments...

Write a Comment

To comment please Log In