Useful Project Ideas for Your Raspberry Pi with Tutorials
The wind speed, wind direction, and rain amount sensors used in the personal weather station are pretty cool. They contain no active electronics.<p>The wind speed sensor uses a magnet and a reed switch. Once per revolution the magnet passes over the switch, momentarily tripping it.<p>Pull up a GPIO, hook it to one side of the switch, hook the other to ground, and then just count the pulses you see on the GPIO. Wind speed is proportional to pulse rate.<p>The rain gauge also uses a magnet and reed switch. It has a collection cup mounted on a pivot. When empty it rests tilted to one side, with half of the cup below the pivot and half above, with the two halves separated by a barrier so that water cannot flow between them. The water falls over the center of the cup, and the geometry is such that it ends up on the high side of the cup.<p>When enough rain accumulates in the high side, it causes the cup to pivot to that side. The cup is shaped so that water cannot remain in the low side, and so the full former high side drains, leaving the cup empty. The other side is now the high side, and starts filling, leading to an eventual pivot back, and the cycle repeats.<p>It pivots after 0.011 inches of rain. During the pivoting the magnet passes the reed switch. Hook it to a GPIO just like with the wind speed sensor, count the pulses, multiply by 0.011, and you&#x27;ve got inches of rain.<p>The wind direction sensor also uses a magnet and reed switches. It has 8 reed switches arranged around a circle, evenly spaced. The magnet is on the arm that points in the wind direction, arranged so that as the arm rotates it passes over the reed switches.<p>The magnet is powerful enough and&#x2F;or the reed switches are sensitive enough that the magnet does not have to be right over the switch to trip it. It can be a little the side. This distance is great enough that you can actually have two switches tripped at once. As the arm rotates, the pattern you see is a single switch is tripped, then that switch and one of its nearest neighbors are both tripped, then the first switch opens but the neighbor remains closed. As it continues to rotate, that neighbor and the next one past it will both be closed for a bit, then the first neighbor opens.<p>By looking at which of the eight switches are closed, you can tell which of 16 directions is closes to the one the the wind is coming from one.<p>The reed switches are all wired in parallel, each in series with a different value resistor. You can tell which switch or switches are closed by measuring the resistance. For example, supply a constant voltage to one side of the sensor, hook the other to a known resistance, and use an ADC to measure the voltage across that known resistance. You can then calculate the resistance from the closed switches and their resisters, and see what combination of switches must be closed to produce that resistance.<p>The link given in the article on building the weather station that points to Argent Data Systems to buy the sensors gives a product not found message. You can get very similar sensors at Sparkfun [1].<p>I was going to say you could get the <i>same</i> sensors at Sparkfun, because that is where I got mine, but the ones I bought were these [2], which is listed as retired, with an updated version available which is the one I linked to above.<p>The difference? The older version appears to actually be from Argent. The datasheet says Argent Data Systems. I&#x27;m not sure Argent actually made them, because the Argent data sheet says &quot;Imported by Argent Data Systems&quot;.<p>The newer version&#x27;s datasheet says &quot;Shenzhen Fine Offset Electronics Co., Ltd&quot;, and is in metric (rain gauge tips at 0.2794mm), and has both English and Chinese text.<p>I wonder of Shenzhen Fine Offset Electronics is the original maker that Argent imported from, and Sparkfun just switched to importing them itself?<p>Comparing the Chinese text to the translated English text in the Shenzhen datasheet is interesting. For the rain guage, the Chinese text says 0.3mm, which would be 0.0118&quot;. This suggests it might even be that Shenzhen made this originally for Argent, designed for US measurements, so it is 0.011&quot;, that got converted to metric (0.2794mm) in Shenzhen&#x27;s English documentation, then rounded to 0.3mm in Shenzhen&#x27;s Chinese documentation. Or, it was designed to be 0.3mm, that got converted to 0.011&quot; (although it should have been 0.012&quot; as the correct result is a tad over 0.0118&quot;) in the Argent documentation, and Shenzhen for some reason decided to go with that but convert to metric in their English documentation, instead of using the correct 0.3mm?<p>Another interesting difference in the Chinese and the English: the wind speed sensor Chinese documentation contains 0.33m&#x2F;s. The English documentation says 2.4km&#x2F;h, which it says is the wind speed that will cause the switch to close once per second. The Argent document says &quot;1.492 MPH (2.4 km&#x2F;h)&quot;. The things is, 2.4km&#x2F;h is 0.667m&#x2F;s, not 0.33m&#x2F;s.<p>Do they measure frequencies per half-second rather than per second in China for this kind of thing? I can&#x27;t think of any reasonable way to explain that factor of 2.<p>[1] <a href="https:&#x2F;&#x2F;www.sparkfun.com&#x2F;products&#x2F;15901" rel="nofollow">https:&#x2F;&#x2F;www.sparkfun.com&#x2F;products&#x2F;15901</a><p>[2] <a href="https:&#x2F;&#x2F;www.sparkfun.com&#x2F;products&#x2F;retired&#x2F;8942" rel="nofollow">https:&#x2F;&#x2F;www.sparkfun.com&#x2F;products&#x2F;retired&#x2F;8942</a>