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.

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:

The circuit requires an additional power source other than that of the 1-Wire network.
The MPX4115 requires about 7 ma of current. This is more than a 1-Wire network can provide
without an elaborate circuit to store parasitic power from the 1-Wire network for short burst
of current for pressure measurements.

The resolution of the barometric pressure is somewhat greater than ideal. With a
pressure range of 28.0 to 31.0 inHg the resolution is about 0.015 inHg. If a reduced pressure
range of, say, 28.7 to 30.7 is tolerable a resolution of 0.01 can be achieved.
More resolution is not possible because the 5 volt MPX4115 has a range of 0 to 115 Kpa (~0 to
34 inHg), the D2438 is a 10 bit A/D but has a voltage range of ~1.5 to 10 volts, and normal
operational amplifiers have a linear range of 0.75 to 3.5 volts (in 5 volt applications).
Together all three devices are somewhat incompatible for constructing a single 5 volt power
supply barometer. By keeping the voltage to 5 volts allows the use of a Simon Hub.

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.

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

Component PC Board -- Radio Shack 276-149

Dual 4 Pin (or 6 Pin) PC Mount Modular Jack

2.1mm DC Power Connector

8 pin soldertail DIP socket

16 pin wirewrap or soldertail DIP socket

DS2438 -- It appears that only a surface mount package is available

Motorola MPX4115 silicon pressure sensor NOTE: No pin numbers are on the schematic
because the pin numbers vary for the different packages

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

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 see if the DS2438 is alive, connect the barometer to your 1-Wire adapter and run the
iButton viewer. If it is alive you will see its 64 bit address (ID).

Now to see if the barometer is alive -- if you did not set the 10K pot (R3), set it in
the middle of the resistance range.

With the barometer still connected to the 1-Wire adapter, in a MSDOS window run:
baroCalibrate 3.25 1.25 31.0 28.0

baroCalibrate should show the adapter and COM port followed by a DS2438 device ID. It
will give you a chance to select the correct DS2438 in case you have more than one on your
1-Wire network. Then it will display a continuous output of data from the DS2438.
Turn the 5K pot (R4) until the Vad changes as the pot is turned.

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.

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.

Run baroCalibrate.exe -- which requires 4 arguments. They are:

The out voltage (out of U1A) at the barometer high pressure limit.

The out voltage at the barometer low pressure limit. These are pretty much determined
by the circuit. Use those shown below at first.

The value of the barometer at the high pressure limit -- your choice of units.

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

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.

Repeat the above step until there is no change.

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).

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

The slope of the trendline is nearly perfect: 1.00143.

The offset is also excellent. If extrapolated to a
pressure of 0 inHg the predicted reading is: -0.03856 inHg.

The standard error is 0.01263 inHg.

The average difference between my readings and the local airport 25 miles away is: 0.0050.
To reduce this error to 0 requires me to adjust R4 to 1/2 of the A/D resolution. Hard to do.

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.

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:

U1A output range: 0.69 to 3.59.

DS2438 output lowest voltage: 1.2 (The highest voltage is ~10)

Level changer:
Input: 4.25 Output: 1.12
Input: 3.04 Output: 2.69

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.

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.

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.