While we wait
While waiting from the boards to arrive, I am going to write a bit about how the different values from the weather sensors are going to be read and calculated.
Inside the anemometer there is, what sounds to be, a reed switch. On the “rotor” (I have no idea what else it is called) there are two magnets which causes the switch to close twice per revolution.
To register the pulses from the anemometer, I am using the sampler function on the Electric Imp. The next thing we need to do is to configure the sampler to be as easy as possible to work with. To make it as easy as possible I set the sampler to 1000 Hz, so it will make 1000 samples per second. What is smart about this? The smart thing is it is one sample per millisecond, so it is easy to calculate with, and at the same time it is fast enough to read hurricane wind speeds.
Next thing we need to know is some kind of reference to be able to calculate the wind speed, and from the datasheet we get “A wind speed of 1.492 MPH (2.4
km/h) causes the switch to close once per second.” so now we can make a calculation.
1000.0 / pulselength * 2.4
And to test it a bit…
250 = 9.6 500 = 4.8 1000 = 2.4 1250 = 1.92 1500 = 1.6 2000 = 1.2
So now we got the speed in km/h, but just to make more data, why not also calculate it into m/s?
And just because it could be handy, maybe, adding a more human understandable description. So in the JSON returned by the Electric Imp agent, the following label will also be a part of the anemometer array.
|Knots||Beaufort||m/s||km/h||mph||Label||Effect on sea||Effects on land|
|< 1||0||0 – 0.2||<1||<1||Calm||Sea like a mirror||Calm. Smoke rises vertically.|
|1-3||1||0.3-1.5||1-5||1-3||Light Air||Ripples with the appearance of scales are formed, but without foam crests||Wind motion visible in smoke.|
|4-6||2||1.6-3.3||6-11||4-7||Light Breeze||Small wavelets, still short, but more pronounced. Crests have a glassy appearance and do not break||Wind felt on exposed skin. Leaves rustle.|
|7-10||3||3.4-5.4||12-19||8-12||Gentle Breeze||Large wavelets. Crests begin to break. Foam of glassy appearance. Perhaps scattered white horses||Leaves and smaller twigs in constant motion.|
|11-15||4||5.5-7.9||20-28||13-17||Moderate Breeze||Small waves, becoming larger; fairly frequent white horses||Dust and loose paper raised. Small branches begin to move.|
|16-21||5||8.0-10.7||29-38||18-24||Fresh Breeze||Moderate waves, taking a more pronounced long form; many white horses are formed. Chance of some spray||Branches of a moderate size move. Small trees begin to sway.|
|22-27||6||10.8-13.8||39-49||25-30||strong Breeze||Large waves begin to form; the white foam crests are more extensive everywhere. Probably some spray||Large branches in motion. Whistling heard in overhead wires. Umbrella use becomes difficult. Empty plastic garbage cans tip over.|
|28-33||7||13.9-17.1||50-61||31-38||Near Gale||Sea heaps up and white foam from breaking waves begins to be blown in streaks along the direction of the wind||Whole trees in motion. Effort needed to walk against the wind. Swaying of skyscrapers may be felt, especially by people on upper floors.|
|34-40||8||17.2-20.7||62-74||39-46||Gale||Moderately high waves of greater length; edges of crests begin to break into spindrift. The foam is blown in well-marked streaks along the direction of the wind||Twigs broken from trees. Cars veer on road.|
|41-47||9||20.8-24.4||75-88||47-54||Severe Gale||High waves. Dense streaks of foam along the direction of the wind. Crests of waves begin to topple, tumble and roll over. Spray may affect visibility||Larger branches break off trees, and some small trees blow over. Construction/temporary signs and barricades blow over. Damage to circus tents and canopies.|
|48-55||10||24.5-28.4||89-102||55-63||Storm||Very high waves with long over-hanging crests. The resulting foam, in great patches, is blown in dense white streaks along the direction of the wind. On the whole the surface of the sea takes on a white appearance. The ‘tumbling’ of the sea becomes heavy and shock-like. Visibility affected||Trees are broken off or uprooted, saplings bent and deformed, poorly attached asphalt shingles and shingles in poor condition peel off roofs.|
|56-63||11||28.5-32.6||103-117||64-73||Violent Storm||Exceptionally high waves (small and medium-size ships might disappear behind the waves). The sea is completely covered with long white patches of foam flying along the direction of the wind. Everywhere the edges of the wave crests are blown into froth. Visibility affected||Widespread vegetation damage. More damage to most roofing surfaces, asphalt tiles that have curled up and/or fractured due to age may break away completely.|
|64-71||12||>32.7||>118||>74||Hurricane||The air is filled with foam and spray. Sea completely white with driving spray; visibility very seriously affected||Considerable and widespread damage to vegetation, a few windows broken, structural damage to mobile homes and poorly constructed sheds and barns. Debris may be hurled about.|