Hi
When interfacing gpio pins to push button switches or (in my case) to the photo-transistor side of an opto-isolator, pull-up (or down) resistors are generally required. You can enable software pull-ups but I think these are a bit too large (+- 60 kilo ohms I believe).
I am using 10 k ohm resistors and I was just wondering if it is possible to combine the functionality of a pull-up resistor with an RC filter to deal with switch bounce and/or EMI.
In other words instead of just a 10 k ohm resistor , use a series combination of 10k ohm resistor and 100 n F capacitor. I know it sounds a bit crazy but in principle the capacitor should just charge up to Vcc through the resistor it's in series with. And discharge when there's a ground connection through the photo-transistor. So you should get your pull-up functionality and you also have an RC circuit with a time constant of 1 milli second. Might need a bit more than that but I'd just like to hear if (in principle) the idea is workable.
Did run it past AI and Chat gpt (anyway) seemed to think it would be ok.
When interfacing gpio pins to push button switches or (in my case) to the photo-transistor side of an opto-isolator, pull-up (or down) resistors are generally required. You can enable software pull-ups but I think these are a bit too large (+- 60 kilo ohms I believe).
I am using 10 k ohm resistors and I was just wondering if it is possible to combine the functionality of a pull-up resistor with an RC filter to deal with switch bounce and/or EMI.
In other words instead of just a 10 k ohm resistor , use a series combination of 10k ohm resistor and 100 n F capacitor. I know it sounds a bit crazy but in principle the capacitor should just charge up to Vcc through the resistor it's in series with. And discharge when there's a ground connection through the photo-transistor. So you should get your pull-up functionality and you also have an RC circuit with a time constant of 1 milli second. Might need a bit more than that but I'd just like to hear if (in principle) the idea is workable.
Did run it past AI and Chat gpt (anyway) seemed to think it would be ok.
Statistics: Posted by neilparker62 — Thu Jul 24, 2025 8:00 am — Replies 2 — Views 60