Menu

probleme with ky03 ou 04 sensors

gph.giraud
2023-02-02
2023-02-03
  • gph.giraud

    gph.giraud - 2023-02-02

    these very economical sensors operate at 5v and allow a high state to be obtained (v>3.5v) in the absence of a magnet. supply with 3.3v (compulsory with esp32) the high state cannot be obtained frankly (v<=1.2v) and causes instability on pin 32 of esp32. I propose to put a 12kohm pull-up resistor between the + and the sensor signal pin and all is back to normal
    I hope I explained well, I don't speak English very well. cordially phil

     
  • brownrb

    brownrb - 2023-02-03

    Hi Phil

    Thanks for the suggestion, which I am sure will help others too.

    I think from memory, the ky sensor was dropped in favor of a simple reed switch. I think the pdf mentions this also.

    As is, the KY generates a lot of fake interrupts and the windspeed value is this not accurate (very high speeds).

    The pin 32 is configured as an interrupt, looking for a high rising pulse (gnd to vcc-3,3), and the pin is clamped by the Zener diode D2 and R3 pull-down resistor (100k) to ground.

    I think the pdf suggested to use a 10K pull down and replace the KY024 sensor with a Reed Switch between 3V3 and Sig. That way, when the reed switch closes because of the magnet, the SIG line goes from Gnd to 3.3V and an interrupt was generated.

    But as you have found other things work also. Thanks for sharing your findings with me and others here, most appreciated.

    regards
    Robert

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.