1

I just set up my pi to run Homebridge allowing it to control an LED strip over GPIO pins, it all works well except the LED lights flicker with radio interference. This interference is very noticeable when I scroll my mouse wheel. Before I get any dumb suggesting like 'try unplugging your mouse', the mouse is plugged into my laptop on the other side of my desk, two totally different setups.

some previous reading I had done lead me to conclude that I may need to add a small cap close to the GPIO pins, but quite frankly I'm no electrical engineer so I'm going to need some help. Would I just put an inline cap with each GPIO signal wire for the R, G, and B pins?

Side note, when substituting the Raspberry Pi for an Arduino the whole system works flawlessly, however, I'm using the pi because the Arduino clearly can't run Homebridge.

Here's a basic diagram of what I have now:

enter image description here

  • I doubt noise on the wire is the cause of the problem. Noise on the wire is associated with a GPIO not being actively driven, e.g. a GPIO set as an input might randomly read 0 or 1 with interference. A GPIO set as an output would not see noise as it is being driven high or low. – joan Jun 1 '18 at 17:11
  • Even a driven line can experience noise if is intense enough, this is why long distance cabled transmissions use differential signals (like RS485) since both lines will be effected the same by the noise. But it could also be another issue. The mouse in question sounds like its a wired mouse? It should not be putting off enough noise to effect even an undriven line that far away. Could be a bad mouse. But yes a cap setup as an AC filter could help. But it will also effect how quickly those lines change state. Are they switched at a high frequency? – Chad G Jun 1 '18 at 17:56
  • youtu.be/FxSrMBXZDHc here is my youtube video of whats going on, clearly something odd. @ChadG no, its a wireless MX Master – Gunnar Bjorkman Jun 1 '18 at 18:08
  • your diagram shows no ground connection between the RPi and the mosfets – jsotola Jun 1 '18 at 22:21
  • @jsotola that is what the black wires indicate, no? Again the system works it just has an abnormal twitch in the lights when there is radio interference. – Gunnar Bjorkman Jun 1 '18 at 23:23
2

MOSFETs trigger voltage is 2V-5V. GPIO voltage is 3.3V. You could call your design a bug or a feature. It's actually a very cool way to mess with your friends.

One way to fix this is to use a PiMoroni Automation Hat. This hat has three relays which can be used to turn whatever on/off. I've used them for 12V, you could use them for 5V or whatever triggers your MOSFETS. Chaining relays in such a fashion is a bit crude, but hackable. One exception to this is PWM. If you are controlling your LED brightness with PWM (vs., simple on/off), then you'll need a solid state solution (e.g., transistors), not mechanical relays.

  • 1
    wow you're right, I didn't notice until now that the Arduino was able to make the lights brighter because it was outputting the full 5v per RGB signal wire, the GPIO is much dimmer. Well, it looks like GPIO isn't the way to go about this I might try and make the raspberry pi send serial data to the Arduino instead. – Gunnar Bjorkman Jun 2 '18 at 15:06
  • Glad to help. If this answer works for you, please accept--it will help me get my next badge. :D – OyaMist Jun 2 '18 at 15:41
  • It didn't answer my question, rather it told me why I should change my current setup, thank you though! @OyaMist Aeroponics – Gunnar Bjorkman Jun 3 '18 at 4:06
  • 1
    now it answered my question! :) this is exactly what I'm setting up, throwing an adafruit pwm hat on the pi and letting it run, however, I need to write my own homebridge plugin for that. (and yes the original design used the gpio pins to dim the LEDs and give different colors, i just didnt want to over complicate the question) – Gunnar Bjorkman Jun 4 '18 at 5:20
1

You have just discovered why Raspberry Pi makes a good Software Defined Radio :) But more to your point, what you are seeing is why most video cables are shielded and have rf chokes built into them. A clip-on ferrite core filter will help - something like this. And here's a YouTube video (rather long-winded, maybe more than you want to know) that explains how they work.

  • I think I'll try to just brute-force my way through it and use a PWM hat, this should work. I've been doing a lot of testing at work with motor speed controller and they have this 'twitch' in them which is what I've found here with my RPi, however using a PWM hat fixed this issue. – Gunnar Bjorkman Jun 3 '18 at 4:15
  • That's fine - whatever works. Good luck! – Seamus Jun 3 '18 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.