# Weather forecast based on pressure, temperature and humidity only (for implementation in Arduino)

I have a project for my school to make, and I'd like to have some materials of research/graphs of dependencies about how the weather is predicted (i.e. cloudy, sunny, rainy). I've been searching the internet for the past few days but couldn't find something rather helping.

I can use an Arduino UNO and a bunch of sensors (i.e. atmospheric pressure, temperature, humidity, etc.), but my main problem is how to accurately interpret the parameters measured.

Such simple algorithms are empirical and for the same reason very local, so depending on your location they can have very bad performance. In the other hand, some people argue that properly calibrated they can be over 90% accurate.

Most of them are based in the Zambretti algorithm or some variant of it. This algorithm was originally implemented in a forecaster device produced by the firm Negretti and Zambra in the early XX century.

It considers the absolute value of the pressure, the trend of the pressure, the season and the wind direction (although wind direction and season have a small impact in the output). The algorithm is well described and translated to formulas in this article, but in summary it works calculating a tabulated forecast number $$Z$$ as follows:

1. From your measured pressure $$P$$, temperature in Celsius $$T$$ and the altitude in meters $$h$$ compute the atmospheric pressure reduced to sea level $$P_0$$. There are many formulas for this, a common one is:

$$P_0=P\left(1-\frac{0.0065 h}{T + 0.0065 h+ 273.15}\right)^{-5.257}$$

1. Compute the pressure trend and

• If the pressure is falling compute the forecast number as $$Z = 130-\frac{P_0}{81}$$
• If the pressure is steady compute the forecast number as $$Z = 147 -\frac{5 P_0}{376}$$
• If the pressure is rising compute the forecast number as $$Z = 179-\frac{2 P_0}{129}$$
2. Adjust $$Z$$ for wind direction:

• For Northerly winds adjust $$Z=Z+1$$
• For Southerly winds adjust $$Z=Z-2$$
3. Adjust $$Z$$ for the season:

• If Winter adjust $$Z=Z-1$$
• If Summer adjust $$Z=Z+1$$
4. Look up for the forecast from the following table:

This was made for the UK, and many people have developed modified version to work in other areas. You will find many implementations online with downloadable code, as this one in javascript, or this one in C for Arduino UNO, an explanation of this Arduino UNO implementation can be found here.

• Sir you are a life salver! Thank you so much. Mar 2 '19 at 13:49

In the Zambretti's documentation on Winter the Z number falling is lower by 1 unit, and the Summer Rising improves the prospect to 1 unit, therefore we have to adjust:

Winter Z=Z+1 Summer Z=Z-1

To compensate the derivation.

• Camilo's answer (and the article cited in the answer) states the opposite. May 27 '20 at 9:24