Low Power, Accurate Barometer

When I was a kid, we had one of those old Aneroid glass-on-wood barometers hanging in the hallway. I remember my dad would tap on the glass a couple of times a day, to get an updated accurate reading. When you tap a mechanical gauge in this way, you are said to be applying dither (see below). With digital sensors we no longer need to do this.

Atmospheric pressure, or more importantly, the trending movement of it, is a telltale indicator of coming weather events. I wanted to build an accurate, low power, digital barometer. This has had it's own set of challenges, which have been a pleasure to work through. Here I document my experience building this wonderful device.

After reading about a new MEMS pressure sensor, I decided to try it out. The SCP1000 MEMS digital pressure sensor from VTI Technologies is a temperature-compensated, digital sensor that has high accuracy and resolution. When set to 17-bit resolution it can detect pressure differences resulting from a change in altitude of only 9cm! These sensors only come in a tiny-footprint surface-mount package, so I got one that's already mounted on a handy breakout board from Sparkfun Electronics.

Atmospheric Pressure and Trending

The pressure readings are displayed in units of hectoPascals (hPa), which is equivalent to the old millibar (mB) scale.

When examining a pressure trend it is important to know what to look for, in order to tell what the weather is going to do.

I found the following definitions on the National Weather Service website (NWS/NOAA) located at http://www.nws.noaa.gov/glossary/index.php?letter=p (scroll down to the definitions that start with "Pressure...")

Pressure Change

The net difference between the barometric pressure at the beginning and ending of a specified interval of time, usually the three hour period preceding an observation.

Pressure Characteristic

The pattern of the pressure change during the specified period of time, usually the three hour period preceding an observation. This is recorded in three categories: falling, rising, or steady.

Pressure Falling Rapidly

A decrease in station pressure at a rate of 0.06 inch of mercury (2 hPa) or more per hour, which totals 0.02 inch or more. (I think that's supposed to say "totals 0.20 inch or more" (about 6 hPa)).

Pressure Rising Rapidly

An increase in station pressure at a rate of 0.06 inch of mercury or more per hour which totals 0.02 inch or more. (I think that's supposed to say "totals 0.20 inch or more" (about 6 hPa)).

Pressure Tendency/Trend

The character and amount of atmospheric pressure change during a specified period of time, usually 3-hour period preceding an observation.

Pressure Unsteady

A pressure that fluctuates by 0.03 inch of mercury or more from the mean pressure during the period of measurement.

On the basis of these definitions, I designed this barometer to show the current reading and the historic reading of approx 3 hours prior. It does this approx once per minute (67seconds). When it performs the reading and display refresh, it will show the historic reading for 0.5sec before showing the current reading.

Circuit Description

The circuit schematic is fairly straightforward as it does not involve many components. Most of the action happens in the sensor subsystem and in the software. The SCP1000 pressure sensor communicates with the host micro via SPI (Serial Peripheral Interface). Much has been written about SPI, so I won't repeat it all here, but I will document the "conversation" that happens between the SCP1000 and the micro. The micro I use is a Microchip PIC16F88. This device has what the manufacturer calls "Nanowatt technology", which means that it uses little power, especially when sleeping. I use the same serial LCD subsystem that I used in the thermometer project, i.e a seven-segment LCD and a Motorola MC145453P Serial-to-LCD driver IC. So again, I won't repeat all the details here. This project uses a Microchip MCP1702-33 voltage regulator to obtain 3.3 volts which is required for the SCP1000. Due to this requirement I decided to power the whole circuit through this regulator.

[add schematic]

Software

The software is written in a combination of Oshonsoft PIC BASIC and PIC Assembler. The Oshonsoft BASIC compiler comes with their PIC simulator. I highly recommend this toolset. It is low-priced, easy to use, and works well. It allows you to embed assembler in the source, which it dutifully compiles (ignores) without any fuss. After compiling, I load the resulting .asm file into the free Microchip MPLAB development environment and program it into the micro using my PICstart plus programmer. I know, I could have used ICSP in-circuit programming, but I didn't. While I like to do some of the low level control stuff in Assembler, I use the BASIC to do the heavy lifting for the 32-bit math. Math can get messy and time consuming in Assembler, and I don't find it an enjoyable challenge.

Upon startup everything gets initialised as usual. The SCP1000 has some special requirements. It first gets configured for "low noise operation", then it gets placed into "low power, trigger" mode. In this mode, the SCP1000 will wait in standby mode for a command from the micro, before initiating a read/conversion cycle. Once the read/conversion is completed, which takes about 125ms, it asserts the DRDY (Data Ready) line. The micro then MUST clear this by reading the pressure data, before a new cycle can begin. If the micro does not clear this, an error condition occurs and an error code is placed in the output data registers of the SCP1000. 17-bit resolution is not required for plain old barometery, so I use it in 15-bit mode (the lowest setting). See the data sheet for more details.

The current reading displayed on the barometer is actually a 10-minute moving average. This is done to "smooth out" any rapid, short-term variations in the readings and slow the rate of change. After reading the sensor, the number gets placed into a ring buffer containing the latest 10 readings (each taken approx one-per-minute). The average of these readings is taken as the current reading. This result is itself then placed into another ring buffer containig the 10-minute averages for the past 3 hours (i.e 180 readings). During each refresh cycle, the oldest of these is displayed for 500ms, before it then displays the current reading. This is so the observer can see what the pressure was 3 hours prior, in order to discern the trend (see above).

Low Power Strategy

The discussion here is all in microamps (uA). Low power consumption was fairly easy to obtain with this project. The combination of experience with my thermometer project and of reading the data sheet for the new device came good. The SCP1000 is implemented in this project in "low power trigger mode". In this mode it spends most of its time drawing about 1uA, which rises to about 5uA when it is reading/converting and communicating with the micro. The LCD subsystem draws about 8uA all of the time. The PIC16F88 draws about 2uA while in sleep mode, which is most of the time, rising to over a hundred microamps when running. The voltage regulator is a Microchip MCP1702-33 which draws only 2uA quiescent current - Wow! what a find that was. The total circuit current draw in sleep/standby mode is only ~13uA. When it is awake and updating the display it draws ~170uA. Since the awake/operating time is a relatively short period compared to the sleep/standby time, the averaged power draw is only ~16uA. This is confirmed by my trusty logging Bench Multimeter over a couple of hours. On this basis I expect the 3xAAA Alkaline batteries, to last for about their shelf life of 2-3 years.

With such a low power budget, I'm considering switching these projects to be powered from a small, cheap solar panel and rechargeable battery.

Applying Dither

Back on the subject of tapping mechanical gauges...

"One of the earliest applications of dither came in World War II. Airplane bombers used mechanical computers to perform navigation and bomb trajectory calculations. Curiously, these computers (boxes filled with hundreds of gears and cogs) performed more accurately when flying on board the aircraft, and less well on the ground. Engineers realized that the vibration from the aircraft reduced the error from sticky moving parts. Instead of moving in short jerks, they moved more continuously. Small vibrating motors were built into the computers, and their vibration was called "dither" from the Middle English verb "didderen," meaning "to tremble." Today, when you tap a mechanical gauge to increase its accuracy, you are applying dither." -- Ken Pohlmann, Principles of Digital Audio.

Contact Me

I'm Greg Newton from Sydney, Australia. If you want more information, you can contact me at greg dot newton dot oz at gmail dot com (written like that to avoid spam bots).