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



  • 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!



  • 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



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