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.
||Effect on sea
||Effects on land
||0 – 0.2
||Sea like a mirror
||Calm. Smoke rises vertically.
||Ripples with the appearance of scales are formed, but without foam crests
||Wind motion visible in smoke.
||Small wavelets, still short, but more pronounced. Crests have a glassy appearance and do not break
||Wind felt on exposed skin. Leaves rustle.
||Large wavelets. Crests begin to break. Foam of glassy appearance. Perhaps scattered white horses
||Leaves and smaller twigs in constant motion.
||Small waves, becoming larger; fairly frequent white horses
||Dust and loose paper raised. Small branches begin to move.
||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.
||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.
||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.
||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.
||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.
||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.
||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.
||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.