Fixing spurious noise for GPIO inputs

All the topics related to QLC+ on the Raspberry Pi
Post Reply
User avatar
karrika
Posts: 60
Joined: Tue May 12, 2015 6:50 am
Real Name: Karri Kaksonen

Hi,

I have had 2 spurious GPIO input triggers this summer and decided to study it a bit further. The Raspberry Pi seems to trigger even without any external wires and using just a pullup resistor. My guess is that the noise can enter via the power supply or even be generated by the Pi itself.

Fortunately there is an easy solution. Before asking for permission to make a pull request I thought of discussing this thing on the forum.

The GPIO pins are polled every 50ms. What I would like to do is to add a hysteresis counter that requires the pin to be in the new state for 4 consecutive polls before it is declared valid.

This will slow down the GPIO button response by 200ms for both pushing and releasing a button. According to my tests this totally eliminates ghost pushes that seems to be a major nuisance when you read through the Raspberrypi.org forums.

Best regards,
Karri
iamchrislaurie
Posts: 58
Joined: Mon Apr 27, 2015 11:27 am
Real Name: Chris Laurie

Hi Karri

I would like to test this but I am having difficulty wiring up the buttons. I connect the switch between an input pin and ground but it does not seem to register when I press it. Also it seems the GPIO settings on the input plugin is reset to none (from input) when I close and re-open my workspace.

I have been able to get some buttons to be read when I connect the button between 5v and a pin but that seems just plain wrong. I'm pretty sure one is supposed to use the pullup (wired to GND).

I use an own built version of QLC+ on Linux for this (as opposed to the image that Massimo distributes).

Cheers

Chris
User avatar
karrika
Posts: 60
Joined: Tue May 12, 2015 6:50 am
Real Name: Karri Kaksonen

Hi Chris, this is not how it should work.

You should assign GPIO as input to Universe 1.

If you assign the pins 12, 16, 22, 23, 24, 25, 26, 27 as inputs then pressing any switch should light up a joystick picture at the right side of the Universe box.

When you save your project the GPIO settings are also saved.

I have tested this with my own QLC+ compilation and also with Massimos image. Both work ok. The hysteresis patch is currently being evaluated and it may be part of QLC+.

I can send you a new DiscoHAT card. Small things have changed since I sent you the prototype. There is also some topics I would like to discuss about DMX outputs. Currently DiscoHAT is terminated by a 120 ohm resistor. For noisy environments it could be replaces by two common mode filters (a structure with two 60 ohms precision resistors connected to a 220pF grounded capacitor). Another trail would be to add failsafe circuitry to feed a good logic state to the wires when nobody is feeding the data. The failsafe adds two 523 ohm resistors. The downside is that this would reduce how many lights you can put on the wire.
FoxOne
Posts: 8
Joined: Tue Nov 17, 2015 3:31 pm
Real Name: Lee Nollette

Nope, 3v3/5v drives gpio HIGH , pull-up is on backside ... I usually use 220 ohm.
Post Reply