HOME > > SENSING AND CONTROL MAIN PAGE > > SENSORS > > WEATHER > > DALLAS 1-WIRE

Sensing and Control for hobbyists and schools: Weather, Dallas 1-Wire Barometer


First catch your barometer kit. How to do that was covered in this page's parent page. Alternatively, you may be able to find one second hand, or perhaps a bare pcb which you can populate yourself by ordering the various parts. The board is 50 x 67mm, marked "1-Wire Barometer v3". It is marked with the following URLs. They are both worth visiting:

     David Bray's site (circuit designer). http://davidbray.org
     Simon Atkin's site (pcb designer). http://www.simat.org.uk


At 10/04, it is possible that the kit available from Eric Vickery's Hobby Boards is the same one! ($10 for bare board, $57 for kit of parts at 10/04. (I'd buy the kit with parts if I were you... a large part of that is an expensive sensor you will only have to buy for at least as much elsewhere, plus all the nasty fiddly little smts that, even if you have them, are a pain to extract from your stocks.)

In the first half of 2002, the Dallas Weatherlist people conducted a group project which resulted in a small pcb interfacing the Motorola MPXA4115A-AC6U pressure transducer to a DS2438. Sadly, the Weatherlist discussion group is no more. Click here for information on it and alternatives.

An aside: The DS2438 is a pretty cool chip, by the way. An ADC, a high resolution temperature sensor, some non-volatile memory, an ammeter, a clock (not real-time, i.e. it won't give you the time in hours and minutes... but it could be the basis of a software created RTC)

Back to the barometer! If you have a kit of parts, or a second hand unit, you may be looking for someone to assemble, fix, or calibrate it for you. Click here for a list of willing folks.

The rest of this is some notes of things that I had to be careful about when assembling my own kit, just in case it makes things easier for you. You should view this as secondary to the excellent advice posted by Simon Atkin. He has kindly put all that you need in a little zip called baro30package.zip. This has a Parts List, Schematic and the calibration calculator BaroCalc. The page you are reading now is compiled from various helpful things posted by people in the Weatherlist. Although they may have been cleared up by the time you read this, I think that there were come confusing version ID references at the site once upon a time.... or maybe i just misread things. Use the pictures! While David Bray's contribution to the design of the device was enormously important, I didn't find I need to go to his site during construction of my kit.

Thomas Nolan has kindly done a photo of a completed barometer for you.

Many of the parts are extremely tiny. A clear workspace and a tray to work in are very good ideas. I also had a smaller tray (4" x 6") in which parts could live until required.

Start by printing out the parts list. Cut a piece of paper to fit the bottom of your small tray. Draw a grid on it with columns 2 cm wide. Label them A, B, C... etc. Make three 2cm high rows, and split the rest of your height into two more (larger) rows. Label the rows 1 - 5. Pour (carefully!) the contents of your pink bag into a pile in the middle of your big tray. Be sure there are no parts hiding in the sockets of the RJ-45 connector. Pick out the big bits, put them back in the bag, writing "b" next to their entries on the parts list. Pick up a small bit at random, identify it, put it in a square, and write the square's reference (e.g. A1) next to the part's entry on the parts list. Do this for all of your parts. You should find a part for each thing on the parts list.

By going through identifying everything first, you'll be more confident you're right if you think something's missing, and there's less chance of substituting one part for another. Get all of your identification issues resolved before you start assembly.

Most of the parts have numbers you can use to identify them. What you see on yours may vary from the following, but just in case what I had helps....
My C7 was marked 105/16k/113
C1,4 and 6 were unmarked, but were obviously 3 of one thing, and the only such.
C2,3 and 5 are the "big" cans
D1 is the "large", traditional diode: a cylinder with wires out the ends.
D2 is the only device with three legs. Marked L44R. I managed to solder mine in upside down... letters should be showing.
R1: 390 ohm marked 391
R2: 100k, 1003
R3: 15k 1003
The other resistors are 1k to 9k, so their right hand digit is always 1. The first two digits tell you the number of hundreds of ohms, so R4, for instance, which is 2k7 is marked 2741.
VR1, VR2: marked Y2021E and Y502 respectively.

This would seem to be a spot for a big "thank you" to Alan, et al, for making no assumptions about our junk boxes and including an led and the header pins and jumpers, just in case. (Oh yes... and a case!) (This is a thank you to someone who no longer supplies the kits.)

Before you get carried away with assembly, just note that you are advised to adjust VR1 and2 before soldering them into the circuit. I'll say more at the relevant point in this guide.

I like to put an ohmmeter on the bare board before starting. Might as well find, fix flaws if they show up before the confusion of the components. There are many test you could make, but I'd suggest the following. All references to the board will assume that you have it turned so that the long dimension runs left and right and the pads for U2 are at the edge near you which I'll call the "bottom" edge. All of the following should show open circuits...

-- Pads for C2, upper right.
-- The middle two pads in either half of the RJ-45 connector pad sets.
-- Only the three obvious pads for the pressure sensor connect to anything. There should be no circuit from any of them to any of the others.
-- To your patience's limit: See that there's no connection between the two pads for any one resistor or capacitor.

Solder in the resistors and small capacitors. My thanks go to Jim Montague and brother for their sanity saving idea:

Take a stout pin or small nail. Take some Vise-Grips (aka Mole-grip) pliers... or a pair of needle nose pliers with a stout elastic band around the handles.... and grip the pin in the jaws of the pliers, at right angles to the jaws, with about 2" protruding. Find a book or something else solid that is about 2" high. Put it on your workbench, a little farther from you than your soldering area. Rest the handles of the pliers on the book so that the pin is pointing down. When you are ready to solder something, put the pcb under the pin. Put the component in place. Lift the pin, move it, lower it down on the component so that the weight of the pliers holds it in place. (It helps if you date back to the era of putting a needle on a vinyl LP record!!)

Obviously, you can modify the suggested arrangements to suit what you have to hand, but something like it IS a great help. A fine tip on your soldering iron is nearly essential. There's a good guide to soldering at EPE magazine's site.

Of the small resistors and capacitors, only one, C7, is polarized, i.e. has to be soldered in the right way around. the banded end should be to the "left", i.e. the end nearest to U1.

Until R7 and R8 have been installed, you will still see open circuits, and you are still safe to measure resistances. Two places particularly worth trying are the pads for C3 and C5. You will see 2k7 between the pads of C5 once R7 and R8 are installed.

Install the diodes, except the LED, D3. D1 and D4's band's go towards the top of the board. D1 will just about fit the board parallel to the board if that is your preference, but fits better vertically.

When you solder things in with leads passing through the board, note that in some cases they should make contact with the large area of unetched copper on the board's underside, but in most cases they should NOT. The little gap between the plated through hole and the ground plane is pretty small, and requires careful work.

Solder in the 3 large caps (C2,3,5). They are polarized, just don't overlook the shape of the base and Simon's helpful silkscreen guide.

This is a good time to clean the board, to remove any flux that remains. Be sure the components have cooled. Use isopropyl alcohol. If you buy some rubbing alcohol for this job, be sure it isn't "enhanced" with oils, etc, which might be fine for your skin but won't help you with the next bits of soldering.

Take your last chance to check the board with your ohmmeter. Some "open" circuits make look shorted briefly, but will show as open once the capacitors charge up in response to your testing.

Now install U1 and U2. Pin 1 on both of them should be at the upper right. I.e. U1's pin1 near J3, U2's pin 1 near VR1. Pin one can be identified from either a small dimple in that corner, or a very tiny "groove" (looked more like a blemish to me!!) on the SIDE of the chip, by pin 1 or a notch in the end of the chip that is the pin 1 end.

Next install the voltage regulators. They go with the "tab" "out". I.e. the mostly metal face is on the side away from VR1. (If you're not clear on what I mean, the picture on Simon's website is very clear.) The middle pin on each does connect to the ground plane, but the other pins do not. (Well. they SHOULD not!)

Solder in the header pins for J1. the column of 6 holes just to the right of J1 is for an alternative pressure sensor package, unused in the design as made up in mid 2002.

The board needs an external DC power source. It doesn't need to be regulated, i.e. very stable at nearly exactly one value... U3 and U4 provide regulated voltages from the rough voltage you supply. 12 volts is good. 15 would be okay, maybe even 18. (Maybe even higher... see data sheets for the 7805 and 7810... but I hope you have something between 11 and 19!). If you are going to feed it in via the RJ-45, then go ahead and solder in header pins for J2 and J3. At least initially, I simply used the right hand through plated hole of J2 as a place to connect my external power. More on these jumpers and what they accomplish later. If you are going to solder the RJ-45 in place, have a good look at the connections made on the pcb between the outer pins of the sockets. I forgot to do this, and so can't tell you all I'd like to about what goes on under the connector. Of course, you can look at the pcb artwork on Simon's site. (The schematic doesn't give absolute certainty for nervous-type readers.)

Either solder in the RJ-45 socket, or make your own arrangements for connecting the 1-Wire data and ground wires. If you use the RJ-45, to make it more robust, you can solder a "staple" around it using the two largish holes right at the edge of the pcb. If you strip a little extra insulation from the wire, the bare stretch makes a good place to clip the 0 volt connection of your voltmeter during calibration and testing.

========
Here begins a section about VR1 and 2. Remember: Simon's notes are your prime source; there's much more there about them, but hopefully the following will give you what you need for assembling the device.

Before you do any more soldering, you are advised to run the little program "BaroCalc", which comes as part of Simon's zip file. I used version 30e. There are some ways you can flummox the program, so "pay attention:". Run it. You can ignore "report header". Fill in your elevation, in feet. You can change the four values in the boxes under the one for elevation, but probably that's not a great idea. CLICK THE CALCULATE BUTTON (bottom of form). (Guess which bit I missed!). Either just jot down the four lines of information given on the screen, or, if you want computer generated hardcopy click the Generate Report menu item. Fire up Notepad or some other simple text editor. Load "Output.txt" from the directory BaroCalc was in. Are the last two lines

"LoVolts =..."
"HiVolts =..."?

If so, you didn't click "Calculate", did you?!

So, you now have the approximate values needed for VR1 and VR2. N.B.: You can only measure the resistances with the devices not yet soldered into the circuit. It isn't a great disaster if you missed this point, and your variable resistors are already soldered in. Leave them. But life will be easier if you do pre-set them.

BaroCalc30e gives you the resistance you should adjust VR1 for on the half between the wiper and the leg that will be connected to R6. Either I misread it, or I was looking at an old version of the assembly notes, but I thought I read something along the lines of "The number BaroCalc reports is for the resistance between VR1's wiper and ground INCLUDING R6..." This, at least with BaroCalc30e, is not so. he resistance given by BaroCalc30e's is for the wiper-to-R6 resistance. (By the way, the software I used for printing out the schematic made R6 look like R0. But there is no R0, so don't worry if you encounter the same problem.)

The center pin is the wiper. If BaroCalc told you that VR1 must be set to 1600 ohms, you want 1600 ohms between the wiper and the leg of VR1 which will be nearest U2. If BaroCalc told you you need 1800 ohms for VR2, you want 1800 ohms between the wiper and the leg of VR2 nearest the RJ-45 socket.

========
Moving on.... Don't connect to a 1-Wire net just yet, but, cross fingers, do a final check, and apply power, fingertips on U1 and U2... If they start to get hot, kill the power... they shouldn't! At this stage, you've nearly finished assembly. All that's missing is the pressure transducer (MPXA...), the LED (D3), maybe the pins for J2, J3, and even when done, you'll still have the 6 empty holes for the alternative pressure sensor.

If you didn't have to kill the power, put D3 into the circuit, "dry", i.e. without solder. This is just a quick and foolproof test to see which way around it goes. If it doesn't light, put it in the other way around, when it should light. Kill the power; solder D3 in. For now, unless you already know how you will be casing the project, leave the leads as long as possible. (Not every component's polarity can be determined this way, but there's no harm in this approach with LEDs.)

You still don't need to have the (expensive) pressure transducer in the circuit.

================
Connect your barometer to a 1-Wire system, and use the iButton Viewer program to look for it. Version 3.12 of the Viewer is too old. (Click "Help|About" to check your version number.) (The one which comes with TMEX SDK 3.20 is new enough.) You should see your DS2438. The last two digits of it's id will be 26(hex). Quite amazing all the stuff that's in this little beauty!! There's a temperature sensor reading to 0.03 Celsius degree (yes... 3 hundredths!!), among other things. (If you want to use that, remember that the two voltage regulators on the pcb are giving off heat.) The thing you need for the barometer is VAD.

Once your barometer is finished and calibrated, you will keep a jumper on pins 4&5 of J1. That's the two pins at the top end, the end near C5. For now, that jumper should not be in place, and you should connect the calibration tool via J1. Happily, my junk box only had a 4 way Molex connector, so when I'm doing calibration, I "park" the jumper on pin 5. That reduces the chance of me losing it, and of plugging the tool in incorrectly. By the way... the potentiometers for the calibration tool do not need to be exactly 5k, or even both the same. 1k to 50k will probably work.

Don't be too alarmed if switching between the high voltage and low voltage you don't see dramatic (or any!) change in VAD. That happened to me at first because my VR1 and VR2 (hereafter called "the pots") were badly misadjusted.

As you begin the calibration process, try to keep track of where your pots were when you started. A little dab of nail polish on a side of the bolt heads doesn't hurt. After a few minutes twiddling, you MAY able to say "VR1's dab started at 12 o'clock, and has been turned three-and-a-half turns clockwise." If you lose track, so be it, but you may want to be able to "start again".
Use a voltmeter or the iButton Viewer to look at the voltage at U2 pin 4 (i.e. VAD). There's a through plated hole just below the lower left corner of U2 which makes an easy place to clip on a voltmeter lead. Solder in a short piece of wire if that helps. A voltmeter will respond more rapidly to voltage changes than the Viewer does.

Leave the board powered up for a while before beginning calibration. Overnight is not too long.

The calibration process works like this....
----- Switch tool to feed high voltage to the circuit.
----- Adjust VR2 to make VAD closer to what it ought to be.
----- Switch tool to feed low voltage to the circuit.
----- Adjust VR1 to make VAD closer to what it ought to be.
----- Repeat from top.

Two secrets:
-- Move slowly. Suppose your high voltage reading is out by 3 volts. Don't adjust VR2 very far on the first try. Take out, say, about a sixth of the error, leaving things wrong by 2.5 volts. Then move on to the check/ correct low voltage step, and again take out only a little of the error. When you go back to the high voltage check/ correct step, you will probably find that the error is no longer exactly 2.5 volts. By moving each a little closer to "right" each time, you will zero in on "perfect" more easily. With some setting of VR2, it isn't even possible to get the other voltage "right" by adjusting the other pot.
-- Beware drift. Especially when adjusting VR1, VAD doesn't change immediately to the value you will eventually see if you give the circuit a little while (aout 20 seconds?) to settle. The rule is this: After you change the pot, watch the voltage for a while. At first it will change in one direction. Eventually, you may see it changing slightly with time, but up AND down around an average figure. That's the VAD for this setting of the pots and the input signal now in place.

A final point on calibration: Get it as close as you can, of course, but don't hope that you've achieved perfection. Any decent software will be capable of fine tuning the numbers coming from the sensor to translate them to mbar, mmHg, mPascals or whatever you want to use!!

===
Regarding your wonderful, but expensive and delicate pressure sensor, the MPXA... Do NOT poke anything, even "just" a hair, into the sensor. Do not blow directly into it. You can see the voltage change if you blow hard-ishly and steadily at the sensor from about 6" away. The output from the transducer varies very little... possibly too little for your voltmeter. Get the op-amp working properly, as above, before attaching the sensor, and then you can watch VAD to see the sensor react to pressure changes.

Disconnect power. Solder in the pressure sensor. Pin 1 has notch in it's leg, and that corner of package is "blunted". Pin 1 goes near C6.

Remove your calibration tool and put jumper between pins 4&5 of J1, the pins at the top, the ones near C5.......

..........ENJOY WORKING BAROMETER!!!!!

In the UK, the following will tell you what the professionals think the pressure is. Local conditions (e.g. a breeze) can alter what you see on your barometer. One experimenter was seeing weird sawtooth patterns in his data..... and eventually realized that they were the result of his forced draft boiler turning on/ off.

Think about the "errors" you may have. Thanks to my GPS, I discovered that my car's speedometer reads 5mph low across the whole scale. (When it says 10, I'm going 5, when it says 65, I'm going 60) A different error might be a 10% error. In that case, 5.5 would mean 5 and 66 would mean 60. These sorts of error are easily taken care of in software. If you are getting errors that follow no pattern, that's not so good. Do look at the magnitude of the errors, though.... it is easy to forget what a slight difference exists between the highest and lowest pressures you'll see in a whole year. No one's system is going to track reference figures to differences of 0.01 volts on VAD!

Professional barometer readings you can compare you figures to....
UK Met Office chart
Sussex University data (Not working 2/05.. temporary?)
Sussex University Weather Station (Not working 2/05.. temporary?)
(If you have other good URLs (UK or other regions), please send me a plain text email? Click here for eddress. I'll try to get around to adding them here a little faster than my usual editorial cycle dictates. Remind me of the promise!)
Lots of links for online weather observations and climate data.

Want to cheer yourself quickly, easily? After your barometer is pretty well calibrated, LEAVE VR1 and VR2 alone for a while. Record your barometer's reading (use a voltmeter, if your software isn't ready yet). Record the professionals' ideas of the pressure at the times you recorded your readings. Put them in a spreadsheet, one column for your data, one column for the professionals'. Tell your spreadsheet to do an XY graph for you of one plotted against the other. I was delighted by the straight line I got, even using professional data from not very close, and which didn't always have values for exactly the time I wanted!
Be sure to check other pages of this site for things which might have appeared on this page, but were either mis-sited or had a more general relevance. Click this to search this site without using forms, or just use......
powered by FreeFind
Site search Web search
The search engine merely looks for the words you type, so....
*    Spell them properly.
*    Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....

Please also note that I have two other sites, and that this search will not include them. They have their own search buttons.
My site at Arunet.
My oldest site. (It's at Compuserve).
Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows pc) please visit my freeware and shareware page, download something, and circulate it for me? At least (please) send an 'I liked the build the barometer page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Other projects

This is just one of the guides I have published on the net. Please visit any of the following that relate to interests you have....

Delphi Tutorials
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page

You can email this page's editor, Tom Boyd. Click here for details.

Index of sensing and control pages (From there you can also go to other help from the editor of this page.)

-- Page ends --