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

    Measure force on M5StickC through PbHub with Weigh Module?

    Units
    3
    4
    3.9k
    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.
    • P
      pso
      last edited by

      Hello!
      I am trying unsuccessfully to collect data through the pbhub unit (Link) with a weigh module (Link) connected to port 4 on a M5StickCPlus unit.

      I can verify that the weigh module works when connected directly to the M5StickC via the Grove Port, however when attaching this to any of the grove ports on the PbHub unit I am unable to read the correct value.

      Any help or tips would be helpful. TU!

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @pso

        I don't have those unit / module so my conclusion could be wrong.

        Looking at the Arduino code for the weigh module it seems that the clock timing / reading is quite time critical and if not perfect, the readings will be incorrect.

        When connected to the PbHub the built in chip (MEGA328) would have to mimic the timing, but from the description I understand it can only handle simple GPIO, DA and AD. I don't think it can generate the necessary clock timing in the uSec range required.

        Also the PbHub description mentions "Notice2: Not all M5 Units with PortB (Black) are able to be extended by PbHUB." Unfortunately it doesn't say which.

        When you look into UIFlow, add a PbHUB and then select the weigh unit you'll notice that there are a couple of pin pairs to choose from, but PbHUB is not an option.

        @M5Stack engineers: care to weigh in?

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

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

          Why are you connecting it to the hub?

          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
          • P
            pso
            last edited by

            For my particular project I have a 8 digital IO that I am trying to connect and therefore would like to use the PbHub connected to the M5StickC to expand the IO (as they advertise). I also have the weight module which works fine if I connect this directly to the M5StickC grove port.

            So now I must choose between using a PbHub or a Weigh module. I had thought it possible to add the weigh module to one of the ports on the PbHub however after experimenting with different pin combinations for initializing the HX711 scale i.e.

            HX711 scale(33, 32); // This works when the weigh unit is connected to the grove port on the M5StickC

            // Below are the other combinations I tried for passing the necessary pins to the HX711 through the Mega328 without any success.

            //HX711 scale(porthub.hub_d_read_value_B(4), porthub.hub_d_read_value_A(4));
            HX711 scale(porthub.hub_a_read_value(4), 32);
            //HX711 scale(porthub.hub_d_read_value_A(4), 32);
            //HX711 scale(porthub.hub_d_read_value_B(4), porthub.hub_d_read_value_A(4));
            //HX711 scale(porthub.hub_d_read_value_A(4), porthub.hub_d_read_value_B(4));

            Unfortunately, I think @felmue is right. The Mega328 isn't able to forward the clock required by the HX711 chip.

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