hugokernel / esphome-weather-station

ESPHome version of Elektor weather station v2
MIT License
280 stars 19 forks source link

Wind speed GPIO38 doesn't have INPUT_PULLUP #4

Closed sermayoral closed 2 years ago

sermayoral commented 2 years ago

Hi friend. I have seen your project. It's amazing and thank you for sharing it. There is a thing that is wrong:

  - platform: pulse_counter
    pin:
      number: GPIO38
      mode: INPUT_PULLUP

According to the esp32 specifications:

GPIOs 34 to 39 are GPIs – input only pins. These pins don’t have internal pull-up or pull-down resistors. They can’t be used as outputs, so use these pins only as inputs:

More recent ESPHome versions tells you as well:

imagen

I hope it can help you :-)

I would like to ask you a doubt. I've got a WH-SP-WS01 anemometer. This one: https://a.aliexpress.com/_uAcawc

Do you think your calibration will be valid to me? Or i should calibrate it? Because it is a tedious process and I am not an expert on this subject.

Thank you very much!!

hugokernel commented 2 years ago

Hi,

Sorry for the lag, I don't have much time right now, about GPIO, I have to take a look.

Do you think your calibration will be valid to me? Or i should calibrate it? Because it is a tedious process and I am not an expert on this subject.

Yes, I think it's the same.

sermayoral commented 2 years ago

Thank you very much ☺️

tom1422 commented 2 years ago

I have this issue as well. Not sure if it makes any difference though. I decided to change the Rain Meter and Wind Speed pins to GPIO 33 and GPIO 32 (on ADC1 because ADC2 apparently interferes with wifi). This allows me to use input pull-up again as apparently pin 34 to 39 cannot be set as output, which is counter intuitive considering they are labelled as "GPIO". Unfortunately, it means you have to ditch the Lora module (which i don't think they finished integrating) but it also makes it easier to connect it as the socket is already soldered. (D1 and D2 for the RFM95) Just tried it and it made no difference (to using just using IO35 and no pullup). I will check with scope to double check. Just checked with a scope and its reading the exact same values. Not sure if there's much point in changing the pins then. Although I have been receiving very low wind-speed values since putting it up. I might buy a professional meter an put it beside the weather station to calibrate it to get better constants.

hugokernel commented 2 years ago

Fixed and README updated.