Skip to content

1 Wire Pressure Gauge

Lieven Hollevoet edited this page Sep 22, 2014 · 1 revision

1-wire Pressure Gauge for a pool Filter.

This is an example of using 1-wire components to create a 1-wire pressure gauge for MrHouse. Sensing pool filter pressure allows code to be written to detect when to backwash the filter and is useful as a status indicator of pool operation.

It uses the pressure transducer out of a pocket digital tire gauge, the 1-wire battery monitor circuit ( it has some A-to-D functions built in) and I modified an existing pool gauge to accept the tire gauge pressure transducer. I got it working, calibrated it, but have not used it much because of problems with the reliability of the "seasonal" connector for the 1-wire line and have not solved that problem. I live a climate that freezes solid and have built a pallet with the pump, chlorinator, etc that can be stored in a warm location in the winter. To make this easy all the connections from the pressure sensor, to the 2 inch plumbing use quick connectors. I chose to use a 1/4 inch stereo plug for the one wire bus - which although set at an angle to drain water away from it is not a reliable connector for 1-wire (the 1-wire physical link is not tolerant to getting damp). Since I was more interested in getting my 1 wire pool depth sensors to work and control the pool temperature, and depth automatically (which I did and have been using for about 2 years) I haven't solved that problem yet - so I haven't implemented any Misterhouse code yet because of the communication concerns.

A 1-wire pressure gauge was built using the following components.

  • A digital tire pressure gauge - cannibalized for the sensor. Accutire Model MS-4350B purchased from CanadianTire at $10 on sale. (I think most cheap monitors will have a similar sensor inside) I made some measurements on the sensor while it was in operation in the tire gauge to determine the bias current that should be applied, and the sensitivity (millivolts difference between S+ and S-) with respect to the pressure.
  • The PCB was made using laser printer toner lift off process (single sided) all the components were surface mount.
  • DS2438 (one wire),
  • LM324(quad op amp),
  • 11 resistors, ( 5% tolerance were used and seem adequate - errors are compensated for by the calibration),
  • 1 Diode (actually a surface mount matched pair (3 pin) salvaged from some junk board (modem)) what is important here is the diode has a typical silicon forward voltage drop of around 0.7 V which is used as a reference voltage for the current source for the sensor.
I actually built a prototype using old school proto-board (I made a carrier that converted a DS2438, and LM324 surface mount component to a DIL pinned pinout and then used axial components to get the right values and debug before building the circuit with all surface mount components.) This works for low frequency circuits such as this. Here is the schematic:file:OneWireGauge.pdf

Theory of operation:

The pressure sensor is really a Wheatstone bridge with each of the four legs of the bridge composed of a strain gauge one is affected by the pressure the transducer experiences and the other three are references. Because the resistance of the strain gauge is a function of the strain (or pressure) for only those set up to experience the strain under pressure, and all four react similarly to temperature, the wheatstone bridge is able to cancel the variations in supply current and temperature that are in common to all four elements and creates a voltage difference between the legs (S- and S+) that is proportional to only the pressure ( a small voltage (mV) difference). The first two operational amplifiers (pins 1,2,3 for S- and pins 5,6,7 for S+) are high impedance 201 times amplifiers that are co-referencing to offset DC bias and center the output voltage in the middle of the supply rails. The output from these amplifiers is combined in a difference amplifier (pins 8,9,10) with a slight gain (1.3 times) to produce a ground referenced signal that is proportional to the pressure which in turn is fed into the "VAD" input of the DS2438 for measurement and 1-wire access. The fourth OpAmp (pins 12,13,14) is used as a constant current source for the transducer - using the forward biased diode as a reference voltage, and the 4.7K resistor (closest to ground in the 3 connect to V- of the sensor) as a current sensor for the current flowing through the transducer - the OpAmp adjusts the voltage V+ of the sensor to obtain the correct current. The other two 4.7K resistors just "lift" the voltage that the transducer outputs operate at to center in the supply range and allow the downstream amplifiers to work in their linear ranges without clipping a supply rail.

Here is the pcb artwork file:OneWireGauge-Component.pdf Note you need to "mirror or flip horizontal in software" to use it in lift off mode.

The DS2438 sensor message provides the supply voltage, the A to D "measured" voltage, and the internal temperature. In theory it would be possible to determine the relationship between the pressure and the "measured" voltage AND compensate for supply voltage, and temperature errors. It turns out that this is not necessary since the analog circuit does an adequate job of compensating for the supply voltage variation (in green in the calibration file), and the temperature variation (in orange) where the pressure is held constant, and the "measured" voltage hardly changes. The other important value determine from the calibration file is the slope and intercept of the plot of the "measured" voltage to pressure so that a simple linear equation can be used to convert the measured voltage to pressure (i.e. "measured" voltage times slope plus intercept equals the pressure). I used the built in functions in excel to convert the observations to determine these values but the old school way of drawing a line on the plot of the values would work as well. Here is the calibration file for the working unit. file:Calibration.pdf

image:PressurePlot.gif

Mechanical:

The starting point was a regular pool gauge with it's plastic removed.

The target enclosure is a 1.5 inch ABS plumbing pipe joiner and end cap. A grove was cut into the inside edge of the joiner to accept the clear plastic lens, and a square was cut in the side to allow the brass fitting to stick out. The pcb was cut to fit in the end cap and a short section of 1.5 inch abs pipe was cut and then sliced along it's length to both hold the board in place, and join it to the ABS joiner which was shortened to jst allow it all to go back together. The pipe stop ring inside the end cap and joiner were removed with a ream bit on a high speed rotatary tool.

The existing gauge without it's plastic and with the gauge face temporary removed was modified to allow the connection of the transducer from the pressure gauge. A 3/8" NPT to 1/8 inch brass hose bib attachment was purchased at the hardware store. The small hose bib end was cut away from the large screw thread section and the small diameter was measured. A drill of the corresponding size was used to drill a hole in the top of the brass block of the original gauge at an angle so that the bib and hose would not interfer with the expansion tube of the original mechanism. The brass hose barb section was slide into the hole and soldered into place with plumping solder.

The transducer was connected to the hose barb with a silicon tube with a spring placed overtop to ensure it did not blow off. The face was put back on, and the whole thing assembled into the ABS enclosure. In the picture you can see the gauge is threaded into a quick connector (all brass) so that it is easy to remove for the winter.

Here are some photos; image:P1010002.JPG align="center" caption="Pool Gauge with tire pressure sensor added"

- showing the tire gauge transducer connect to the simple dial gauge. image:P1010006.JPG align="center" caption="Surface mount PCB with components"

showing the surface mount board I made to go in the extended gauge (using a 1.5 inch ABS plumbing cap.) image:P1010004.JPG align="center" caption="1-wire Pool Gauge with tire pressure front view"

gives a front view before assembly.

Clone this wiki locally