Shop OBEX P1 Docs P2 Docs Learn Events
Davis Wind Speed anemometer — Parallax Forums

Davis Wind Speed anemometer

adnadn Posts: 17
edited 2005-08-29 01:08 in BASIC Stamp
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

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-08-10 14:57
    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 AllenTracy Allen Posts: 6,656
    edited 2005-08-10 16:54
    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.

    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
    223 x 98 - 2K
  • adnadn Posts: 17
    edited 2005-08-10 20:07
    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 AllenTracy Allen Posts: 6,656
    edited 2005-08-11 06:18
    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
  • adnadn Posts: 17
    edited 2005-08-11 13:49
    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 BakerPaul Baker Posts: 6,351
    edited 2005-08-11 16:54
    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 AllenTracy Allen Posts: 6,656
    edited 2005-08-11 16:57
    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
  • adnadn Posts: 17
    edited 2005-08-14 18:57
    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 AllenTracy Allen Posts: 6,656
    edited 2005-08-16 06:45
    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
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-08-16 16:20
    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. 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
  • OrionOrion Posts: 236
    edited 2005-08-17 02:13
    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!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-08-17 04:38
    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 [noparse][[/noparse]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 AllenTracy Allen Posts: 6,656
    edited 2005-08-17 07:17
    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
  • OrionOrion Posts: 236
    edited 2005-08-19 01:09
    Thank you I'll check it out.
  • metron9metron9 Posts: 1,100
    edited 2005-08-19 18:54
    How about a stepping motor? Take one of those old IBM floppy drives apart, You can count the pulses for exact rotation
  • John CoutureJohn Couture Posts: 370
    edited 2005-08-20 02:18
    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
  • adnadn Posts: 17
    edited 2005-08-25 10:20
    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
    906 x 319 - 14K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-08-25 16:42
    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
  • adnadn Posts: 17
    edited 2005-08-25 22:00
    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 BakerPaul Baker Posts: 6,351
    edited 2005-08-26 15:52
    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
  • adnadn Posts: 17
    edited 2005-08-26 22:55
    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
  • OrionOrion Posts: 236
    edited 2005-08-27 03:04
    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 AllenTracy Allen Posts: 6,656
    edited 2005-08-28 19:32
    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.

    attachment.php?attachmentid=38682

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    441 x 324 - 7K
  • OrionOrion Posts: 236
    edited 2005-08-29 01:08
    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.
Sign In or Register to comment.