Weather forecast based on pressure, temperature and humidity only (for implementation in Arduino)
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:


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}$


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}$

Adjust $Z$ for wind direction:


For Northerly winds adjust $Z=Z+1$
For Southerly winds adjust $Z=Z-2$

Adjust $Z$ for the season:


If Winter adjust $Z=Z-1$
If Summer adjust $Z=Z+1$

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.