New information:
Revised initial calibration instructions -- Oct. 5
Correction to baroCalibrate arguments -- Oct. 1
Newest Calibration Chart -- Sept. 29
Suggestions on Final Calibration

This design has been superseded.

The transistor level changer in this design was found to be temperature sensitive.
A new design has be made, built, and is now under test.
The changes are small so you can scope out the project on this page, but don't build this version.

An Experimenter's 1-Wire Barometer
A work in progress.

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

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 transistor, 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 one of these barometers has been constructed and it located at an altitude of 460 feet. It is newly constructed and is not even fully calibrated.

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


Circuit Description

For barometric pressures the MPX4115 output voltage ranges from about 4.17 to 3.72 volts at sea level, and about 3.5 to 3.04 volts at 5000 feet. This entire range is well 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 large range variation yet have a reasonable gain and voltage levels, an active level changer is used. It consists of a PNP transistor amplifier and a passive voltage divider. The output if the MPX4115 is divided a small amount by R1 and R2 to get the maximum voltage to about 1.1 volts below the 5 supply volt. This puts the 2N4403 transistor into its active region. This voltage is then amplified with the 2N4403 inverting 1.5/1 gain stage, giving an overall gain of 1.29 and voltage levels referenced to ground rather than 5 volts.

This output is fed to a unity gain opamp stage, U1B, (to not load the active voltage divider) which feeds an adjustable gain opamp stage, U1A, capable of a gain range of 1/1 to 5.5/1. The 10-turn potentiometers (pots) control the gain and offset. R3 controls the gain of U1A and R4 controls the offset from ground of the output voltage.

The overall gain needed is about (3.25 - 1.25) / (4.17 - 3.72) = 4.4. The available overall gain is about 7.15 (i.e. 10K/1.8K*1.29).

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

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

Major Construction Challenge

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.
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.
Top view of the constructed board.
Bottom view. Board is flipped vertically.

Parts List

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


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 transistors, resistors, capacitors, etc., but you must solder them after wrapping.

Before construction is started it is recommended that R3 be set to 6.1K. 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 It contains both the source and executable Windows binary image of baroCalibrate.exe for testing and calibration of the 1-Wire Barometer.

To test the circuit:

When the Vad voltages changes the barometer is working.

Before the barometer can be calibrated:

  1. Determine your altitude.
    Note: If your location is greater that 5000 ft you might not be able to get your barometer calibrated without changing a couple of resistors. Reading the "Technical Information and Discussion" section below should help you. If you have trouble please contact me.

  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 check your calculation with these
    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 temporarly disconnect the jumper between the MPX4115 and the 15K resistor. Connect the 15K 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.

  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, cold high pressure mornings can give a significant pressure difference from my local airport 25 miles away. Also it would appear that a silicon pressure sensor does not have the hysteresis of mechanical barometers.

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 current spreadsheet (Sept 29, 2001) with a pressure range of 0.7 inHg. I am pleased how linear it is.

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: my current R3 resistance is 6.1K (as suggested above) and the slope is 1.0399. If this slope holds when I get low pressure readings I will change R3 to 6.1K/1.0399 = 5.87K.

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 3.0 inHg below the same pressure translated to 5000 feet: 22.98 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: 3.03.

A range of 4.25 to 3.03 is required to allow locations as high as 5000 feet.

Removing the jumper and feeding the level changer 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.

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.

This circuit is offered for noncommercial purposes only. Any other use must have prior written authorization from David W. Bray.

You are visitor to this page.

Main Page