An Experimenter's 1-Wire Barometer
Version 1.1a

New information:
Jim Jennings has improved printed circut layouts -- Oct. 25, 2001
Final Calibration Chart -- Oct. 30, 2001

This article describes details for constructing a 1-Wire Barometer which will work on a Dallas Semiconductor Corporation 1-Wire network.

The reason for this second version is that the transistor level-changer of the original design was found to be temperature sensitive. If you have constructed the original version (V1.0) you can modify it according to the diagram shown below. This involves removing the transistor and 5 resistors, then rewiring it with 6 new resistors.

The goal of this design was to make a simple reliable 1-Wire barometer with reasonable pressure resolution and one which could be constructed without a specialized printed circuit board by a hobbyist.

This design uses a Motorola MPX4115 Silicon Pressure Sensor, a Dallas Semiconductor DS2438 Smart Battery Monitor (to perform 1-Wire analog to digital conversion), an operational amplifier, a voltage regulator, a diode, and several resistors and capacitors.

Construction of this circuit should not be attempted unless construction of IC circuits on project boards similar to this have been done before. It is a pains taking task.

This must be considered a work-in-progress. To date only three of these barometers have been constructed. Two of them are located at altitudes under 500 feet, and one is located at 9500 ft. All are newly constructed and not fully calibrated.

As more barometers are constructed feedback is requested, and improvements in the design are welcome.

Limitations:


Circuit Description

For barometric pressures the MPX4115 output voltage ranges from about 4.25 to 3.79 volts at sea level, and about 2.77 to 2.45 volts at 10,000 feet. Most of this range is above the active voltage range of a 5 volt opamp circuit. In effect the sensor voltage is referenced to the power supply, not ground as desired.

To allow for this high voltage, a voltage divider is used to bring the voltage down to the active range of 5 volt opamps -- this has a gain of 0.68.

This output is fed to an opamp stage, U1B, which has a gain of approximately 2.16. This stage has an adjustable voltage input which is added to the barometric sensor output within the opamp, thereby allowing the adjustment of the output voltage offset to the A/D converter. This in turn is fed to an opamp stage with a gain of U1A, capable of a gain range of 1/1 to about 8.58/1. The 10-turn potentiometers (pots) control the gain and offset. R3 controls the gain of U1A and R4 controls the offset of the output voltage.

The output is fed to the 1-Wire DS2438 A/D.

The overall gain needed is about (3.25 - 1.25) / (4.25 - 3.79) = 4.4 at sea level, and (3.25 - 1.25) / (2.77 - 2.45) = 6.25 at 10,000 ft. The available overall gain is about 12.6 (i.e. 0.68 * 2.16 * 8.58).

Note that the MPX4115 feeds R1 through a jumper. This will allow easy change of input voltage from a source than the MPX4115 for calibration.


Construction

Printed Circuit Board

Jim Jennings has designed a single sided printed circuit board for this barometer. If you can make a PC board it will make construction much easier.

Construction details for making a manually wired board follow.

Mounting the DS2438

The DS2438 is a surface mount device. As such it is so small that ordinary IC mounting techniques will not work. To allow this device to be used on a common IC perforated construction board, the DS2438 must be mounted on a DIP IC socket. It can then be plugged into a socket on the barometer board. Following is a technique of mounting the DS2438.

It would appear that Digi-Key has an adapter you can buy rather than build this. Their catalog lists Digi-Key part: A724-ND as an adapter for 8-pin SOIC to 8-pin DIP for $6.97. I do not know for a fact that this part will work.

A DS2438 surface mount IC mounted on a 8-pin soldertail DIP socket of the type shown here. How it was mounted:
  • Stripped wirewrap wire was first soldered to the 6 required socket pins.
  • A small amount of silicone seal glue was put in the center of the socket.
  • Using tweezers the DS2438 was carefully laid on the silicone seal pushing it only enough to attach the glue and not enough to push the glue up between the pins of the DS2438. A different type glue could be used but you must firmly attach the DS2438 to the socket in order to do the next steps.
  • After the silicone seal was dry (more than 24 hours), each wire was bent with tweezers so that it was touching the respective DS2438 pins.
  • Using a very sharp soldering iron each wire/pin combination was soldered.


Board Layout

A suggested parts layout for Version 1.1.
Top view of the constructed board -- Version 1.0.
Bottom view. Board is flipped vertically -- Version 1.0.


Parts List

A source of parts is: Mouser Electronics, Digi-Key, Newark Electronics, Radio Shack among many others.


Constructing the board

It is best to use very small wire. I prefer to use wirewrap wire. It is easy to strip and solder.

The parts should be soldered to the pads at the respective locations. It is not necessary to solder all of the pins. It is easier to attach the wires if they are pushed into the pad beside the pins and then soldered. If you have a wirewrap tool it can be used to wrap the wires of resistors, capacitors, etc., but you must solder them after wrapping.

Before construction is started it is recommended that R3 be set between 2.8K and 4.8K depending on your altitude. 2.8K for sea level, or 4.8K for 10,000 ft, 4K for 5000 ft etc. That will pre-calibrate the gain of U1A.

Testing and Initial Calibration

It is assumed that you already have 1-Wire hardware and software working on a computer. If not you must obtain information on both at: iButton-TMEX and Developers Tool Kit

Download the package baroCalibrate.zip. It contains both the source and executable Windows binary image of baroCalibrate.exe for testing and calibration of the 1-Wire Barometer.
If you can execute Perl you can download presMPX4115.zip to help you find your numbers discussed below.

To test the circuit:

When the Vad voltages changes the barometer is working.

Before the barometer can be initially calibrated:

  1. Determine your altitude.

  2. You must be decided on the desired useful range. For sea level, readings of 31.0 to 28.0 inHg (105.0 to 95.0 kPa) might be typical. But you might want to use a more limited range such as 30.7 to 28.7 inHg (104.0 to 97.2 kPa). Also, you can calibrate your barometer to read sea level readings or absolute readings at your location.

  3. Using your altitude compute absolute pressure for the upper and lower pressure ranges you have selected.
    absolutePressure = exp((log(1 - 6.87324e-6 * altitude) * 5.256)) * seaLevelPressure
    where: altitude is in feet, and log and exp are base e.
    You can use presMPX4115.pl to compute this or you can check your calculation with this
    Altitude vs Pressure Chart #1 or this Altitude vs Pressure Chart #2.

    For these two absolute pressures compute the output voltage of the MPX4115 with the formula:
    MPXVoltage = 5.0 * (0.009 * kPa - 0.095) or
    MPXVoltage = 5.0 * (0.009 * inHg * 3.3863 - 0.095)

    Call these voltages Vhi and Vlow.

  4. Find the current barometric pressure at the altitude, and corrected to sea level if that is what you want. Your best source of current sea level corrected barometric pressure is NOAA weather radio or airport data from the major weather services on the Web. Use data from a source as close to you as possible.

  5. Turn off the power to the barometer and temporarily disconnect the jumper between the MPX4115 and R1. Connect R1 (47K resistor) to the center of a 10 turn test voltage pot, say 10K (actually any pot from 1K to 100K), which is connected across the 5 Volt supply.

Now to calibrate the barometer.

  1. Run baroCalibrate.exe -- which requires 4 arguments. They are:
    1. The out voltage (out of U1A) at the barometer high pressure limit.
    2. The out voltage at the barometer low pressure limit. These are pretty much determined by the circuit. Use those shown below at first.
    3. The value of the barometer at the high pressure limit -- your choice of units.
    4. The value of the barometer at the low pressure limit -- your choice of units.
      For example -- using inches of mercury:   baroCalibrate 3.25 1.25 31.0 28.0

  2. By example, using the above arguments, turn on the power and adjust the test voltage pot to the upper voltage Vhi and set R3 to get the upper pressure DS2438 voltage of 3.25 and which results in the pressure of 31.0.
    Then set the pot to the low voltage Vlow and set R4 to the low pressure voltage of 1.25 which results in the pressure of 28.0.

  3. Repeat the above step until there is no change.

  4. Turn R4 until the current barometric pressure is displayed. This is the sea level pressure since sea level pressure was used in the arguments for this example.
    The reason you need to set the actual pressure is that your MPX4115 may have an inherent pressure error. The pressure error specification is ± 1.5% (± 0.45 inHg).

  5. Disconnect the power and replace the jumper.

This completes the initial calibration.


Suggestions on Final Calibration

Getting your barometer accuracy calibrated will take adjustment over several cycles of barometric pressure change. The initial calibration will not be accurate unless your MPX4115 has the same output vs pressure slope as the typical sensor.

I am beginning to learning about local micro-climate pressure differences. From what I have learned so far there can be significant pressure difference from my local airport 25 miles away depending on the direction of the isobars. If the isobars are perpendicular to the direction of the airport expect differences.

My recommendation is that you do not attempt to adjust the potentiometers of your barometer until you create a spreadsheet of local airport pressure vs your readings, and do this for a significant number of readings over a range of pressures.

Following is my 14 day data spreadsheet with a pressure range of 1.27 inHg -- 29.31 to 30.58. The barometer was calibrated for a range of 28.8 to 30.8, giving a resolution of 0.01 inHg.

My Final Calibration


Results


Once you have those results you can use a linear trendline (regression) to find the slope of local vs airport readings. If the trendline slope is not 1.0, use that slope to correct your gain resistor R3.
The slope will be a multiplicitive change to the current R3 resistance. For example: if current R3 resistance is 3K and the slope is 1.05, change R3 to 3K/1.05 = 2.85K.

Before you spend too much time getting an accurate calibration you should decide what range of pressure changes you want to track and what out range of output voltage of U1A you consider satisfactory.


Technical Information and Discussion

Clearly you want to get the best resolution, that is the smallest voltage step output from the DS2438 A/D. Since the opamp and the DS2438 have limited linear voltage ranges we want to use the maximum range.

First we need to know the maximum possible voltage range of the MPX4115. Assuming the maximum desired pressure at sea level is 31.0 inHg, and the lowest is 28.0 inHg translated to 10,000 feet: 19.926 inHg. These Altitude vs Pressure Chart #1 or this Altitude vs Pressure Chart #2 might be of help.

To find this MPX4115 voltage we can use the formula on the MPX4115 datasheet:
MPXVoltage = 5.0 * (0.009 * kPa - 0.095) or
MPXVoltage = 5.0 * (0.009 * inHg * 3.3863 - 0.095)

Thus the maximum voltage is: 5.0 * (0.009 * 31 * 3.3863 - 0.095) = 4.25, and
the minimum voltage is: 2.45.

A range of 4.25 to 2.45 is required to allow locations as high as 10,000 feet.

Removing the jumper and feeding R1 with a variable voltage the following information was found:

Once we find the linear range of the U1A/DS2438 combination the opamp gain can be calculated.
Following is a graph for a barometer input voltage range of: 4.17 to 3.72 volts, and a A/D value of 3.25 to 1.27.


The results show a very linear graph with a small standard error.
It would appear that the upper range could be extended to 3.30, or 3.40 volts.

Wrapping up the details:

To improve the resolution to 0.01 inHg the range could be reduced to a difference of 2.0 inHg -- say 30.7 to 28.7. This will require larger gain in the opamp. Hopefully the design will allow sufficient gain for all desired configurations.

Happy Construction!

Feedback Please! -- David.

Disclaimer and Usage Information

This circuit and construction details are provided without warranty of any kind. This information is published in good faith, and it is believed to be a circuit which will function as described above. However, proper construction techniques are required, and it has not been extensively tested. The user assumes the entire risk related to the use of this information which is provided "as is". The author disclaims any and all warranties. David W. Bray.


You are visitor to this page.


Main Page