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

    PbHub + 2-Relay Units - only 1 relay channel working?

    Scheduled Pinned Locked Moved Units
    3 Posts 2 Posters 2.6k 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.
    • E Offline
      emsea22
      last edited by

      Hi - I have a PbHub with a 2-relay unit connected to (if it matters) CH5. The 2-relay unit works fine when connected directly to the Core 2 device/Port C, but when connected to the PbHub, only 1 or the two relays will switch.

      I'm using micropython and:

      pbhub_0.digitalWrite(5, 0, 0)
      pbhub_0.digitalWrite(5, 0, 1)

      -- works (off/on)

      pbhub_0.digitalWrite(5, 1, 0)
      pbhub_0.digitalWrite(5, 1, 1)

      -- doesn't do anything

      the 2-relay unit (confusingly) has labeled channels of 1 and 2 on the device, A and B on the schematic - and takes 1 and 2 as relay identifiers if you're controlling it directly (via Port A) the UI flow code/micropython is:

      relay2_0.set_value(1, 0)
      relay2_0.set_value(1,1)
      relay2_0.set_value(2,0)
      relay2_0.set_value(2,1)

      I'm considering addressing the PbHub directly or trying arduino code, but just wondering if there's some obvious reason I'm missing.

      -Thanks!

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

        Hello @emsea22

        which version PbHub are you using? v1.0 U041 or v1.1 U041-B?

        I think only version v1.1 can both pins have set to outputs on all channels. The original PbHub has its IN pins for CH4 and CH5 connected to ADC inputs of the Mega328 which I guess means they can only be inputs.

        Have you tried a different channel, e.g. CH0?

        Thanks
        Felix

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

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          emsea22 @felmue
          last edited by

          @felmue SOLVED - thanks for that - CH2 works as expected!

          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