Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Problem with Wind Speed sensor

Problem with Wind Speed sensor

Scheduled Pinned Locked Moved Troubleshooting
53 Posts 6 Posters 14.7k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rnollenR rnollen

    @AWI Thanks! The sketch works. But, I am not quite sure if the readings in m/s are correct. As a test, I have used a normal table fan, then I got 3.3 m/s on full speed..
    Then I used a hairdryer, that on full speed.. It spins then very very fast, but it is still only 11 m/s. This is classified as normal, somewhat powerfull wind? Looks to me it's pretty low? Or could this correct for this case? :)'

    Edit-> Maybe it is correct :) Saw somewhere on internet a test with somewhat smaller hairdryer, which gave 9.5 m/s :)
    Unfortunately I don't have any experience with windmeters :) Don't know how hard it should spin and how to test the output :)

    TheoLT Offline
    TheoLT Offline
    TheoL
    Contest Winner
    wrote on last edited by
    #44

    @rnollen My theory for calculating they outcome of your sensor is the following. All you need to know is the distance it takes from the pulse going from LOW (leaving the hall sensor) to HIGH triggering the hold sensor. If that's for instance 10 cm. Than the distance traveled by one full turn is 10cm. Let's say the wind will cause your windsensor to travel exactly once every second, the speed would by 600 cm's in 60 seconds. That's 1 meter per minute. So the wind speed would be 60 meter per hour which is known is 0 Beaufort.

    If however the wind causes the sensor to turn exactly 3 times per second, that would be 30cm which is 0.3 m/s. Then the wind speed would be 1 Beaufort. Since 12 Beaufort starts at 32.6 m/s it would mean that your wind sensor would turn 3260 cm per second divided by 10 is 326 turns per second. which is roughly once every 3 millisecond.

    But I'm hoping that someone can verify this theory ;-)

    AWIA 1 Reply Last reply
    0
    • TheoLT TheoL

      @rnollen My theory for calculating they outcome of your sensor is the following. All you need to know is the distance it takes from the pulse going from LOW (leaving the hall sensor) to HIGH triggering the hold sensor. If that's for instance 10 cm. Than the distance traveled by one full turn is 10cm. Let's say the wind will cause your windsensor to travel exactly once every second, the speed would by 600 cm's in 60 seconds. That's 1 meter per minute. So the wind speed would be 60 meter per hour which is known is 0 Beaufort.

      If however the wind causes the sensor to turn exactly 3 times per second, that would be 30cm which is 0.3 m/s. Then the wind speed would be 1 Beaufort. Since 12 Beaufort starts at 32.6 m/s it would mean that your wind sensor would turn 3260 cm per second divided by 10 is 326 turns per second. which is roughly once every 3 millisecond.

      But I'm hoping that someone can verify this theory ;-)

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #45

      @TheoL In essence you are right but you need to get some more variables in the equation. It is a rotating sensor with (probably non linear) losses. Best solution in this case is to calibrate it with a known value. @mollen bought himself a quality sensor which is supposed to be calibrated. Type 12CM, according to the supplier it is 12 pulses for 1m/s per second. But the manual says that this model is 10 pulses for 1m/s." which should make the calculation pretty easy: either divide the pulses per second by 12 (or 10). Line 68: float windSpeed = frequency / meterPerPulse ; // calculate m/s for pulses per second and the calibration value (to be adjusted) line 39: const int meterPerPulse = 10 ; // number pulses/s for each m/s

      I am still working on a whole different approach for measuring wind parameters with the help of an acceleration sensor. I looks very promising.

      TheoLT 1 Reply Last reply
      0
      • AWIA AWI

        @TheoL In essence you are right but you need to get some more variables in the equation. It is a rotating sensor with (probably non linear) losses. Best solution in this case is to calibrate it with a known value. @mollen bought himself a quality sensor which is supposed to be calibrated. Type 12CM, according to the supplier it is 12 pulses for 1m/s per second. But the manual says that this model is 10 pulses for 1m/s." which should make the calculation pretty easy: either divide the pulses per second by 12 (or 10). Line 68: float windSpeed = frequency / meterPerPulse ; // calculate m/s for pulses per second and the calibration value (to be adjusted) line 39: const int meterPerPulse = 10 ; // number pulses/s for each m/s

        I am still working on a whole different approach for measuring wind parameters with the help of an acceleration sensor. I looks very promising.

        TheoLT Offline
        TheoLT Offline
        TheoL
        Contest Winner
        wrote on last edited by
        #46

        @AWI Thanx for the explanation. I just have to build the sensor with as much precision as I can. All will of course depend on things like the quality of the ball-bearrings that I use e.t.c. And of course in the quality of the electronic parts. And I have to calibrate it despite of my theory. What I didn't take into account is the minimum force that is needed for the sensor to start rotating.

        Your approach sounds very interesting. I've recently found a sensors that measures the angle movement of a magnet. My theory is, that by probing each angle movement within a couple of ms would end up in a very precise wind sensor. Problem is that I wasn't able to find a breakout board. I can only buy the sensor as an SMD IC. And soldering SMD is just not a skill I have found time to master yet.

        Also this sensor would make a perfect wind direction sensor, which is far more precise than using 8 reed relays or hall sensor that most of these wind direction sensor do. The IC cost around 7 dollar if I remember correctly.

        AWIA 1 Reply Last reply
        0
        • TheoLT TheoL

          @AWI Thanx for the explanation. I just have to build the sensor with as much precision as I can. All will of course depend on things like the quality of the ball-bearrings that I use e.t.c. And of course in the quality of the electronic parts. And I have to calibrate it despite of my theory. What I didn't take into account is the minimum force that is needed for the sensor to start rotating.

          Your approach sounds very interesting. I've recently found a sensors that measures the angle movement of a magnet. My theory is, that by probing each angle movement within a couple of ms would end up in a very precise wind sensor. Problem is that I wasn't able to find a breakout board. I can only buy the sensor as an SMD IC. And soldering SMD is just not a skill I have found time to master yet.

          Also this sensor would make a perfect wind direction sensor, which is far more precise than using 8 reed relays or hall sensor that most of these wind direction sensor do. The IC cost around 7 dollar if I remember correctly.

          AWIA Offline
          AWIA Offline
          AWI
          Hero Member
          wrote on last edited by
          #47

          @TheoL I use an acceleration sensor which makes is easy to calculate angle and direction with respect to gravity. Problem is more in the mechanics to make it reliable and damped.
          I will publish in a few weeks and discuss in a separate thread

          TheoLT 1 Reply Last reply
          0
          • AWIA AWI

            @TheoL I use an acceleration sensor which makes is easy to calculate angle and direction with respect to gravity. Problem is more in the mechanics to make it reliable and damped.
            I will publish in a few weeks and discuss in a separate thread

            TheoLT Offline
            TheoLT Offline
            TheoL
            Contest Winner
            wrote on last edited by
            #48

            @AWI Looking forward to that thread. Would love to team up with you on this on. This is the sensor I was talking about. Just posting it hear so I'll remember it

            http://www.digikey.nl/en/product-highlight/a/ams/as5262-magnetic-position-sensor?WT.srch=1&mkwid=seJnJAtEb&pcrid=86172304838&pkw=_cat%3Adigikey.nl&pmt=b&pdv=c

            YveauxY 1 Reply Last reply
            0
            • TheoLT TheoL

              @AWI Looking forward to that thread. Would love to team up with you on this on. This is the sensor I was talking about. Just posting it hear so I'll remember it

              http://www.digikey.nl/en/product-highlight/a/ams/as5262-magnetic-position-sensor?WT.srch=1&mkwid=seJnJAtEb&pcrid=86172304838&pkw=_cat%3Adigikey.nl&pmt=b&pdv=c

              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #49

              @TheoL A compass sensor will probably work just as fine, is a lot cheaper and comes as a module!
              Just use a weak magnet (no neodimium :skull: )

              http://yveaux.blogspot.nl

              TheoLT 1 Reply Last reply
              0
              • YveauxY Yveaux

                @TheoL A compass sensor will probably work just as fine, is a lot cheaper and comes as a module!
                Just use a weak magnet (no neodimium :skull: )

                TheoLT Offline
                TheoLT Offline
                TheoL
                Contest Winner
                wrote on last edited by
                #50

                @Yveaux True. But I think it's much easier to epoxy a magnet under an rotating axis. Let's see what we can come up with saturday.??

                YveauxY 1 Reply Last reply
                0
                • TheoLT TheoL

                  @Yveaux True. But I think it's much easier to epoxy a magnet under an rotating axis. Let's see what we can come up with saturday.??

                  YveauxY Offline
                  YveauxY Offline
                  Yveaux
                  Mod
                  wrote on last edited by
                  #51

                  @TheoL that's exactly what I mean! The sensor won't know if it's the earth spinning around our a magnet ;all the same to it.
                  Let's discuss /prototype it tomorrow!

                  http://yveaux.blogspot.nl

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    Wuffi0815
                    wrote on last edited by Wuffi0815
                    #52

                    Hello I bought a TX23 and wanted to integrate it into FHEM.
                    Could anyone look over the scetch if it is correct?

                    /**
                    # Arduino-LaCrosse-TX23-Library
                    
                    LaCrosse TX23 is a wind speed and direction sensor. It uses 3 wires for communication and power:
                    
                    Pin1 - Brown(Black) - DATA
                    Pin2 - Red - Vcc
                    Pin3 - Green - N/C
                    Pin4 - Yellow - GND
                    
                    DATA pin is to be connected directly to one of Arduino ports.
                    */
                    
                    // Enable debug prints to serial monitor
                    #define MY_DEBUG
                    
                    // Enable and select radio type attached
                    #define MY_RADIO_NRF24
                    //#define MY_RADIO_RFM69
                    
                    #include <MySensors.h>
                    #include <SPI.h>
                    #include <LaCrosse_TX23.h>
                    
                    #define CHILD_ID_WIND 1
                    
                    //DATA wire connected to arduino port 4
                    LaCrosse_TX23 anemometer = LaCrosse_TX23(4);
                    
                    // standard messages
                    MyMessage msgWSpeed(CHILD_ID_WIND, V_WIND);
                    MyMessage msgWDirection(CHILD_ID_WIND, V_DIRECTION);
                    
                    
                    void setup(){
                    }
                    
                    void presentation()
                    {
                        // Send the sketch version information to the gateway and Controller
                      sendSketchInfo("Wind Sensor", "1.0");
                    
                      // Register all sensors to gw (they will be created as child devices)
                      present(CHILD_ID_WIND, S_WIND);
                    }
                    
                    void loop()
                    {
                      
                      //String dirTable[]= {"N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"}; 
                      String dirTable[]= {"0","22.5","45","67.5","90","112.5","135","157.5","180","202.5","225","247.5","270","292.5","315","337.5"};
                      float speed;
                      float a = 22.5;
                      int direction;
                    
                      if(anemometer.read(speed, direction))
                      {
                        send(msgWDirection.set(direction*a ,1));
                        send(msgWSpeed.set(speed, 1));
                        
                        Serial.println("Speed = " + String(speed,1) + " m/s");
                        Serial.println("Dir = " + dirTable[direction] + " Grad");  
                      }
                      else
                      {
                        Serial.println("Read error");
                      }
                    
                      
                      //delay between succesive read requests must be at least 2sec, otherwise wind speed will read 0.
                      delay(2000);
                    }
                    
                    

                    Thank you

                    1 Reply Last reply
                    0
                    • xydixX Offline
                      xydixX Offline
                      xydix
                      wrote on last edited by
                      #53

                      Anyone got a working sketch for a pulse anenometer?
                      I printed this. https://www.thingiverse.com/thing:2523343
                      I used it with ESPHome as testing it and I got OK values.
                      Now i would like to use it with mysensors.
                      I tried @AWI s sketch but I get stange readings.
                      Sometimes I get a very high value when is turns slow.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      14

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular