PDA

View Full Version : Davis Wind Speed anemometer



adn
08-10-2005, 02:46 PM
I am trying to build a wind speed anemometer with the davis anemometer which uses a reed sw and the count command to measure the rpm (bs2sx). I have all the info for the sensor from the OWL2 page (26rpm for each mph wind speed).
When the rotating cups stop near the point when the reed sw is closed i get very wrong data.
The OWL2 page mentions this and sugests to use the swiched supply of 5.12V(?)
Please help

Paul Baker
08-10-2005, 09:57 PM
I think Tracy Allen makes the OWL2 (if not, he has extensive experience with them), so he would be the best to answer your question. Meanwhile can you provide a link to the page where you are getting this information from? I attempted to locate it myself, but was unsucessful.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ˇ1+1=10

Tracy Allen
08-10-2005, 11:54 PM
What sort of "wrong" data are you seeing?

It is a good idea to include a debounce RC circuit, because the contacts in the reed relay will bounce, and that can fool the COUNT command into reporting a wind speed much higher than it really is. I've attached a debounce circuit.

http://forums.parallax.com/attachment.php?attachmentid=38523

This uses two pins. Pin p8 is used for COUNTing the reed switch, and pin p9 is made HIGH to activate the pullup resistor, with the capacitor there for debouncing. You could tie the pullup resistor to +5 volts, if the current drain through the pullup resistor is not a concern for low power operation. The anemometer cups will often stop with the reed switch in the closed position. The purpose of the 270 ohm resisotors is to limit current from the capacitor in the Stamp and in the reed switch.


The anemometer cups do not need a regulated power supply. The regulated power supply is for the wind vane, which is a potentiometer.

http://emesys.com/OL2wind.htm <-- I need to edit that page. Davis is reporting that the windspeed constant is a little different than I have there. Now it is 0.4444 Hertz per mph. 60 Hertz in a 135 mph wind. 2.25 mph per Hertz.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

adn
08-11-2005, 03:07 AM
Thank you for your reply and for the very good information you have on the internet.

I was using the shematic from the count example (basic stamp editor help) and before I read your e mail I tried to pass the signal from the anemometer through a Schmitt Trigger (74HCT14) and it seems to work much better. I am going to test your schematic tomorrow...

Now I have some trouble converting the scale to work with the BS2SX. I probably dont understand the timing of the count command. How did you calculate the 2.308 sec that will give a direct reading in mph?
Please help.

Tracy Allen
08-11-2005, 01:18 PM
The anemometer switch closes N times in a time interval of length T:

N = T * mph / 2.25

proportional to the wind speed (here in mph) with a conversion factor of 2.25. That is, iby counting for 2.25 seconds, you are left with,
N = mph
The count comes out directly in mph. I used 2.25 here instead of 2.308. That is because 2.25 is the figure that Davis is giving out now for the proper calibration factor for their anemometers, including the new Vantage Pro 6410.

On the BS2 and BS2e, the command to get the result directly in mph is thus,
COUNT 0, 2250, resultMPH ' BS2, BS2e

On the BS2sx, the command is,
COUNT 0, 5625, resultMPH ' BS2sx

That gets the same amount of time, because the 'sx uses time intervals of 0.4 milliseconds instead of 1 millisecond, and 0.4 * 5625 = 2250 milliseconds.

To get the result in other units, the equation is similar. Say, meters per second...
N = T * mps / 1.00575
COUNT 0, 1006, resultMPS ' BS2, 2e

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

adn
08-11-2005, 08:49 PM
Again thank you for your input.
I did try your schematic for the anemometer today and it works fine.
I am not sure if the Schmitt Trigger is better but since it works fine with just a capacitor, I quess there is no need to use the Schmitt Trigger.
Another problem now is that when you use the COUNT command you slow down the hole basic stamp program which updades every 2.3 seconds or every 1 second if you use m/sec.
I was wondering if there is a way to make it faster, use a different method like the PULSIN command in order to make it faster. Will it work with the Pulsin?
Many thanks

Paul Baker
08-11-2005, 11:54 PM
In theory, PULSIN should work, but it may require more tweaking depending on the construction of the anemometer (like the duty cycle of the waveform seen must be accounted for, but with COUNT the duty cycle is irrelevent). Also the error will be larger with PULSIN, if the error is +/- 2uS for both PUSLIN and COUNT, that 2uS is spread out over the entire COUNTing period, whereas the error will be for each PULSIN, if you extrapolated the fact that many PULSINs will be called in the same amount of time as one COUNT, you'll see the error will be larger when using PULSIN.

Now, will this be a serious issue? I don't know, but you can test the two different methods by placing the anemometer a fixed distance and position in front of a fan and compare the two to find out.

<edit> Well it seems I stand corrected, see below post for an explaination why. Tracy is much more knowledgable in this than I am, so follow his advice. </edit>

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ˇ1+1=10

Post Edited (Paul Baker) : 8/11/2005 4:56:38 PM GMT

Tracy Allen
08-11-2005, 11:57 PM
The debouncing is the most important thing, and the Schmitt trigger does not intrinsically do that.

I know what you mean about the time it takes to COUNT the wind speed. To get a good picture of a gusty wind, you need to sample quite often and record the average and maximum. Infrequent samples tend to grossly underestimate windspeed. Note that the Davis weather stations do in fact update their readings once every 2.25 seconds. In a data logger, you could sample the wind once every 10 seconds, leaving plenty of time for other stuff or for power-conserving SLEEP.

PULSIN by itself does not work, because the wind cups signal is frequently longer than the maximum PULSIN value (0.131 second for the BS2--corresponding to windspeed >17mph). The cups are often completely stopped. And you would have to measure both the high-time pulse and the low-time pulse, because the dwell time of the reed switch is not well controlled. You might figure out a way to do it with a program loop, but it gets messy.

Now I often use an external counter chip to offload the windspeed and rain gage counting from the Stamp.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

adn
08-15-2005, 01:57 AM
Thank you for the help.
You are upsolutely correct about the PULSIN command. It is too fast for the anemometer.
Maybe for a fast tach aplication will work ok...
The external counter that you mentioned is the frequency to voltage converter circuit you have on your internet page? Could you please explain how to use it with the bs2.
Thank you in advance.

Tracy Allen
08-16-2005, 01:45 PM
The external counter is based on a PIC chip programmed in assembly. It monitors the anemometer (and rain gage) and reports the total counts to the stamp on command at intervals.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Paul Baker
08-16-2005, 11:20 PM
I would like to point out that because the maximum length for PULSIN is shorter than you desire, does not mean it cannot be used. I outline how to expand the length measurable by PULSIN in this thread (http://forums.parallax.com/showthread.php?p=544819). Since the anemometer maybe at standstill, you may want to limit the number of times PULSIN will be called. This is done by inserting "IF OuterCount > MaxRep THEN EXIT" after OuterCount has been incremented, where MaxRep is defined as the number of PULSINs will be called before assuming the anemometer is not spinning. There is some overhead to calling multiple PULSINs, so to obtain an accurate reading youll need to adjust the final count (increasing its amount to account for the extra time done LOOPing, incrementing etc).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ˇ1+1=10

Orion
08-17-2005, 09:13 AM
A while back, I saw an RTC that could be used as a 16 or 32 bit counter via spi or I2C.ˇ Instead of the crystal, you fed in the signal to count.ˇ I think it had a register to config it into this mode.ˇ I know this is not much help but maybe it somebody else knows of this IC.ˇ Another good IC that I did not bookmark!ˇ In the future, I would like to monitor meters with similar outputs and thought this would be a good way to offload the stamp.
ˇ
ˇ
btw Hats off to your website Dr. Allen, it has been a valuable resource of the years!

Loopy Byteloose
08-17-2005, 11:38 AM
I just wonder if...
isn't all this switching unnecessary?

There seem to be a lot of ways to build this device - DC motors, magnet on a shaft and a hall effect sensor, a cam driven switch..

Wouldn't a DC motor and a generator provide a variable voltage according to wind speed? This could then be directly read by the BasicStamp through a voltage divider.

If the motor requires a high rpm, one that is geared down might be useful.

The only problem is that some DC motors have a diode inside to prevent reverse connect [a 12V computer fan motor for instance].

I do realize that this would have to be calibrated. Once the electronics are right, maybe a ride in the back of a pickup truck on a calm day would do the trick.

By the way, I have two 5.1 volt power supplies from old PDAs. The first was a Sony CLIE @2amps and the second was a Tungsten E @ 500mA. They are quite handy because you can insert a polarity protect diode in your project and a have near perfect 5volts from the wall wart.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan

Tracy Allen
08-17-2005, 02:17 PM
Orion, the Philips PCF8583 can be used in event counter mode. It is an I2C real time clock + RAM, but in the event counting mode the osc input becomes the event input. Maybe that is the one you saw.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Orion
08-19-2005, 08:09 AM
Thank you I'll check it out.

metron9
08-20-2005, 01:54 AM
How about a stepping motor? Take one of those old IBM floppy drives apart, You can count the pulses for exact rotation

John Couture
08-20-2005, 09:18 AM
Another type of sensor that you can use that doesn't have as much bounce is a Hall Effect Transducer. Basically mount a magnet on the spinning anenometer and position the transducer (looks like a small transistor) close enough that it trips. Pretty nifty because there is no reed switch to wear out.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture

San Diego Miramar College

adn
08-25-2005, 05:20 PM
I was searching for a counter and found this scematic with the 74LS590 and the 74HC165.
Can I use this as an external counter for the anemometer and if I can how i will modify it for the anemometer
Thanks for any help

Paul Baker
08-25-2005, 11:42 PM
yes, the circuit can be adapted for your application. The annemometer's output once debounced feeds the clock signal (RCK, CCK) to the 165.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ˇ1+1=10

adn
08-26-2005, 05:00 AM
Could you please explain how this counter works?
The counter will count each pulse from the anemometer and then I will retrieve the counts with the bs2. I need to know the number of pulses at a specified time interval. The counter will count for a specific time by itself? How i will specify the time interval?
Thanks for your help

Paul Baker
08-26-2005, 10:52 PM
The 590 counts the number of cycles the annemometer produces, the 165 is a serial shift register. First you drive the /CCLR to the 590 low, the counting cycle starts when you pull /CCLR high again. Then after your specified time period has elapsed, you pull the SHIFT/LOAD line of the 165 low (now the documents are unclear if the SHIFT/LOAD is level activated or edge activated for the load operation, I believe it is edge activated which is the instructions that I am giving). After this is done, the count of the counter is now in the shift register, which you then read in serailly (refer to documents on how this is done, you'll be using the PBASIC SHIFTIN command). So to nutshell:

LOW CCLR
HIGH CCLR
PAUSE delay
LOW SHFTLD
HIGH SHFTLD
SHIFTIN Q7, SCK.....

This is just an example, you'll have to fiddle with it to arrive at functioning code, such as choosing the correct SHIFTIN mode.

Hope this helps.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ˇ1+1=10

adn
08-27-2005, 05:55 AM
Thank you for your reply.
Do you know of a timer ic with serial output so that I will not need the parallel to serial converter ic?
Thanks for your help

Orion
08-27-2005, 10:04 AM
Tracy already mentioned one;

Tracy Allen said...
Orion, the Philips PCF8583 can be used in event counter mode. It is an I2C real time clock + RAM, but in the event counting mode the osc input becomes the event input. Maybe that is the one you saw.


Datasheet

http://www.semiconductors.philips.com/acrobat_download/datasheets/PCF8583_5.pdf

Check point 7.8ˇEvent counter mode on page 11ˇin theˇdatasheet, counts up to 1 million!!!

Post Edited (Orion) : 8/27/2005 3:03:38 AM GMT

Tracy Allen
08-29-2005, 02:32 AM
I'll get together a description of my own event counter chip, which is a PIC12F629 programmed as a 5 channel state machine debouncer/counter. It counts events up to 100 hertz (which covers the Davis anemometer and rain gage) It talks to the Stamp on one RS232/ttl line. Maybe I should consider offering it for sale, as there does not seem to be anything quite like it on the market.

http://forums.parallax.com/attachment.php?attachmentid=38682

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Orion
08-29-2005, 08:08 AM
I'd buy one. This would be also a great project for sx/b...one more reason for me to buy the sx dev kit.