Shop OBEX P1 Docs P2 Docs Learn Events
Davis Anemometer — Parallax Forums

Davis Anemometer

Sal AmmoniacSal Ammoniac Posts: 213
edited 2011-12-27 14:26 in Accessories
Anyone have any experience with the output of the Davis anemometer?

Are the pulses clean or do they have bounce?

Comments

  • Ken GraceyKen Gracey Posts: 7,392
    edited 2011-01-28 15:35
    Hey Sal,

    I have some experience with a MetOne anenometer from about 15 years ago. This was probably my first major BS2-IC project and I had some really solid assistance from Chip to get it running. We used the PULSIN command after trying a few alternatives with COUNT and it worked nicely. The challenge was converting the data to sensible units in MPH, so we hooked up an LCD and drove down the street at various speeds in his '93 Corvette. I hung out the window while Chip yelled out the speed and I recorded the units for each speed from the Scott Edwards 2x16 Serial LCD. Got back to the office and (doh) discovered a nice linear relationship.

    Tracy Allen has all kinds of experience with his environmental dataloggers. I bet he'll show up on this thread and tell you what you need to know about the output and debouncing issues from an anenometer.

    I didn't answer your question but shared an experience.

    Ken Gracey
  • ercoerco Posts: 20,256
    edited 2011-01-28 18:04
  • max72max72 Posts: 1,155
    edited 2011-01-29 07:48
    A little bit off topic but it could intest you:
    I used in the past a solid state wind sensor from http://www.mierijmeteo.nl
    The price tag is very different, but you have not moving parts, and you get serial data in a string format similar to GPS.
    Upward in the price ladder you have ultrasonic sensors..
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2011-01-29 11:06
    Hi Sal,

    I've used Davis equipment for years, and their factory is just a few miles from my office. You are in the SF Bay area too, aren't you? The anemometer does use a reed switch, and it does bounce but never more than a millisecond. An RCcircuit and/or software debounce can take care of it. It is a nice anemometer with economies of scale and a lot of history behind it. The potentiometer will be the first thing to wear out, non-replaceable unfortunately. It would be a nice hack to make it all solid state.
  • MoskogMoskog Posts: 554
    edited 2011-01-30 01:09
    Ken Gracey said:
    ...The challenge was converting the data to sensible units in MPH, so we hooked up an LCD and drove down the street at various speeds in his '93 Corvette. I hung out the window while Chip yelled out the speed and I recorded the units for each speed from the Scott Edwards 2x16 Serial LCD. Got back to the office and (doh) discovered a nice linear relationship...

    Almost similar to my own test driving a dark night some years ago.

    weatherstation8.jpg


    This home made anemometer is made of dippers and an used rotary encoder from a steel plate cutting machine. (1000 pulses/revolution) Overkill but I need just 20ms to get a nice byte out of it. And I got it for free.
    390 x 292 - 60K
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2011-02-01 16:53
    Thanks for all the replies.

    I'll give the Davis unit a try as it is relatively inexpensive and is made by a local (to me) company. I'll go with an RC debounce circuit as I want to count pulses directly with one of the Propeller's counter modules.

    Thanks also for the amusing anecdotes regarding calibration. My son's high school has a wind tunnel, so I'll take it there for testing and calibration.
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2011-12-23 13:48
    I finally dug my Davis anemometer out of the closet and mounted it to my bench and connected its output to one of my Propeller development boards.

    I'm seeing some funny results trying to count switch closures in Spin code. I'd prefer to use one of the cog's counter modules in NEGEDGE detector (%01110) mode, but I'm getting high readings versus using waitpeq to count the switch closures directly in Spin. My code looks like this;
    CON
    
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ =  5_000_000
    
    OBJ
    
       LCD : "HD44780"
       Num : "Simple_Numbers"
    
    
    PUB Main | upcounter
    
      LCD.LCDInit(0)
      LCD.LCDCls
    
    
      dira[25]~
      phsa := 0
      frqa := 1
      ctra := %01110_000 << 23   + 25     
    
      waitpeq(|<25, |<25,0)                                 ' wait for P25 to be high
      upcounter := 0
    
      repeat
        waitpeq(0, |<25,0)                                  ' wait for P25 to be low
        waitcnt(clkfreq/1000 + cnt)                         ' wait 1 ms for switch bounce
        waitpeq(|<25, |<25,0)                               ' wait for P25 to be high
        upcounter++    
        LCD.LCDGotoXY(1, 1)
        LCD.LCDPuts(Num.dec(phsa))
        LCD.LCDGotoXY(1,2)
        LCD.LCDPuts(Num.dec(upcounter))  
        
    

    The circuit is simple. I'm pulling the switch closure line up to 3.3v through a 10K resistor and connecting it to the Prop via a 220 ohm resistor, I've also tried a simple RC circuit using both a 0.1uF and a 220pF cap.

    When I spin the anemometer with a little mechanism that generates a fairly repeatable 18 rotations, I get the following results:

    No cap: "counter" counts: 53 "waitpeq" counts: 18

    0.1uF cap: "counter:" counts: 627 "waitpeq" counts: 18

    220pF cap: "counter" counts: 36 "waitpeq" counts: 18


    I've attached scope traces of the switch closure with and without the 0.1uF cap. The trace using the 220pF cap looks very similar to the one without the cap.

    An-nocap.jpg
    An-.1uFcap.jpg


    I'd much prefer to use the counter module rather than counting closures directly in Spin. Anyone have any ideas how I can clean up the signal so it doesn't glitch the counter?

    As an aside, I wonder why Davis didn't spend a few extra pennies and use a Hall effect sensor rather than an antique reed switch...
    1024 x 460 - 94K
    1024 x 415 - 84K
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2011-12-24 00:43
    At some point in time, Davis started adding a 100Ω resistor in series with the reed switch, probably to forestall welding due to current surges from capacitors and errant power supplies. That nastiness you are seeing with 0.1µF is consistent with a time constant of 0.1µF with 100Ω, and it appears to be picking up a lot of digital switching noise too. Maybe a capacitor in the 0.001 to 0.01 µF would hit a sweet spot. The result with 220pF was already an improvement. If the layout is loose, tighten it up so that the parts are close to the prop pins, no loops to pick up noise. It is tough with the cog counters, because of the 12.5 ns sampling interval. The surest solution, if you want to use the cog counter, would be a Schmitt trigger input circuit to condition the signal before it reaches the pin, or just go ahead with software debouncing.


    I don't know why they don't use a Hall effect sensor. It requires power, but they already have a power there for the vane. I probably has something to do with long tradition and the simplicity of it. Why tinker.
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2011-12-24 19:28
    Thanks, Tracy.

    I'll probably implement a hardware solution to the bouncy reed switch in the anemometer with a MC14490 or equivalent. This is a one-off hobby project, so the $5 cost of the chip isn't an issue, and I'm sure the Davis tipping bucket rain gauge, which I haven't looked at yet, has the same issue with contact bounce.

    You're right about the digital noise. I've got everything on a solderless breadboard right now, and that, along with the 40 feet of cable attached to the anemometer, are probably picking up lots of noise from all the "projects" running on various development boards on my bench. I'll clean this up in the eventual PCB version of the project.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-25 11:04
    A 555 timer wired as a monostable or a schmitt trigger is a good way to clean up this signal.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2011-12-27 14:26
    Sal, for the Stamp (which is terrible with counting things like anemometers and rain gages) I use a PIC12F629 chip with a debouncer program , similar to the logic of the MC14490 or MAX6817. If your Prop program has a spare cog, or a cog running a tight loop, it could do the debouncing in firmware in the background.
Sign In or Register to comment.