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

    Earth sensor

    Modules
    earth sensor wrong readings
    3
    11
    1.1k
    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.
    • R
      rudi15
      last edited by

      Update: The readings do not change even when I completely unplug the sensor. The display still gives me similar values above 1000. Thus, it somehow seems as of the sensor might not be providing any data at all? It makes no difference whether or not the sensor is attached to the device. 20240522_171840.jpg

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

        @rudi15 Can you post your UIFlow code?

        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!

        R 1 Reply Last reply Reply Quote 0
        • R
          rudi15 @ajb2k3
          last edited by

          @ajb2k3 Sure, thanks. Here is the code:

          uiflow_block_1716445581066.png

          from m5stack import *
          from m5ui import *
          from uiflow import *
          import time
          import unit

          setScreenColor(0x222222)
          earth_0 = unit.get(unit.EARTH, unit.PORTB)

          MoistureAnalog = M5TextBox(14, 59, "Analog", lcd.FONT_Ubuntu, 0xFFFFFF, rotate=0)

          while True:
          MoistureAnalog.setText(str((str('Earth Sensor Analog: ') + str((earth_0.analogValue)))))
          wait_ms(500)
          wait_ms(2)

          robskiR 1 Reply Last reply Reply Quote 0
          • robskiR
            robski @rudi15
            last edited by

            @rudi15 said in Earth sensor:

            @ajb2k3 Sure, thanks. Here is the code:

            uiflow_block_1716445581066.png

            from m5stack import *
            from m5ui import *
            from uiflow import *
            import time
            import unit

            setScreenColor(0x222222)
            earth_0 = unit.get(unit.EARTH, unit.PORTB)

            MoistureAnalog = M5TextBox(14, 59, "Analog", lcd.FONT_Ubuntu, 0xFFFFFF, rotate=0)

            while True:
            MoistureAnalog.setText(str((str('Earth Sensor Analog: ') + str((earth_0.analogValue)))))
            wait_ms(500)
            wait_ms(2)

            Is your earth unit initialized? I cant see any reference to port B gpio
            earthunit0.jpg

            M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ

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

              @robski said in Earth sensor:

              @rudi15 said in Earth sensor:

              @ajb2k3 Sure, thanks. Here is the code:

              uiflow_block_1716445581066.png

              from m5stack import *
              from m5ui import *
              from uiflow import *
              import time
              import unit

              setScreenColor(0x222222)
              earth_0 = unit.get(unit.EARTH, unit.PORTB)

              MoistureAnalog = M5TextBox(14, 59, "Analog", lcd.FONT_Ubuntu, 0xFFFFFF, rotate=0)

              while True:
              MoistureAnalog.setText(str((str('Earth Sensor Analog: ') + str((earth_0.analogValue)))))
              wait_ms(500)
              wait_ms(2)

              Is your earth unit initialized? I cant see any reference to port B gpio
              earthunit0.jpg

              Judging by the colour blocks he’s using UIFlow 1 not UIFlow2

              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!

              R 1 Reply Last reply Reply Quote 0
              • R
                rudi15 @ajb2k3
                last edited by

                @ajb2k3 Yes, correct UIFlow 1. Should I switch to UIFlow 2? It's indeed just that piece of code so far as I found some videos that only do that and it seems to work. No initialization or so as I could not find any information or command on initialization etc. Also, I have no idea how I would calibrate the sensor and whether that would help. In case you have any hints on what to do? Thanks again!

                R 1 Reply Last reply Reply Quote 0
                • R
                  rudi15 @rudi15
                  last edited by

                  And just for the sake of completeness: The sensor is on Port B.

                  Screenshot 2024-05-24 at 07-39-24 M5Flow.png

                  robskiR 1 Reply Last reply Reply Quote 0
                  • robskiR
                    robski @rudi15
                    last edited by

                    @rudi15 said in Earth sensor:

                    And just for the sake of completeness: The sensor is on Port B.

                    Screenshot 2024-05-24 at 07-39-24 M5Flow.png

                    is example which you can load from Earth unit section works?

                    earth example.jpg

                    M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      rudi15 @robski
                      last edited by

                      @robski generally yes. I can see these examples in UI Flow and I did use them when building the code.

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

                        @rudi15 said in Earth sensor:

                        Hello,

                        I am a newbie to M5stack and want to use the Earth sensor to display moisture values. I followed the instructions as outlined in this video by exactly rebuilding the respective code: https://www.youtube.com/watch?v=rYi8XLe3X_c

                        The device now does show data, but it is constantly above 1000 even when just laying on my desk without any contact to water (up to the maximum of 1024 which, as far as I understand, indicates that the sensor detects water (fully wet)). When I put the senor into water, the readings do not change they stay above 1000.

                        Any idea what I did wrong?

                        20240522_153156.jpg 20240522_153502.jpg

                        It wont work as the RED Port is PortA I2C, you need to connect it to a Black Port B or use a PBhub to convert to I2C

                        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