🤖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

    Scheduled Pinned Locked Moved Modules
    earth sensor
    3 Posts 3 Posters 2.0k Views
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post