RGB Encoder overly sensitive to cable length?

Hi, I’ve got a two each of the IO Expander, RGB Potentiometer and RGB Encoder Breakout Garden breakout boards, all using the Nuvoton MS51 controller.

With the Raspberry Pi at the back of my robot and the IO Expander handling all the front sensor inputs at the front of the robot, it’s connected into its slot using an Extender Kit and a bespoke 300mm four wire cable. Likewise, I’ve been successfully using a RGB Potentiometer on a 240mm length cable. These are admittedly long I2C cables but I’ve had no notable issues.

What’s odd is that when I swapped out the RGB Potentiometer for an RGB Encoder, rotating the dial produces no signal and the LED stays dark. I tried both of my devices but they have the same behaviour. The devices show up as expected at 0x0F on the I2C bus (via i2cdetect). I then tried a much shorter cable, thinking it might be cable length. Nope. Here’s a photo of the short test cable I was using. You can see I’m using the Extender Kit, with my own bespoke “jumper-jerky”:

This was tested using my own code so I tried the Pimoroni rotary.py example file with the same result, turning the knob has no effect. Curiously, with rotary.py the LED turns red as soon as I execute the script, but the LED color and the output numbers subsequently never change as I turn the knob. Now, if I plug that same RGB Encoder directly into the Breakout Garden it works fine, but even on a short 80mm cable it doesn’t work. I can plug an RGB Potentiometer into that same cable, or any other Breakout Garden device (e.g., 5x5 RGB Matrix, etc.) and it will work, so I don’t think this is an issue with a faulty cable, and I’ve tried multiple cables and multiple Extender Kit slots. Even tested everything with an ohmmeter.

As I’ve mentioned, I’ve got two RGB Encoders and two RGB Potentiometers and it doesn’t matter which one I’m testing.

It seems strange that of the three MS51 devices the RGB Encoders will seemingly only function when plugged directly into a Breakout Garden slot. The RGB Potentiometers and IO Expanders work even on long cables. Is this behaviour repeatable in your shop? I’d have thought the RGB Encoder would behave almost exactly as the RGB Potentiometer as they’re both just Novoton devices.

Not that it’s of any consequence but the test code is available on github.

Is it maybe the interrupt pin?

Great catch!

I’ve been using Breakout Garden boards, lots of them, over the past few years, and I’ve never bothered to wire up the INT pin since (up until now) I don’t think any of the boards I have use it. I think the reason I hadn’t tried adding the extra wire was my (clearly mistaken) assumption that the RGB Potentiometer and RGB Encoder boards were the same in this regard, both being MS51-based, and I had been using the former successfully.

So this morning I went ahead and added that fifth INT wire to my harness, and surprise: it works!

Thanks very much!

I have also been using a bunch of the Breakout Garden Breakouts. Some are in the Hat, some soldered to headers, some soldered to headers and soldered to a Proto Board. And some have cables made up of the jumpers like you did above. Most of mine don’t use that extra pin. I’d have to go check, but I think more often than not I didn’t wire it up. Where I used jumpers I didn’t. On my Proto boards I’m pretty sure I hooked it up. As far as I know it hasn’t been an issue for me so far.