🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    earth sensor module - looking for an example for digital reading

    Modules
    earth sensor
    3
    3
    418
    Loading More Posts
    • 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.
    • H
      herb
      last edited by

      Hello, the earth sensor has an digital and an analog output pin. All examples are focused on analog reading.
      Can someone provide an example for digital reading?

      teastainT ajb2k3A 2 Replies Last reply Reply Quote 0
      • teastainT
        teastain @herb
        last edited by teastain

        @herb Here you go:
        https://github.com/m5stack/M5Stack/blob/master/examples/Unit/EARTH/EARTH.ino
        Both analog and digital.
        The earth sensor is rather...'simple'
        Screenshot 2024-06-22 at 4.32.26 PM.png
        from the docs page
        https://docs.m5stack.com/en/unit/earth
        you can see that the 'Ain' just reads the voltage across the sensor and the 'Din' is at least the threshold comparator, adjusted by the trim pot on back.

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3 @herb
          last edited by

          @herb What are you hoping to achieve as Digital rating only provides a 1 or 0.
          the only way to get values is through analogue and there is a project in the project zone of uiflow 2 found here https://uiflow2.m5stack.com/?pkey=3dd144a31f32480e9a7ed95461a9107a

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post