Tech Note 126 - ESP32 miniature weather station with wind direction add-on

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.พ. 2025

ความคิดเห็น • 79

  • @scottpaddock6685
    @scottpaddock6685 2 ปีที่แล้ว

    Thanks for the project how to! One thing I saw amiss was/is the anemometer pins in the docs, versus in the code. The drawings show the anemometer connected to pin 15 and ground, but the code has it default pin 4. I moved the pin and presto. Cheers!

    • @G6EJD
      @G6EJD  2 ปีที่แล้ว +1

      Thanks Scott, I’ll correct that

  • @jamiegoegebeur2239
    @jamiegoegebeur2239 5 ปีที่แล้ว +1

    Love the explanation will try this project next week! I'll keep you updated

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Most of the cost comes from the sensors, if you use high quality types, you can make a system that rivals high-end units like the Davis. Compared with my Davis 6152 unit, the results are identical, but at a fraction of the cost and of course expandable/customisable.

  • @sanjayramasamy9102
    @sanjayramasamy9102 5 ปีที่แล้ว

    Tech Note - you are the best

  • @solosailor222
    @solosailor222 4 ปีที่แล้ว

    Efficiently succinct, Thank You. SUBSCRIBED

  • @sanjayramasamy9102
    @sanjayramasamy9102 5 ปีที่แล้ว

    Most of your video is really helpful.. thank you very much for the effort.

  • @nektarioskourakis8331
    @nektarioskourakis8331 4 ปีที่แล้ว

    SUPER JOB!!! GREETINGS FROM GREECE!

  • @eduardo9626
    @eduardo9626 5 ปีที่แล้ว

    Congratulations, high quality video! Thank you for sharing with us. to be perfect, include power by solar panel and GPRS sending, as it will be closer to the real need. and also a rain gauge.

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Adding solar is not trivial, it would need e.g. a tp4056 charge controller board, and the ESP8266 would need about 1700mAhr per day of battery capacity plus solar charge replenishment so a 6v panel of about 3-5 watts might be enough to keep it running throughout a typical year, well for UK anyway it’s not unusual to have many overcast days, so a challenge, but possible. I would probably add a webserver to display all the values and use the on-board WiFi to reduce circuit and design overheads. Yes adding a rain gauge is quite easy to do, I’ve ordered one, it would need another GPIO based interrupt to count bucket tips.

    • @eduardo9626
      @eduardo9626 5 ปีที่แล้ว

      @@G6EJD I built a station with a rain gauge, ESP32, RTCDS3231, SDCARD DHT22 (I will switch to the BME280). Powered by 10W solar panel, a 12V 5Amp stationary battery, is super sized, but as you said need to ensure for cloudy days. The ESP32 is always in Deepsleep mode, but it wakes up to add the rain gauge by interruption, and also wakes up every 10 minutes to take the average temperature and humidity, completing the 1 hour cycle sends the data to the UBIDOTS. When the GPRS signal is missing, the data is saved to an SD card, and accumulates data on the SD card until it has GPRS signal again. It's been a lot of work, and has to be perfected enough, your video inspired me to try to add the wind sensors.
      Thanks again for this video.
      I will always watch out for new videos of you.

  • @kosa2004
    @kosa2004 5 ปีที่แล้ว

    I almost have the parts needed for this cool gadget, will try it tomorow. Thanks for sharing :) 🍻🍻

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว +1

      László Kósa, you can calibrate the wind speed using a car by holding the anemometer out of a window away from the body and adjust the calibration constant accordingly to match the car’s speed. Enjoy.

    • @kosa2004
      @kosa2004 5 ปีที่แล้ว

      I will :)

  • @ianianian436
    @ianianian436 4 ปีที่แล้ว

    Terrific project thank you

  • @Liam-ey2gs
    @Liam-ey2gs 3 ปีที่แล้ว

    Great video, thank you.

  • @doug6503
    @doug6503 4 หลายเดือนก่อน

    Hi Sir,
    I have done as was shown and uploaded the code to my esp32 wroom module. Not trying to use the esp8266. First issue resolved was in the timing part around times setup. the coding has changed slightly and I am able to jump that fence. I am using an Ultrasonic Anemomter for signal input on giop pin 15. This unit outputs analog 0-5 volts on two channel - speed and direction. I am not getting anything out, so put some serial outputs to read the wind speed and millis minus last event time. Millis is counting up, but last event time never leaves 0. I am thinking the ISR is having issues. Is there something else in the code I might need? I can upload my code if you wish. I am at this point only at the speed part and not Direction.

  • @johnbyrne1567
    @johnbyrne1567 5 ปีที่แล้ว +4

    Wold it be possible to have the part numbers for the wind speed sensor and the direction sensor
    Thanks john

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว +2

      Hi John,Wind speed: www.banggood.com/Misol-WH-SP-WS01-1-PCS-Spare-Part-For-Weather-Station-To-Test-The-Wind-Speed-p-1440188.html?rmmds=search&cur_warehouse=CNWind direction: www.aliexpress.com/item/0-5V-Analog-Wind-direction-sensor-4-20MA-ABS-material-Wind-Direction-Transmitter-Eight-Directional-Wind/32884187148.html?spm=2114.search0104.3.50.57b54feb95YjCh&ws_ab_test=searchweb0_0,searchweb201602_8_10065_10130_10068_10547_319_317_10548_10696_10192_10190_453_10084_454_10083_10618_10307_10820_10301_10821_10303_537_536_10059_10884_10887_321_322_10103,searchweb201603_52,ppcSwitch_0&algo_expid=cfb89b51-cb23-4af6-bb56-09f81d8c76f2-7&algo_pvid=cfb89b51-cb23-4af6-bb56-09f81d8c76f2&transAbTest=ae803_5Both AliExpress and Banggood stock them, search for 'wind direction' or 'wind speed'

    • @AndreasFuchs
      @AndreasFuchs 5 ปีที่แล้ว

      @@G6EJD can you also provide a link to the alternate anemometer? looks a little bit more rigid than the misol and easier to mount. thanks for all your casts

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      The links are in this comment chain, I just looked there is the music and high quality type. Either that or search on Banggood or AliExpress for ‘anemometer pulse’ Adafruit sell them but at much greater cost.

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Andreas Fuchs, btw the Peet Bros sensor head is by far the best and can be purchased as a spare. It uses Hall effect switches and direction is determined from time between pulses as a ratio, so no moving parts for direction, so two pulses, either one gives wind speed, but wait for one to go high then wait for the second to go high, record time taken e.g. 200mS, then measure the time of one revolution say 400mS, then angle = 200/400x360=180°

    • @AndreasFuchs
      @AndreasFuchs 5 ปีที่แล้ว

      @@G6EJD thanks allot will have a look at them

  • @taavetmalkov3295
    @taavetmalkov3295 2 ปีที่แล้ว

    hey. Great info! How to make this system log the data on a sd card?

  • @thenatedog
    @thenatedog 3 ปีที่แล้ว

    Having a problem with this project. I followed the diagram for connecting things to the pins but when i power it on after flashing the screen is just kind filled with white snow. Was there some changes i needed to make to the text before uploading? For instance i see a line that says wind meter on pin 4 but in your diagram you have pin 15.

    • @G6EJD
      @G6EJD  3 ปีที่แล้ว

      Ok, what development board are you using? Have you ever had your display running using say a test programme?

    • @G6EJD
      @G6EJD  3 ปีที่แล้ว

      Also what type of wind sensor? I need all the information to help out, too many unknowns

    • @thenatedog
      @thenatedog 3 ปีที่แล้ว

      also i have tried 2 of those screens and they both do the same so i dont think my screen is broken

    • @thenatedog
      @thenatedog 3 ปีที่แล้ว

      I have tried several times to post the links to the items and it won't let me send it to you.

    • @G6EJD
      @G6EJD  3 ปีที่แล้ว +1

      @@thenatedog email the details via contact at g6ejd.dynu.com

  • @jangrabler
    @jangrabler 2 ปีที่แล้ว

    Hi David, Great Video, is this possible Top Show the Windspeed in BF?

    • @G6EJD
      @G6EJD  2 ปีที่แล้ว

      Yes, just multiply the windspeed by a value that converts it to BF, usually 0.658

  • @Learnduino
    @Learnduino 5 ปีที่แล้ว

    Nice. I like this project

  • @alnaumi
    @alnaumi 5 ปีที่แล้ว

    Have you considered not maintening connected the wind vane to power? Using a transistor to switch on and off when you want to take the measurement. In my case I have to power the wind vane and anemometer to 12 V. I don´t know if your model it is different. Thanks for you great channel!!!!

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว +1

      The sensor for wind speed is passive and has two Reed switches operated by magnets, but yes with the two high end units both of which require 5v (there are 12 and 24v variants available too) they require power which could be switched by the ESP to reduce power demands, but with an OLED display the power usage is mainly with the display and so sensor power consumption is secondary. The wind direction could easily be read in the interrupt routine for wind speed thereby simplifying the reading process and making the values available when there is wind blowing, if that makes sense, no wind no need to take a measurement of speed or direction in the background. Lots of scope for enhancement for sure.

  • @Counselor77
    @Counselor77 10 หลายเดือนก่อน

    I ordered the D32 board and the BME 280 sensors, However, my question is The D32 board is not listed in the Arduino board manager how do I upload the code? Great project.

    • @G6EJD
      @G6EJD  10 หลายเดือนก่อน +1

      It sounds like you don’t have the latest Arduino IDE and it will load the ESP32 extensions as I have been using the IDE today and it has two Lolin boards predefined the D32 and D32 Pro. You can also use the ESP32 Dev board as the pin outs are nearly identical, but no need if the ESP32 extension is loaded as that lists the correct board.

    • @Counselor77
      @Counselor77 10 หลายเดือนก่อน

      Sounds great, I will check it out Thank You.@@G6EJD

  • @EagleEyeShooting
    @EagleEyeShooting 4 ปีที่แล้ว

    Outstanding write up and explanation. Would this be possible to work using ESP32 with LORA?

  • @davidhouseago416
    @davidhouseago416 4 ปีที่แล้ว

    Looking forward to building this project but I get a lot of compiling error messages."expected initializer before 'MeasureWindSpeed_ISR'" I am using the latest IDE version 1.8.13

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      I've just downloaded and compiled the code, it all works as expected. How did you get the code from GitHub, copy and paste does not work, well unless you select RAW then copy. Your browser has most likely embedded hidden characters.

  • @Pascy14
    @Pascy14 4 ปีที่แล้ว

    Hi, what would the code look like if I wanted to transmit temperature, humidity, pressure and wind speed to thingspeak...

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      I have provided an email like this on GitHub

  • @695renzo
    @695renzo 5 ปีที่แล้ว

    Hi, all well explained but compiling the sketch on line 49 I have this error "expected initializer before 'MeasureWindSpeed_ISR'" What i have to do. I compile a board as Adafruit Feather HUZZAH ESP8266

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      That's because this only works on ESP32 boards, not ESP8266. I have not had enough time to convert to ESP8266, I will get around to doing that when I can. Sorry.

  • @msingh9550
    @msingh9550 4 ปีที่แล้ว

    Is it possible to use a the bme280 sensor to control a relay hooked to humidifier
    Thx

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      Yes, I did the same using an sht31 and called it a humistat see my other TN in that, just replace the sht31 with a bme280

    • @msingh9550
      @msingh9550 4 ปีที่แล้ว

      @@G6EJD
      Thanks for the reply. Will look into it. Hope you are feeling much better after MF treatment.
      Best

  • @johncreecy1875
    @johncreecy1875 2 ปีที่แล้ว

    Very interesting - where can I see the code please?

    • @G6EJD
      @G6EJD  2 ปีที่แล้ว

      Check the video notes the link is there

    • @johncreecy1875
      @johncreecy1875 2 ปีที่แล้ว

      @@G6EJD Thanks,
      What is the difference between SH1106 and SSD1306 ?

    • @G6EJD
      @G6EJD  2 ปีที่แล้ว

      sh1106 = 1.3” ssd1306 = 0.96” both the same pixel resolution 128x64

  • @TheMisterTFM
    @TheMisterTFM 6 หลายเดือนก่อน

    Do you have a picture showing the Wind Direction showing on the display?

    • @G6EJD
      @G6EJD  6 หลายเดือนก่อน +1

      Unfortunately not, but I can tell you it’s a circle of diameter about 60 pixels and an arrow that denotes wind direction, it’s a basic display given the resolution of the screen.

    • @TheMisterTFM
      @TheMisterTFM 6 หลายเดือนก่อน

      Do you have a current recommended sensor to use for the wind direction vane with link?

    • @G6EJD
      @G6EJD  6 หลายเดือนก่อน

      @@TheMisterTFM there are a couple of approaches you can use, a traditional wind vane with some form of angle measuring interface, but these tend to be expensive and cumbersome, but work well. Tupi ally they use a 360° potentiometer so need a simple voltage measurement to convert to an angle and hence wind direction. Alternatively there are now many magnetometers which can be mounted to a wind vane and hence used to measure its direction. However as in all cases getting a connection to a rotating sensor is very difficult, obviously wireless is the answer but that needs a power source, so many wind vanes have the sr air static and make the vane I slice just the sr dir, and so there are many solutions, it depends on how much you you want to spend.

  • @emanuelsilvapt
    @emanuelsilvapt 3 ปีที่แล้ว

    Completely noob question. I. Using home assistant for 2 months now, with some sensores already. I know it is possible for sure but it's easy to do this without the lcd just publishing through mqtt? Sorry if the language isn't correct.
    Congrats for your great work btw

    • @G6EJD
      @G6EJD  3 ปีที่แล้ว +1

      yes you could do that, add the mqtt library, setup your mqtt server details then read the values and upload them to the mqtt server. It would not be a lot of additional code, maybe 10-lines at the most. include the library, define the server address, add the mqtt objects and then add a line to upload the data at regular intervals, not too fast though.

    • @emanuelsilvapt
      @emanuelsilvapt 3 ปีที่แล้ว

      @@G6EJD thank you very much, I'll try

  • @davidhouseago416
    @davidhouseago416 4 ปีที่แล้ว

    I downloaded the code as a zip file, unzipped to my sketch folder , opened it with Arduino IDE and clicked on the compile button and got "expected initializer before 'MeasureWindSpeed_ISR'"?? Is it possible to send you a screenshot?

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      Yes please do plus exact code version

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      Contact me by my webpage link in TH-cam

  • @s.husain6125
    @s.husain6125 5 ปีที่แล้ว

    Can we use DC motor as anemometer sir by measuring voltage generated by wind speed.... If yes how to achieve that

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      It’s possible because the generated DC voltage is proportional to speed and can be measured by the ADC via a voltage divider. But, the load placed on the wind vanes by the generator would make the result highly inaccurate. Shop around and you can get a wind sensor for a few $ or use one from a really low cost weather station.

    • @s.husain6125
      @s.husain6125 5 ปีที่แล้ว

      @@G6EJD thanx sir but i want to build my own anemometer sensor DIY

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Good luck with that, it’s not easy to do.

    • @s.husain6125
      @s.husain6125 5 ปีที่แล้ว

      @@G6EJD thank you sir

  • @s.husain6125
    @s.husain6125 5 ปีที่แล้ว

    How to use two 12c inputs (SCL and SDA ) simultaneously

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Do you mean 2 I2c devices or 2 I2c buses, it makes a difference. Two or more different I2c devices can be fitted to the i2c bus and their address keeps them separate. It is theoretically possible to run 2 or more I2c buses on the ESP32 as it enables pin multiplexing but there is no library support to do this yet.

  • @davidhouseago416
    @davidhouseago416 4 ปีที่แล้ว

    How do I send a screenshot via TH-cam? I know how to do it as an email attachment but I have never communicated this way.

    • @G6EJD
      @G6EJD  4 ปีที่แล้ว

      g6ejd.dynu.com then contact

  • @kflmiami4203
    @kflmiami4203 5 ปีที่แล้ว

    Great video , Can you make on with a raspberry pi zero w with a i2c adc1115 ?

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      kfl miami420, yes you can and I think the RPi forum has already done this on the RPi or at least something similar

  • @alaskawoodman
    @alaskawoodman 5 ปีที่แล้ว

    Nicely done. 73. AL4Z

  • @sarowell
    @sarowell 5 ปีที่แล้ว

    Thanks! Have you considered a rain gauge for this?

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Steve Rowell, to be honest no, but I don’t know why! I’ve just looked on AliExpress and although sold as spares for other stations they are freely available at about $10 and even the most expensive are so-called tipping bucket types which close a switch when the bucket is full when it tips making switch contact, the bucket empties and resets itself as part of a see-saw balance, so it would need another gpio pin and ideally interrupt to detect the rain rate, I’ll order one and add it, thanks for this.

    • @sarowell
      @sarowell 5 ปีที่แล้ว

      @@G6EJD My only problem with the tipping style gauges have been bugs gumming up the little see-saw mechanism. If you could somehow discourage them from moving in it would be a plus. While I haven't tried it I've considered using some sort of aromatic to discourage them.

    • @G6EJD
      @G6EJD  5 ปีที่แล้ว

      Steve, I have a Davis 6152 unit and it’s still a tipping buck type, they fit a small plastic bug at the entrance to the bucket (bottom of the funnel) and it works well, never had any visitors in there, although that said I still have to do a yearly maintenance clean due to dust and debris in there, mainly due to decomposing leaf or plant material. As long as the main body has a good seal apart from water egress points it should remain bug free. Ive not seen any other form of rain gauge.