How to setup linear correction?

47 views
Skip to first unread message

Jonis Maurin Ceará

unread,
Jul 5, 2017, 3:04:58 PM7/5/17
to weewx-user
Hi!

I'm building my own weather station with custom hardware and I'm having some problems with barometer.
My barometer is reading 964 hPa while should be reading 1024 hPa, that's a '60' hPa difference.

I'm reading manual and I found an example with temperature, but I don't uinderstand how this works and how do I apply to my problem....

This is what I found in manual:

Perhaps you need a linear correction around a reference temperature of 68°F:

outTemp
= outTemp + (outTemp-68) * 0.02



I know that while reading 964, it should be 1024, but I don't know how to apply.

Tks!

gjr80

unread,
Jul 5, 2017, 4:21:07 PM7/5/17
to weewx-user
Hi,

How it works? Simple, each time weeWX receives a packet or record that contains outTemp, weeWX replaces the outTemp value with a new value that is equal to the original outTemp value plus 0.02 times the original outTemp value minus 68. The new outTemp value is then used and the old outTemp value is discarded and no longer used.

How to apply that in your case? Well first you need to work out what correction is needed; you gave a single point of comparison so there are an infinite number of 'corrections' that can correct 964hPa to 1024hPa, eg

barometer = barometer + 60
barometer = barometer + (barometer - 364) * 0.1
barometer = barometer + (barometer - 664) * 0.2

You really need to make a few more observations at different barometer values so you can develop some sort of correction equation.

A couple of other things, if you have a driver for your station you may wish to incorporate your 'correction' in your driver so that the driver emits the correct barometer value. Also, if you do persist in using a correction in weewx.conf, be aware that the units used in the correction formula are the units used by your database. So if your database is in US customary units (the default) your correction formula would need to be expressed in inHg.

Gary

Jonis Maurin Ceará

unread,
Jul 5, 2017, 4:33:23 PM7/5/17
to weewx...@googlegroups.com
Tks Gary!

For now, I'm using a fileparser driver. To write this file, I'm using a C program that I'm writting. This program reads from BMP280 and DHT22.....I'm just waiting other parts to arrive so I can build other sensors. I'm planing to read UV (just waiting AD conversor), light intensity and wind speed/rain gauge and wind direction, all from ebay and software custom-made (since sensors will be direct attached to my Raspberry Pi, no controller or commercial controller).

I'll try to evaluate my error and make some kind of formula. 

In the future (after all parts done), I'm planing to make my custom driver read direct from my C program instead of using text file/parser.



--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/JqoArGy91OY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Neil Trimboy

unread,
Jul 5, 2017, 11:17:43 PM7/5/17
to weewx-user
Have a read of https://github.com/weewx/weewx/wiki/Barometer,-pressure,-and-altimeter

You say you are making your own station.
That means you will likely be measuring pressure at your station so should be reporting that and letting weewx calculate barometer and altimeter.

For example my 1wire pressure sensor is correctly reading and reporting 980mbar. The default standard skin template displays barometer (whcih weewx calculated for me), which for mine is now correctly showing 1013mbar, which correlates with the surface level pressure maps from the weather forecast. (I live at 1000ft/300m height)

Run weewx with
sudo ./bin/weewxd weewx.conf
and you should see your LOOP packets, this will show pressure, barometer and altimeter.

Sanity check those numbers before applying any corrections
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Jonis Maurin Ceará

unread,
Jul 6, 2017, 8:10:41 AM7/6/17
to weewx...@googlegroups.com
hahahahaha......this is the perfect case of miss information can cause :(
I don't know anything about weather or stations.....I'm a programmer and electronic hobbyst. When I saw the nome of sensor, i tought: "this is a barometer field, since the name of sensor is "Barometer and temperature sensor" "... I was totally wrong.
I just setup everything correctly now and everything is perfectly calibrated. My sensor is a pressure sensor, not barometer (like said by Neil).

Tks for all help!

I have another question about WeeWx, but I'll create a new thread since it's a different question.


To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages