cobra18t / CobraPin

Pinball Controller based on OPP and designed for use with MPF
GNU General Public License v3.0
11 stars 6 forks source link

Input Switches min/max resistance #7

Open worldpeace-germany opened 1 year ago

worldpeace-germany commented 1 year ago

Hi,

a short question, when I want to to use a direct input switch. So far I have closed the switch just by connecting the input pin to GND, so 0 Ohm between input and GND. I assume that internally there is some resistor that it is not a short circuit. So far nothing blew up, can you confirm that this is okay to do?

Now the more important question, what is the maximum resistance that the the switch is being considered as closed? I assume if I connect the input to GND via 100 Megaohm that this is not recognized as closed. Background of the question is photo diode, if I shine IR light on it, it has a resistance of 180 Ohm. Is that just a limit where it sometimes will work and sometimes not? What is a safe maximum for a resistor so the switch is reliably considered as closed?

Thanks!

cobra18t commented 1 year ago

The input pins are pulled up internally with a ~30k ohm resistor, so shorting that to GND is no issue.

A pure resistance analysis of the photodiode is insufficient. Since the matrix is rapidly scanning/pulsing through the columns, capacitance becomes a big player and photodiodes have a fair bit of capacitance.

Are you noticing inconsistencies in the switch performance using the photodiode? When using optos, I usually recommend using the external row pullups on the board to overcome the capacitive effect of the optos. Your photodiode may benefit from the same treatment. https://pinballmakers.com/wiki/index.php?title=CobraPin#Matrix_Row_Pull_Resistor_Jumpers

worldpeace-germany commented 1 year ago

Hello,

it seems to work, but maybe there is a restriction once I have more switches, whatsoever. It is just a fear I had and would like to be on the right path from the beginning. I saw the note on the pull resistor for the matrix switch, I am using direct input. I have some basic knowledge on electronics (and try to expand), but I am not able to judge if the part is valid as well for direct input switches. Since it was mentioned in the matrix section I decided not to be relevant. If it is, do I need pull up or down?

cobra18t commented 1 year ago

Ah, direct inputs should be fine. No need for the pull resistors.