Hi Everybody, Dr John Shovic. I’m the CTO of SwitchDoc Labs and we’re here today to talk to you for a whole week about the weather. This is Weather Week at SwitchDoc Labs for the next four programs. OK, so it’s a little more than a week. But you won’t be bored!
We’re going to be talking about weather and how you can build your own stuff to measure weather and how these instruments work that actually measure the weather. Let’s start out by saying we’re going to talk about five different weather instruments. Today we’re just going to talk about one and that’s the anemometer. I just want to quickly run through the other ones. This is a rain bucket, it measures rain. Water goes down inside, and then there’s a self tipping bucket back and forth that measures the amount of rain that comes in. That’s a pretty cool instrument.
Then we’re also going to be talking about a wind vane that determines of course the direction of the wind. That’s a pretty cool instrument too. We’re also going to be talking about a outdoor temperature and humidity sensor that you can actually calculate the dew point too, which is pretty cool, which is an AM2315. And finally we will also be, well not quite finely, but we’ll also be talking about this and this is the SwitchDoc Labs Weatherboard. This has a barometer on it and a whole bunch of other things that will allow you to connect all these weather instruments very easily to an Arduino or Raspberry Pi.
So what are we going to be talking about today? Well, there’s one other instrument that it was kind of missing in our list and that’s our friend, the Anemometer that’s kind of like pronouncing aluminum.
So this is the anemometer. This is the anemometer we’re going to be talking about today. These are called cups and the anemometer circles around and measure wind speed. What we’re gonna talk about is how this measures wind speed, how it actually works and how a computer can tell. And then we’re also going to talk about other ways you can measure the wind with other kinds of instruments, which are some of which are pretty dog gone cool.
Before we get into that, I have to tell a joke. This horse walks into a bar and the bartender looks at him and says, hey, why the long face? That wasn’t very good. I’ll go back to the science jokes later.
Anyway, our friend, the anemometer, the way this works is there’s a little reed switch inside. A reed switch is just two little pieces of metal that have a magnet above the reed switch. And every time it rotates, the magnet goes by the read switch it pulls those two little contacts together, shorting them together. And that’s what our system actually reads. So each time this goes around that anemometer inside’s going, click, click, click, click, click, click. One time for each rotation.
And since we know how far the rotation is, we can measure the time between clicks that gives us the instantaneous wind speed. To calculate an average wind speed, you just average it together. You can look for gusts by looking at the shortest time between clicks or if there’s no clicks, you know you don’t have any wind. Pretty easy. But how does a computer deal with this?
Remember I told you that the anemometer clicks, it turns, it shuts that reed relay by a magnet going over the top all the time. So there’s no active electronics in here. That’s it. It goes to a plug, which we can plug into a variety of instruments, including the SwitchDoc Labs Weatherboard. And this is all part of the, what we call the SwitchDoc Labs Weather Rack. It’s three instruments together.
So how does this work? I’m gonna put up a little white screen here and take a look at how this actually works. And by doing this I’m going to draw a couple of little diagrams. Now remember I told you that every time the anemometer goes around, it actually closes a little reed relay. We have the line pulled up to the power supply so it stays at a 1. I’ll talk in digital terms here.
So we’ve got to pull up to a 1. The only time it goes to 0 is when that read relay shuts, pulling it to a 0. So you get a waveform out of this and we feed directly into the computer that looks like this. It comes along, it’s high, high, high, high, high. And then finally that reed relay really clicks. It comes down, it stays down there a little while, then goes back up. Well, that doesn’t tell us very much. The important thing now is we have to look at what happens next. Well, it keeps going over here and then it goes down again and it comes back up again when the magnet moves past the relay. So now we have some information. What can we get out of that? Now, computers are really good at measuring time. They have clocks on board, they can tell distance between two events.
We actually use something called an interrupt. There’s other ways to do it, but all we need to talk about is interrupts is it basically tells the computer when you get that falling edge on the line. So what we do is when we see the falling edge, we mark that, the computer remembers what time it is at that point. We wait to another falling edge, and then we measure the time between point A and point B. So we know the time between those two things, the closer they get together, the faster the wind speed.
Now that does mean that at some point you’re not going to be able to measure any faster wind speed. But I’ve looked at that one time and it’s about 4,000 miles an hour. But if we have a 4,000 mile an hour wind, we’re not going to be worrying about our Raspberry Pi or our wind gauge or anything like that. These things will be long gone. So a computer is plenty fast enough to measure normal wind speed. So if this gets closer, if the time between A and B is shorter and shorter = faster and faster, wind speed. And that’s all we measure. Pretty cool! But you want to know something secret?
Bumbles bounce. Whoa. No, that’s from Rudolph the red-nosed reindeer. But one of those words is a program that’s bouncing. Turns out this works really well, but if you don’t do something special, you’re not going to get the right answer and will show you why.
Turns out that any kind of a mechanical switch, reed switch, the light switch or the little buttons you have in your board that you push to make your computer do things. Those things bounce. Any kind of mechanical switch bounces the contacts, when they close, they actually go bip, bip, bip, bip, bip. They actually bounce open, close, open, close, open, close.
Our computer is so fast, we’d measure all those. So we’ve got to do something. But let me show you what the waveform really looks like. It looks more like this, up and down, up and down, up and down. And finally it will stay down and then go up when when it goes by. This is called bouncing, or the bounce time. And so what you have to do in order to actually measure this, you’ll wait for the first edge, you pick that up and then we measure how long this bouncing is and it’s on the order of maybe 100 milliseconds or 115 milliseconds. It’s a lot less than a second. And so what you have to do is you have to wait the bounce time before you start looking at this signal again.
Now you can debounce this a number of different ways. You could debounce with a piece of hardware or you can actually de-bounce it with a piece of software. It’s really got to be empirically determined, depending on the kind of pull ups you have, the mass of the switch and what’s going on in the system.
So it’s not an absolutely trivial piece of software for you to get accurate results on here. And this bounce time probably limits the maximum amount of speed you can get more than anything else. On the order of maybe 15 milliseconds or something like that. And that will put a limit on how fast this anemometer will actually work this bounce time. So there you have it. Now we really do understand how an anemometer manages to measure things.
So that’s how we measure wind speed. But you know what, that’s not the only way you can measure wind speed. You can do things likeput a hot wire in the air and you’ve heard of windchill, right? You know the wind blows by something, it cools it down.
Well, here’s the deal. You put a hot wire up there, and if it’s a thermistor, which means the resistance varies according to what temperature it is. You can actually measure the wind speed by looking at the change in that resistor as the wind blows by it. That’s pretty cool.
Now there’s other ways too, but one of my favorite is called a pressure tube otherwise known as a wind sock. You can actually measure those things and see how fast the wind is blowing.
That’s pretty cool. I like that! Now, one more thing here. You can also use lasers to do that, laser dopplers, oooh I like lasers. But there’s one more way to do it too. And this is the way you do it on airplanes.
They’re called Pitot tubes. There’s two little tubes and we can measure the difference in the resistance by the sensor inside those two tubes. And we can determine the wind speed from that.
So all sorts of different ways of measuring wind speed. But we’re going to stick with this one.
So what did we talk about? We talked about a whole bunch of weather instruments. We’re going to learn how they work this week. We also talked about a variety of different anemometers and how they work and we talked about this specific anemometer and how you measure it by measuring the time between clicks. So I guess the right way to end this blog is let’s create some wind, see you next time for rain buckets.