I have a Teensy 4.1 in a shielded environment, with a 25 foot cable run connected to many switches in a very electrically noisy environment (acoustically, too). Have previously used Teensy 2++ and one of the Teensy 3 models (I forget which) successfully at least a dozen times; not sure if that is a factor or if this environment is just different. I believe these were all 5v devices and the Teensy 4 is obviously 3.3v. I'm basically using every single digital pin available.
The buttons have a common ground and are wired to Teensy digital input pins with pull up turned on. Pressing a button closes the circuit. The cable shield is not connected to anything, my understanding was this would just funnel noise from the outside into the shielded enclosure.
I'm using the Debounce library with a 20ms debouce time. Teensy spits out serial data on the rising edge using the debouce library functionality. There is NO hardware filtering currently (because to date I never needed it!).
Problem:
The inputs are triggering without the buttons being pressed. I don't have the opportunity to get a scope on the lines either because I can't get into the facility, so working blind here. I took two years of computer engineering classes twenty years ago, so my memory is really foggy re possible solutions.
I'm trying to think of solutions and appreciate ideas. What came to mind was:
1) Go back to Teensy 2++ in the hope that somehow 5v makes the SNR better -OR- come up with some circuits so the signals are 12v or some other higher voltage
2) Add lots of RC filtering, since humans can't press buttons very fast anyway. This is a bit problematic because of the component count. I could just throw big caps (1000uF) across each input like a Cro-magnon electrical engineer, or do the math and figure out a combo of resistor-capacitor to get a 1st order filter with a more predictable cutoff frequency.
3) Clamp on ferrite beads
4) Differential signaling is probably too complicated.
The buttons have a common ground and are wired to Teensy digital input pins with pull up turned on. Pressing a button closes the circuit. The cable shield is not connected to anything, my understanding was this would just funnel noise from the outside into the shielded enclosure.
I'm using the Debounce library with a 20ms debouce time. Teensy spits out serial data on the rising edge using the debouce library functionality. There is NO hardware filtering currently (because to date I never needed it!).
Problem:
The inputs are triggering without the buttons being pressed. I don't have the opportunity to get a scope on the lines either because I can't get into the facility, so working blind here. I took two years of computer engineering classes twenty years ago, so my memory is really foggy re possible solutions.
I'm trying to think of solutions and appreciate ideas. What came to mind was:
1) Go back to Teensy 2++ in the hope that somehow 5v makes the SNR better -OR- come up with some circuits so the signals are 12v or some other higher voltage
2) Add lots of RC filtering, since humans can't press buttons very fast anyway. This is a bit problematic because of the component count. I could just throw big caps (1000uF) across each input like a Cro-magnon electrical engineer, or do the math and figure out a combo of resistor-capacitor to get a 1st order filter with a more predictable cutoff frequency.
3) Clamp on ferrite beads
4) Differential signaling is probably too complicated.