I'm trying to connect a simple reed switch to my Raspberry to check if my door is open or not. I found plenty of tutorials online, but all of their schematics behave different, so I decided to create one myself and check if it seems resonable.
My first test simply lights up a LED when the switch lets the current flow. As my LED is 2V 20mA, a resistor of (3.3-2)/0.02 = 65 Ohm should be enough, but I only have 100 Ohm, it should be ok right?
The next step is to capture the switch event in the GPIO 5 listening for 3.3v input.
I want a max current of 1mA to flow through my pin, so I pick a resistor of around 3k Ohm. Say 5k for safe purposes.
Here is the problem. On every example I found around, the most common used resistor is 10k, and it's always something like this:
Why do I need such a big resistor? And why should I wire to GND too if my GPIO receives a resonably amount of Voltage and current (or 0 when the switch is off)?
Thanks in advance.